Search in sources :

Example 21 with GridLayout

use of java.awt.GridLayout in project binnavi by google.

the class CCriteriaDialog method initDialog.

/**
   * Creates the GUI of the dialog.
   *
   * @param jtree Tree component shown in the dialog.
   * @param selectionBox Used to select new criteria.
   * @param defineConditionPanel Panel where the condition is shown.
   * @param okCancelPanel Panel that contains the OK and Cancel buttons.
   * @param addConditionButton Add Condition button.
   */
private void initDialog(final JCriteriumTree jtree, final CConditionBox selectionBox, final JPanel defineConditionPanel, final CPanelTwoButtons okCancelPanel, final JButton addConditionButton) {
    final JPanel mainPanel = new JPanel(new BorderLayout());
    final JPanel deviderBorderPanel = new JPanel(new BorderLayout());
    // (""));
    deviderBorderPanel.setBorder(new EmptyBorder(2, 2, 2, 2));
    final JPanel deviderPanel = 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(deviderBorderPanel, BorderLayout.CENTER);
    mainPanel.add(okCancelPanel, BorderLayout.SOUTH);
    okCancelPanel.getFirstButton().setEnabled(jtree.getSelectionPath() != null);
    deviderBorderPanel.add(deviderPanel, BorderLayout.CENTER);
    deviderPanel.add(leftPanel);
    deviderPanel.add(rightPanel);
    final JScrollPane pane = new JScrollPane(jtree);
    pane.setVerticalScrollBarPolicy(ScrollPaneConstants.VERTICAL_SCROLLBAR_AS_NEEDED);
    pane.setHorizontalScrollBarPolicy(ScrollPaneConstants.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();
}
Also used : JScrollPane(javax.swing.JScrollPane) JPanel(javax.swing.JPanel) GridLayout(java.awt.GridLayout) BorderLayout(java.awt.BorderLayout) EmptyBorder(javax.swing.border.EmptyBorder) TitledBorder(javax.swing.border.TitledBorder)

Example 22 with GridLayout

use of java.awt.GridLayout in project binnavi by google.

the class CTextCriteriumPanel method initPanel.

/**
   * Creates the panel GUI.
   */
private void initPanel() {
    final JPanel mainPanel = new JPanel(new BorderLayout());
    mainPanel.setBorder(new TitledBorder("Edit Text Condition"));
    final JPanel inputPanel = new JPanel(new BorderLayout());
    inputPanel.setBorder(new EmptyBorder(5, 5, 5, 5));
    m_inputField.setPreferredSize(new Dimension(m_inputField.getPreferredSize().width, 23));
    inputPanel.add(m_inputField, BorderLayout.NORTH);
    final JPanel checkboxesPanel = new JPanel(new GridLayout(2, 1));
    checkboxesPanel.setBorder(new EmptyBorder(5, 0, 0, 0));
    checkboxesPanel.add(m_caseSensitiveBox);
    checkboxesPanel.add(m_regExBox);
    inputPanel.add(checkboxesPanel, BorderLayout.CENTER);
    mainPanel.add(inputPanel, BorderLayout.NORTH);
    add(mainPanel, BorderLayout.CENTER);
}
Also used : JPanel(javax.swing.JPanel) GridLayout(java.awt.GridLayout) BorderLayout(java.awt.BorderLayout) Dimension(java.awt.Dimension) TitledBorder(javax.swing.border.TitledBorder) EmptyBorder(javax.swing.border.EmptyBorder)

Example 23 with GridLayout

use of java.awt.GridLayout in project binnavi by google.

the class CProjectNodeComponent method createGui.

/**
   * Creates the elements of this component.
   */
private void createGui() {
    final JPanel topPanel = new JPanel(new BorderLayout());
    final JPanel innerTopPanel = new JPanel(new BorderLayout());
    innerTopPanel.add(m_stdEditPanel);
    topPanel.add(innerTopPanel);
    final JPanel debuggerChooserPanel = new JPanel(new BorderLayout());
    debuggerChooserPanel.setBorder(new TitledBorder("Project Debuggers"));
    m_checkedList = new JCheckedListbox<>(new Vector<DebuggerTemplate>(), false);
    updateCheckedListPanel();
    final JScrollPane debuggerScrollPane = new JScrollPane(m_checkedList);
    m_checkedListPanel.add(debuggerScrollPane);
    debuggerChooserPanel.add(m_checkedListPanel, BorderLayout.CENTER);
    debuggerChooserPanel.setMinimumSize(new Dimension(0, 128));
    debuggerChooserPanel.setPreferredSize(new Dimension(0, 128));
    innerTopPanel.add(debuggerChooserPanel, BorderLayout.SOUTH);
    final JPanel buttonPanel = new JPanel(new GridLayout(1, 2));
    buttonPanel.setBorder(new EmptyBorder(0, 0, 5, 2));
    buttonPanel.add(new JPanel());
    buttonPanel.add(m_saveButton);
    topPanel.add(buttonPanel, BorderLayout.SOUTH);
    final JPanel bottomPanel = new CAddressSpacesTablePanel(m_table);
    final JScrollPane scrollPane = new JScrollPane(m_table);
    bottomPanel.setBorder(m_titledBorder);
    setBorder(new EmptyBorder(0, 0, 0, 1));
    bottomPanel.add(scrollPane);
    final JSplitPane splitPane = new JSplitPane(JSplitPane.VERTICAL_SPLIT, true, topPanel, bottomPanel);
    splitPane.setOneTouchExpandable(true);
    splitPane.setDividerLocation(splitPane.getMinimumDividerLocation());
    splitPane.setResizeWeight(0.5);
    add(splitPane);
}
Also used : JScrollPane(javax.swing.JScrollPane) JPanel(javax.swing.JPanel) GridLayout(java.awt.GridLayout) BorderLayout(java.awt.BorderLayout) Dimension(java.awt.Dimension) TitledBorder(javax.swing.border.TitledBorder) EmptyBorder(javax.swing.border.EmptyBorder) JSplitPane(javax.swing.JSplitPane) Vector(java.util.Vector) CAddressSpacesTablePanel(com.google.security.zynamics.binnavi.Gui.FilterPanel.Default.CAddressSpacesTablePanel)

Example 24 with GridLayout

use of java.awt.GridLayout in project binnavi by google.

the class COptionsPanel method buildRow.

/**
   * Builds a single row of components in the panel.
   * 
   * @param <T> Type of the editing component.
   * 
   * @param panel Panel the editing component is added to.
   * @param description Type description to be configured in that row.
   * @param hint Hint shown as a tooltip.
   * @param component The component to add to the panel.
   * @param isLast True, if the component is the last component to be added to the panel.
   * 
   * @return The panel passed to the function.
   */
private <T extends Component> T buildRow(final JPanel panel, final ITypeDescription description, final String hint, final T component, final boolean isLast) {
    component.setPreferredSize(new Dimension(COLORPANEL_WIDTH, COLORPANEL_HEIGHT));
    final JPanel rowPanel = new JPanel(new BorderLayout());
    rowPanel.setBorder(new EmptyBorder(0, 2, isLast ? 2 : 0, 2));
    final JPanel innerPanel = new JPanel(new GridLayout(1, 2));
    innerPanel.add(new JCheckBox(new CheckboxAction(description, description.getDescription() + ":")), BorderLayout.CENTER);
    innerPanel.add(CHintCreator.createHintPanel(component, hint), BorderLayout.EAST);
    rowPanel.add(innerPanel, BorderLayout.WEST);
    panel.add(rowPanel);
    return component;
}
Also used : JCheckBox(javax.swing.JCheckBox) JPanel(javax.swing.JPanel) GridLayout(java.awt.GridLayout) BorderLayout(java.awt.BorderLayout) Dimension(java.awt.Dimension) EmptyBorder(javax.swing.border.EmptyBorder)

Example 25 with GridLayout

use of java.awt.GridLayout in project binnavi by google.

the class CTraceOptionsDialog method createPanel.

/**
   * Creates a standard edit panel of the dialog.
   *
   * @param description Description of the option.
   * @param component The component used to edit the option.
   *
   * @return The created edit panel.
   */
private Component createPanel(final String description, final JComponent component) {
    final JPanel panel = new JPanel(new GridLayout(1, 2));
    panel.add(new JLabel(description));
    panel.add(component);
    return panel;
}
Also used : JPanel(javax.swing.JPanel) GridLayout(java.awt.GridLayout) JLabel(javax.swing.JLabel)

Aggregations

GridLayout (java.awt.GridLayout)142 JPanel (javax.swing.JPanel)106 JLabel (javax.swing.JLabel)54 BorderLayout (java.awt.BorderLayout)50 Dimension (java.awt.Dimension)32 JButton (javax.swing.JButton)32 ActionEvent (java.awt.event.ActionEvent)29 JScrollPane (javax.swing.JScrollPane)27 ActionListener (java.awt.event.ActionListener)25 JTextField (javax.swing.JTextField)23 Insets (java.awt.Insets)21 JCheckBox (javax.swing.JCheckBox)21 GridBagConstraints (java.awt.GridBagConstraints)17 GridBagLayout (java.awt.GridBagLayout)17 TitledBorder (javax.swing.border.TitledBorder)17 PlotCanvas (smile.plot.PlotCanvas)16 BoxLayout (javax.swing.BoxLayout)15 EmptyBorder (javax.swing.border.EmptyBorder)15 FlowLayout (java.awt.FlowLayout)13 ButtonGroup (javax.swing.ButtonGroup)10