private void initDialog(
      final Window owner,
      final JCriterionTree jtree,
      final ConditionBox selectionBox,
      final JPanel defineConditionPanel,
      final CPanelTwoButtons okCancelPanel,
      final JButton addConditionButton) {
    final JPanel mainPanel = new JPanel(new BorderLayout());

    final JPanel dividerBorderPanel = new JPanel(new BorderLayout());
    dividerBorderPanel.setBorder(new EmptyBorder(2, 2, 2, 2));

    final JPanel dividerPanel = new JPanel(new GridLayout(1, 2));

    final JPanel leftPanel = new JPanel(new BorderLayout());
    leftPanel.setBorder(new TitledBorder("Expression Tree"));

    final JPanel rightPanel = new JPanel(new BorderLayout());
    final JPanel rightTopPanel = new JPanel(new BorderLayout());
    rightTopPanel.setBorder(new TitledBorder("Create Condition"));

    final JPanel rightTopComboPanel = new JPanel(new BorderLayout());
    rightTopComboPanel.setBorder(new EmptyBorder(1, 5, 5, 5));

    final JPanel rightTopAddPanel = new JPanel(new BorderLayout());
    rightTopAddPanel.setBorder(new EmptyBorder(1, 0, 5, 5));

    mainPanel.add(dividerBorderPanel, BorderLayout.CENTER);
    mainPanel.add(okCancelPanel, BorderLayout.SOUTH);
    okCancelPanel.getFirstButton().setEnabled(jtree.getSelectionPath() != null);

    dividerBorderPanel.add(dividerPanel, BorderLayout.CENTER);

    dividerPanel.add(leftPanel);
    dividerPanel.add(rightPanel);

    final JScrollPane pane = new JScrollPane(jtree);
    pane.setVerticalScrollBarPolicy(JScrollPane.VERTICAL_SCROLLBAR_AS_NEEDED);
    pane.setHorizontalScrollBarPolicy(JScrollPane.HORIZONTAL_SCROLLBAR_AS_NEEDED);

    leftPanel.add(pane, BorderLayout.CENTER);

    defineConditionPanel.setBorder(new TitledBorder("Define Condition"));

    rightPanel.add(rightTopPanel, BorderLayout.NORTH);
    rightPanel.add(defineConditionPanel, BorderLayout.CENTER);

    rightTopPanel.add(rightTopComboPanel, BorderLayout.CENTER);
    rightTopPanel.add(rightTopAddPanel, BorderLayout.EAST);

    rightTopComboPanel.add(selectionBox, BorderLayout.CENTER);

    addConditionButton.setText("Add");

    addConditionButton.setEnabled(false);
    rightTopAddPanel.add(addConditionButton, BorderLayout.CENTER);

    add(mainPanel);

    setIconImage(null);

    pack();

    GuiHelper.centerChildToParent(owner, this, true);
  }
Dialog class that provides the option to select nodes of a graph according to certain criteria
(node color, contains text XYZ, ...).
java/ui/src/main/java/com/google/security/zynamics/bindiff/gui/dialogs/criteriadialog/CriteriaDialog.java