use of javax.swing.JSpinner in project knime-core by knime.
the class CategoryToNumberNodeDialogPane method createCategoryToNumberSettingsTab.
@SuppressWarnings("unchecked")
private JPanel createCategoryToNumberSettingsTab() {
JPanel p = new JPanel(new GridBagLayout());
GridBagConstraints c = new GridBagConstraints();
c.fill = GridBagConstraints.HORIZONTAL;
c.anchor = GridBagConstraints.NORTHWEST;
c.insets = new Insets(2, 2, 2, 2);
c.gridx = 0;
c.gridy = 0;
c.gridwidth = 1;
c.weightx = 1;
c.weighty = 0;
Insets leftInsets = new Insets(3, 8, 3, 8);
Insets middleInsets = new Insets(3, 0, 3, 0);
c.gridwidth = 3;
m_filterPanel = new DataColumnSpecFilterPanel();
p.add(m_filterPanel, c);
c.weighty = 0;
c.weightx = 0;
c.gridy++;
c.gridwidth = 2;
c.gridx = 0;
c.insets = leftInsets;
m_appendColums = new JCheckBox("Append columns");
m_appendColums.addActionListener(new ActionListener() {
@Override
public void actionPerformed(final ActionEvent e) {
m_columnSuffix.setEnabled(m_appendColums.isSelected());
}
});
p.add(m_appendColums, c);
c.gridy++;
c.gridwidth = 1;
c.gridx = 0;
c.insets = leftInsets;
p.add(new JLabel("Column suffix:"), c);
c.gridx = 1;
c.insets = middleInsets;
m_columnSuffix = new JTextField();
p.add(m_columnSuffix, c);
c.gridy++;
c.gridwidth = 1;
c.gridx = 0;
c.insets = leftInsets;
p.add(new JLabel("Start value:"), c);
c.gridx = 1;
c.insets = middleInsets;
m_startIndex = new JSpinner(new SpinnerNumberModel(0, Integer.MIN_VALUE, Integer.MAX_VALUE, 1));
p.add(m_startIndex, c);
c.gridy++;
c.gridwidth = 1;
c.gridx = 0;
c.insets = leftInsets;
p.add(new JLabel("Increment:"), c);
c.gridx = 1;
c.insets = middleInsets;
m_increment = new JSpinner(new SpinnerNumberModel(1, 1, Integer.MAX_VALUE, 1));
p.add(m_increment, c);
c.gridy++;
c.gridwidth = 1;
c.gridx = 0;
c.insets = leftInsets;
p.add(new JLabel("Max. categories:"), c);
c.gridx = 1;
c.insets = middleInsets;
m_maxCategories = new JSpinner(new SpinnerNumberModel(1000, 1, Integer.MAX_VALUE, 100));
p.add(m_maxCategories, c);
c.gridy++;
c.gridwidth = 1;
c.gridx = 0;
c.insets = leftInsets;
p.add(new JLabel("Default value:"), c);
c.gridx = 1;
c.insets = middleInsets;
m_defaultValue = new JTextField();
m_defaultValue.setHorizontalAlignment(SwingConstants.RIGHT);
p.add(m_defaultValue, c);
c.gridy++;
c.gridwidth = 1;
c.gridx = 0;
c.insets = leftInsets;
p.add(new JLabel("Map missing to:"), c);
c.gridx = 1;
c.insets = middleInsets;
m_mapMissingTo = new JTextField();
m_mapMissingTo.setHorizontalAlignment(SwingConstants.RIGHT);
p.add(m_mapMissingTo, c);
c.gridy++;
c.weighty = 1;
p.add(new JPanel(), c);
return p;
}
use of javax.swing.JSpinner in project knime-core by knime.
the class AbstractCorrelationComputeNodeView method getJMenu.
private JMenu getJMenu() {
JMenu menu = new JMenu("View");
JCheckBoxMenuItem useColorBox = new JCheckBoxMenuItem("Use Colors");
useColorBox.addActionListener(new ActionListener() {
@Override
public void actionPerformed(final ActionEvent e) {
if (((JCheckBoxMenuItem) e.getSource()).isSelected()) {
changeRenderer(ColorRender.DESCRIPTION);
} else {
changeRenderer(DoubleValueRenderer.STANDARD_RENDERER.getDescription());
}
}
});
useColorBox.addPropertyChangeListener("ancestor", new PropertyChangeListener() {
/**
* {@inheritDoc}
*/
@Override
public void propertyChange(final PropertyChangeEvent evt) {
((JCheckBoxMenuItem) evt.getSource()).setSelected(m_currentRendererID.equals(ColorRender.DESCRIPTION));
}
});
JMenuItem colWidthItem = new JMenuItem("Cell Size...");
colWidthItem.addActionListener(new ActionListener() {
@Override
public void actionPerformed(final ActionEvent e) {
int colWidth = m_tableView.getColumnWidth();
JSpinner s = new JSpinner(new SpinnerNumberModel(colWidth, 1, Integer.MAX_VALUE, 1));
int r = JOptionPane.showConfirmDialog(m_tableView, s, "Cell Size", JOptionPane.OK_CANCEL_OPTION, JOptionPane.QUESTION_MESSAGE);
if (r == JOptionPane.OK_OPTION) {
m_tableView.setColumnWidth((Integer) s.getValue());
m_tableView.setRowHeight((Integer) s.getValue());
}
}
});
menu.add(useColorBox);
menu.add(colWidthItem);
return menu;
}
use of javax.swing.JSpinner in project knime-core by knime.
the class SleepNodeDialog method waitToTimePanel.
private void waitToTimePanel() {
m_waitToSpinnerModel = new SpinnerDateModel();
m_toSpinner = new JSpinner(m_waitToSpinnerModel);
m_toSpinner.setEditor(new JSpinner.DateEditor(m_toSpinner, "HH:mm:ss"));
Calendar cal = Calendar.getInstance();
cal.set(Calendar.HOUR_OF_DAY, 0);
cal.set(Calendar.MINUTE, 0);
cal.set(Calendar.SECOND, 0);
cal.set(Calendar.MILLISECOND, 0);
m_waitToSpinnerModel.setValue(cal.getTime());
m_toRB = new JRadioButton("Wait to time:");
m_toRB.doClick();
m_toRB.addItemListener(new ItemListener() {
@Override
public void itemStateChanged(final ItemEvent e) {
if (m_toRB.isSelected()) {
m_selection = 1;
}
m_toSpinner.setEnabled(m_toRB.isSelected());
}
});
}
use of javax.swing.JSpinner in project jgnash by ccavanaugh.
the class GeneralOptions method initComponents.
private void initComponents() {
animationsEnabled = new JCheckBox(rb.getString("Button.SubstanceAnimations"));
numButton = new JButton(rb.getString("Menu.EditTranNumList.Name"));
selectOnFocusCheckBox = new JCheckBox(rb.getString("Button.SelectText"));
SpinnerModel model = new SpinnerNumberModel(ThemeManager.getNimbusFontSize(), 9, 15, 1);
nimbusFontSpinner = new JSpinner(model);
}
use of javax.swing.JSpinner in project FBReaderJ by geometer.
the class ZLSpinOptionView method createItem.
protected void createItem() {
final ZLSpinOptionEntry option = (ZLSpinOptionEntry) myOption;
mySpinner = new JSpinner(new SpinnerNumberModel(option.initialValue(), option.minValue(), option.maxValue(), option.getStep()));
if (myName == null || "".equals(myName)) {
myLabel = null;
myTab.insertWidget(mySpinner);
} else {
JPanel panel1 = new JPanel();
panel1.setLayout(new BoxLayout(panel1, BoxLayout.LINE_AXIS));
mySpinner.setMaximumSize(new Dimension(mySpinner.getMaximumSize().width, mySpinner.getPreferredSize().height));
panel1.add(mySpinner);
myLabel = new JLabel(myName);
JPanel panel2 = new JPanel(new BorderLayout());
panel2.add(myLabel, BorderLayout.LINE_END);
myPanel = new JPanel(new GridLayout(1, 2, 10, 0));
myPanel.add(panel2);
myPanel.add(panel1);
myTab.insertWidget(myPanel);
}
}
Aggregations