Search in sources :

Example 96 with JTabbedPane

use of javax.swing.JTabbedPane in project processdash by dtuma.

the class WBSFindAction method createDialog.

private void createDialog() {
    JPanel panel = new JPanel();
    panel.setBorder(BorderFactory.createEmptyBorder(5, 8, 10, 8));
    GridBagLayout layout = new GridBagLayout();
    panel.setLayout(layout);
    FindPreviousAction findPrevious = new FindPreviousAction();
    findNext = new FindNextAction();
    ReplaceAction replace = new ReplaceAction();
    CancelAction cancel = new CancelAction();
    setKey(panel, KeyEvent.VK_P, InputEvent.ALT_DOWN_MASK, findPrevious);
    setKey(panel, KeyEvent.VK_N, InputEvent.ALT_DOWN_MASK, findNext);
    setKey(panel, KeyEvent.VK_R, InputEvent.ALT_DOWN_MASK, replace);
    setKey(panel, KeyEvent.VK_ESCAPE, 0, cancel);
    GridBagConstraints lc = new GridBagConstraints();
    lc.gridx = lc.gridy = 0;
    lc.gridwidth = 2;
    lc.anchor = GridBagConstraints.WEST;
    lc.insets = new Insets(33, 12, 5, 5);
    panel.add(new JLabel(resources.getString("Label")), lc);
    GridBagConstraints tc = new GridBagConstraints();
    tc.gridx = 2;
    tc.gridy = 0;
    tc.fill = GridBagConstraints.BOTH;
    tc.weightx = 1;
    tc.gridwidth = 2;
    tc.insets = new Insets(33, 0, 5, 12);
    searchField = new JComboBoxWithHistory();
    searchField.getEditor().addActionListener(new FindNextTrigger());
    panel.add(searchField, tc);
    lc.gridy++;
    tc.gridy++;
    lc.insets.top = tc.insets.top = 0;
    replaceLabel = new JLabel(resources.getString("Replace_Label"));
    panel.add(replaceLabel, lc);
    replaceField = new JComboBoxWithHistory();
    panel.add(replaceField, tc);
    panel.add(BoxUtils.createHorizontalStrut(replaceLabel.getPreferredSize().width), lc);
    panel.add(BoxUtils.createVerticalStrut(replaceField.getPreferredSize().height), tc);
    replaceLabel.setVisible(false);
    replaceField.setVisible(false);
    lc.gridy++;
    panel.add(BoxUtils.createVerticalStrut(10), lc);
    lc.gridy++;
    lc.gridwidth = 1;
    panel.add(new JLabel(resources.getString("Within.Label")), lc);
    GridBagConstraints pc = new GridBagConstraints();
    pc.gridx = 1;
    pc.gridy = lc.gridy;
    pc.gridwidth = 2;
    pc.insets = tc.insets;
    pc.fill = GridBagConstraints.BOTH;
    searchScope = new JComboBox(Scope.values());
    searchScope.setSelectedItem(Scope.All);
    searchScope.addItemListener(new ItemListener() {

        public void itemStateChanged(ItemEvent e) {
            selectedColumns = null;
        }
    });
    panel.add(searchScope, pc);
    lc.gridy++;
    pc.gridy++;
    panel.add(new JLabel(resources.getString("Match.Label")), lc);
    matchType = new JComboBox(Match.values());
    matchType.setSelectedItem(Match.Within);
    panel.add(matchType, pc);
    lc.gridy++;
    pc.gridy++;
    lc.insets.bottom = pc.insets.bottom = 12;
    panel.add(new JLabel(resources.getString("Search_By.Label")), lc);
    rowsOrColumns = new JComboBox(Direction.values());
    rowsOrColumns.setSelectedItem(Direction.Rows);
    panel.add(rowsOrColumns, pc);
    GridBagConstraints wc = new GridBagConstraints();
    wc.gridx = 3;
    wc.gridy = lc.gridy;
    wc.anchor = GridBagConstraints.WEST;
    wc.insets = lc.insets;
    wc.insets.left = 5;
    wrappedIcon = new WrappedIcon();
    panel.add(wrappedIcon, wc);
    GridBagConstraints bc = new GridBagConstraints();
    bc.gridy = lc.gridy + 1;
    bc.anchor = GridBagConstraints.EAST;
    bc.insets = new Insets(10, 5, 0, 0);
    bc.gridwidth = 4;
    Box buttonBox = Box.createHorizontalBox();
    replaceButton = new JButton(replace);
    replaceButton.setVisible(false);
    buttonBox.add(replaceButton);
    buttonBox.add(Box.createHorizontalStrut(30));
    buttonBox.add(prevButton = new JButton(findPrevious));
    buttonBox.add(Box.createHorizontalStrut(5));
    buttonBox.add(new JButton(findNext));
    buttonBox.add(Box.createHorizontalStrut(20));
    buttonBox.add(new JButton(cancel));
    panel.add(buttonBox, bc);
    GridBagConstraints tpc = new GridBagConstraints();
    tpc.gridx = tpc.gridy = 0;
    tpc.gridwidth = 4;
    tpc.gridheight = bc.gridy;
    tpc.fill = GridBagConstraints.BOTH;
    tabs = new JTabbedPane();
    tabs.add(resources.getString("Find"), new JPanel());
    tabs.add(resources.getString("Replace"), new JPanel());
    tabs.addChangeListener(new TabHandler());
    panel.add(tabs, tpc);
    JFrame f = (JFrame) SwingUtilities.getWindowAncestor(tabPanel);
    dialog = new JDialog(f, resources.getString("Title"), false);
    dialog.getContentPane().add(panel);
    dialog.pack();
    dialog.setLocationRelativeTo(f);
}
Also used : JPanel(javax.swing.JPanel) GridBagConstraints(java.awt.GridBagConstraints) ItemEvent(java.awt.event.ItemEvent) Insets(java.awt.Insets) GridBagLayout(java.awt.GridBagLayout) JComboBox(javax.swing.JComboBox) JTabbedPane(javax.swing.JTabbedPane) JButton(javax.swing.JButton) JLabel(javax.swing.JLabel) JComboBox(javax.swing.JComboBox) Box(javax.swing.Box) JFrame(javax.swing.JFrame) ItemListener(java.awt.event.ItemListener) JDialog(javax.swing.JDialog)

