Search in sources :

Example 1 with TypeSelectionPath

use of com.google.security.zynamics.binnavi.Gui.GraphWindows.types.TypesTree.TypeSelectionPath in project binnavi by google.

the class TypeSubstitutionDialog method createControls.

private void createControls(final BaseType stackFrame) {
    setBounds(100, 100, 691, 470);
    final JPanel panel = new JPanel();
    getContentPane().add(panel, BorderLayout.SOUTH);
    panel.setLayout(new FlowLayout(FlowLayout.RIGHT));
    final JButton buttonOk = new JButton("OK");
    buttonOk.addActionListener(new OkActionListener());
    panel.add(buttonOk);
    final JButton buttonCancel = new JButton("Cancel");
    buttonCancel.addActionListener(new ActionListener() {

        @Override
        public void actionPerformed(final ActionEvent e) {
            dispose();
        }
    });
    buttonCancel.setActionCommand("Cancel");
    panel.add(buttonCancel);
    final JPanel panel1 = new JPanel();
    getContentPane().add(panel1, BorderLayout.NORTH);
    final GridBagLayout gblPanel1 = new GridBagLayout();
    gblPanel1.columnWidths = new int[] { 0, 143, 114, 0 };
    gblPanel1.rowHeights = new int[] { 23, 0 };
    gblPanel1.columnWeights = new double[] { 0.0, 0.0, 1.0, Double.MIN_VALUE };
    gblPanel1.rowWeights = new double[] { 0.0, Double.MIN_VALUE };
    panel1.setLayout(gblPanel1);
    JCheckBox onlyFitting = new JCheckBox("Only show structs that fit immediate offset");
    onlyFitting.setEnabled(false);
    GridBagConstraints gbcOnlyFitting = new GridBagConstraints();
    gbcOnlyFitting.anchor = GridBagConstraints.WEST;
    gbcOnlyFitting.insets = new Insets(0, 0, 0, 5);
    gbcOnlyFitting.gridx = 0;
    gbcOnlyFitting.gridy = 0;
    panel1.add(onlyFitting, gbcOnlyFitting);
    types = new TypesTree();
    types.setModel(new TypesTreeModel(typeManager, new LocalTypesFilter(stackFrame)));
    types.getSelectionModel().setSelectionMode(TreeSelectionModel.SINGLE_TREE_SELECTION);
    types.addTreeSelectionListener(new TreeSelectionListener() {

        @Override
        public void valueChanged(TreeSelectionEvent event) {
            final TypeSelectionPath path = types.determineTypePath();
            if (validateUserInput(path)) {
                updatePreview(path);
            }
        }
    });
    final JPanel centerPanel = new JPanel();
    centerPanel.setLayout(new BoxLayout(centerPanel, BoxLayout.PAGE_AXIS));
    centerPanel.add(new JScrollPane(types));
    centerPanel.add(preview);
    getContentPane().add(centerPanel, BorderLayout.CENTER);
}
Also used : JScrollPane(javax.swing.JScrollPane) JPanel(javax.swing.JPanel) GridBagConstraints(java.awt.GridBagConstraints) FlowLayout(java.awt.FlowLayout) Insets(java.awt.Insets) GridBagLayout(java.awt.GridBagLayout) ActionEvent(java.awt.event.ActionEvent) BoxLayout(javax.swing.BoxLayout) JButton(javax.swing.JButton) TypeSelectionPath(com.google.security.zynamics.binnavi.Gui.GraphWindows.types.TypesTree.TypeSelectionPath) TreeSelectionListener(javax.swing.event.TreeSelectionListener) JCheckBox(javax.swing.JCheckBox) ActionListener(java.awt.event.ActionListener) TreeSelectionEvent(javax.swing.event.TreeSelectionEvent)

Aggregations

TypeSelectionPath (com.google.security.zynamics.binnavi.Gui.GraphWindows.types.TypesTree.TypeSelectionPath)1 FlowLayout (java.awt.FlowLayout)1 GridBagConstraints (java.awt.GridBagConstraints)1 GridBagLayout (java.awt.GridBagLayout)1 Insets (java.awt.Insets)1 ActionEvent (java.awt.event.ActionEvent)1 ActionListener (java.awt.event.ActionListener)1 BoxLayout (javax.swing.BoxLayout)1 JButton (javax.swing.JButton)1 JCheckBox (javax.swing.JCheckBox)1 JPanel (javax.swing.JPanel)1 JScrollPane (javax.swing.JScrollPane)1 TreeSelectionEvent (javax.swing.event.TreeSelectionEvent)1 TreeSelectionListener (javax.swing.event.TreeSelectionListener)1