Search in sources :

Example 6 with TitledBorder

use of javax.swing.border.TitledBorder in project binnavi by google.

the class TypeEditorPanel method createControls.

private void createControls(final TypeManager typeManager, final String caption) {
    setBounds(100, 100, 588, 529);
    setLayout(new BorderLayout());
    setBorder(new TitledBorder(new LineBorder(Color.LIGHT_GRAY, 1, true), caption));
    contentPanel.setBorder(new EmptyBorder(5, 5, 5, 5));
    add(new TypeEditorSearchPanel(typesTree), BorderLayout.NORTH);
    add(contentPanel, BorderLayout.CENTER);
    contentPanel.setLayout(new BorderLayout(0, 0));
    {
        final JScrollPane scrollPane = new JScrollPane();
        contentPanel.add(scrollPane, BorderLayout.CENTER);
        {
            typesTree.addMouseListener(new TypeEditorMouseHandler(owner, typesTree, typeManager, this));
            typesTree.getInputMap().put(KeyStroke.getKeyStroke(KeyEvent.VK_DELETE, 0, true), "delete_types_or_members");
            typesTree.getActionMap().put("delete_types_or_members", new DeleteTypeOrMemberAction(owner, typeManager, this));
            scrollPane.setViewportView(typesTree);
        }
    }
}
Also used : JScrollPane(javax.swing.JScrollPane) BorderLayout(java.awt.BorderLayout) LineBorder(javax.swing.border.LineBorder) TitledBorder(javax.swing.border.TitledBorder) EmptyBorder(javax.swing.border.EmptyBorder)

Example 7 with TitledBorder

use of javax.swing.border.TitledBorder 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 8 with TitledBorder

use of javax.swing.border.TitledBorder in project binnavi by google.

the class CDialogUpdater method updateDefineConditionPanel.

/**
   * Updates the condition configuration panel.
   *
   * @param node The actively selected node.
   */
private void updateDefineConditionPanel(final JCriteriumTreeNode node) {
    final Component component = node.getCriterium().getCriteriumPanel();
    m_defineConditionPanel.removeAll();
    m_defineConditionPanel.setBorder(null);
    if (component == null) {
        final JPanel defaultPanel = new JPanel(new BorderLayout());
        defaultPanel.setBorder(new TitledBorder("Define Condition"));
        m_defineConditionPanel.add(defaultPanel, BorderLayout.CENTER);
    } else {
        m_defineConditionPanel.add(component);
    }
    m_defineConditionPanel.updateUI();
}
Also used : JPanel(javax.swing.JPanel) BorderLayout(java.awt.BorderLayout) Component(java.awt.Component) TitledBorder(javax.swing.border.TitledBorder)

Example 9 with TitledBorder

use of javax.swing.border.TitledBorder in project binnavi by google.

the class CSelectionCriteriumPanel method initPanel.

/**
   * Creates the GUI of the panel.
   */
private void initPanel() {
    final JPanel mainPanel = new JPanel(new BorderLayout());
    mainPanel.setBorder(new TitledBorder("Edit Selection Condition"));
    final JPanel comboPanel = new JPanel(new BorderLayout());
    comboPanel.setBorder(new EmptyBorder(5, 5, 5, 5));
    selectionStateBox.addItem(SelectionState.SELECTED);
    selectionStateBox.addItem(SelectionState.UNSELECTED);
    comboPanel.add(selectionStateBox, BorderLayout.CENTER);
    mainPanel.add(comboPanel, BorderLayout.NORTH);
    add(mainPanel, BorderLayout.CENTER);
}
Also used : JPanel(javax.swing.JPanel) BorderLayout(java.awt.BorderLayout) TitledBorder(javax.swing.border.TitledBorder) EmptyBorder(javax.swing.border.EmptyBorder)

Example 10 with TitledBorder

use of javax.swing.border.TitledBorder 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)

Aggregations

TitledBorder (javax.swing.border.TitledBorder)96 JPanel (javax.swing.JPanel)58 BorderLayout (java.awt.BorderLayout)30 GridBagConstraints (java.awt.GridBagConstraints)27 JLabel (javax.swing.JLabel)25 JScrollPane (javax.swing.JScrollPane)21 GridBagLayout (java.awt.GridBagLayout)20 Insets (java.awt.Insets)20 JButton (javax.swing.JButton)19 Dimension (java.awt.Dimension)18 EmptyBorder (javax.swing.border.EmptyBorder)18 GridLayout (java.awt.GridLayout)17 ActionEvent (java.awt.event.ActionEvent)17 ActionListener (java.awt.event.ActionListener)15 JCheckBox (javax.swing.JCheckBox)10 Color (java.awt.Color)9 Border (javax.swing.border.Border)9 FlowLayout (java.awt.FlowLayout)7 EtchedBorder (javax.swing.border.EtchedBorder)7 JTextField (javax.swing.JTextField)6