Example 97 with JTabbedPane

use of javax.swing.JTabbedPane in project processdash by dtuma.

the class WBSTabPanel method makeTabbedPane.

/** Create and install the tabbed pane component. */
private void makeTabbedPane() {
    tabbedPane = new JTabbedPane(JTabbedPane.TOP, JTabbedPane.SCROLL_TAB_LAYOUT);
    // Create a "pseudo-tab" that displays the "Add Tab" icon.
    tabbedPane.addTab(null, IconFactory.getAddTabIcon(), new EmptyComponent(new Dimension(10, 10)), "Add New Tab");
    tabbedPane.addChangeListener(new TabListener());
    GridBagConstraints c = new GridBagConstraints();
    c.gridx = c.gridy = 0;
    c.weightx = c.weighty = 1.0;
    c.fill = GridBagConstraints.BOTH;
    c.insets.top = c.insets.bottom = c.insets.right = 0;
    c.insets.left = 215;
    add(tabbedPane);
    setLayer(tabbedPane, 10);
    layout.setConstraints(tabbedPane, c);
}
Also used : GridBagConstraints(java.awt.GridBagConstraints) JTabbedPane(javax.swing.JTabbedPane) Dimension(java.awt.Dimension)

Example 98 with JTabbedPane

use of javax.swing.JTabbedPane in project vcell by virtualcell.

the class PathwayImportPanel method getPreviewPanel.

