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);
}
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);
}
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;
}
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;
}
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);
}
Aggregations