private JPanel getPreviewPanel() {
    if (previewPanel == null) {
        previewPanel = new JPanel(new BorderLayout());
        previewPanel.setPreferredSize(new Dimension(500, 500));
        textPanel.setLayout(new BorderLayout());
        textPanel.add(textScrollPane, BorderLayout.CENTER);
        textPanel.add(textLabel, BorderLayout.NORTH);
        treePanel.setLayout(new BorderLayout());
        treePanel.add(treeScrollPane, BorderLayout.CENTER);
        treePanel.add(treeLabel, BorderLayout.NORTH);
        JTabbedPane tabbedPane = new JTabbedPane();
        tabbedPane.addTab("Raw Data", textPanel);
        tabbedPane.addTab("Tree", treePanel);
        previewPanel.add(tabbedPane, BorderLayout.CENTER);
    }
    return previewPanel;
}
Also used : JPanel(javax.swing.JPanel) BorderLayout(java.awt.BorderLayout) JTabbedPane(javax.swing.JTabbedPane) Dimension(java.awt.Dimension)

Example 99 with JTabbedPane

use of javax.swing.JTabbedPane in project knime-core by knime.

the class DBTableCreatorNodeDialog method createDynamicPanel.

/**
 * @return a newly created dynamic panel
 */
private JPanel createDynamicPanel() {
    final JPanel panel = new JPanel(new BorderLayout());
    final JTabbedPane tabs = new JTabbedPane();
    tabs.add(m_nameBasedMappingPanel.getTitle(), m_nameBasedMappingPanel);
    tabs.add(m_knimeTypeBasedMappingPanel.getTitle(), m_knimeTypeBasedMappingPanel);
    panel.add(tabs, BorderLayout.CENTER);
    return panel;
}
Also used : JPanel(javax.swing.JPanel) BorderLayout(java.awt.BorderLayout) JTabbedPane(javax.swing.JTabbedPane)

Example 100 with JTabbedPane

use of javax.swing.JTabbedPane in project vcell by virtualcell.

the class TabCloseIcon method paintIcon.

/**
 * when painting, remember last position painted.
 */
public void paintIcon(Component c, Graphics g, int x, int y) {
    if (tabbedPane == null && c instanceof JTabbedPane) {
        tabbedPane = (JTabbedPane) c;
        MouseAdapter mouseAdapter = new MouseAdapter() {

            @Override
            public void mouseReleased(MouseEvent e) {
                // than one tab might get closed!
                if (!e.isConsumed() && iconRectangle.contains(e.getX(), e.getY())) {
                    final int index = tabbedPane.getSelectedIndex();
                    tabbedPane.remove(index);
                    e.consume();
                    tabbedPane.removeMouseListener(this);
                }
            }
        };
        tabbedPane.addMouseListener(mouseAdapter);
    }
    iconRectangle = new Rectangle(x, y, getIconWidth(), getIconHeight());
    closeIcon.paintIcon(c, g, x, y);
}
Also used : MouseEvent(java.awt.event.MouseEvent) JTabbedPane(javax.swing.JTabbedPane) MouseAdapter(java.awt.event.MouseAdapter) Rectangle(java.awt.Rectangle)

Aggregations

JTabbedPane (javax.swing.JTabbedPane)104 JPanel (javax.swing.JPanel)51 BorderLayout (java.awt.BorderLayout)33 JLabel (javax.swing.JLabel)26 JButton (javax.swing.JButton)25 JScrollPane (javax.swing.JScrollPane)23 Dimension (java.awt.Dimension)19 ActionEvent (java.awt.event.ActionEvent)18 ActionListener (java.awt.event.ActionListener)15 JCheckBox (javax.swing.JCheckBox)14 ChangeListener (javax.swing.event.ChangeListener)13 GridBagLayout (java.awt.GridBagLayout)12 BoxLayout (javax.swing.BoxLayout)12 ChangeEvent (javax.swing.event.ChangeEvent)12 GridBagConstraints (java.awt.GridBagConstraints)11 Insets (java.awt.Insets)11 ArrayList (java.util.ArrayList)10 JFrame (javax.swing.JFrame)10 JMenuItem (javax.swing.JMenuItem)10 JSplitPane (javax.swing.JSplitPane)10