use of javax.swing.Box in project knime-core by knime.
the class DialogComponentCalendar method createDatePanel.
private JPanel createDatePanel() {
m_date = new DialogComponentDate((SettingsModelCalendar) getModel(), "Date:");
// add the check box on top of the horizontal date panel
JPanel panel = new JPanel();
panel.setLayout(new BoxLayout(panel, BoxLayout.Y_AXIS));
Box useDateBox = Box.createHorizontalBox();
m_useDateUI = new JCheckBox("Use date", false);
m_useDateUI.addItemListener(new ItemListener() {
@Override
public void itemStateChanged(final ItemEvent e) {
boolean enable = m_useDateUI.isSelected();
// only dis-/enable UI since they all share one model
m_date.setEnabledComponents(enable);
((SettingsModelCalendar) getModel()).setUseDate(enable);
}
});
useDateBox.add(m_useDateUI);
useDateBox.add(Box.createHorizontalGlue());
panel.add(useDateBox);
panel.add(m_date.getComponentPanel());
return panel;
}
use of javax.swing.Box in project knime-core by knime.
the class RulePanel method createNewColumnTextFieldWithReplace.
private Component createNewColumnTextFieldWithReplace(final String watermark, final int colWidth, final String label) {
Box ret = Box.createVerticalBox();
JPanel addColumnPanel = new JPanel(new FlowLayout(FlowLayout.LEFT));
JPanel replaceColumnPanel = new JPanel(new FlowLayout(FlowLayout.LEFT));
m_outputGroup = new ButtonGroup();
final JRadioButton newColumn = new JRadioButton(label);
m_replaceColRadio = new JRadioButton("Replace Column:");
addColumnPanel.add(newColumn);
JTextField comp = Util.createTextFieldWithWatermark(watermark, colWidth, /*label*/
null);
m_newColumnName = comp;
addColumnPanel.add(comp);
ActionListener actionListener = new ActionListener() {
@Override
public void actionPerformed(final ActionEvent e) {
m_newColumnName.setEnabled(newColumn.isSelected());
m_replaceColumn.setEnabled(m_replaceColRadio.isSelected());
m_replaceColumn.setRequired(m_replaceColRadio.isSelected());
}
};
newColumn.addActionListener(actionListener);
m_replaceColRadio.addActionListener(actionListener);
m_outputGroup.add(newColumn);
m_outputGroup.add(m_replaceColRadio);
@SuppressWarnings("unchecked") ColumnSelectionPanel colSelectionPanel = new ColumnSelectionPanel((Border) null, DoubleValue.class, IntValue.class, StringValue.class, BooleanValue.class);
m_replaceColumn = colSelectionPanel;
m_outputType = new JLabel(DataValue.UTILITY.getIcon());
addColumnPanel.add(m_outputType);
replaceColumnPanel.add(m_replaceColRadio);
replaceColumnPanel.add(m_replaceColumn);
ret.add(addColumnPanel);
ret.add(replaceColumnPanel);
return ret;
}
use of javax.swing.Box in project knime-core by knime.
the class DBGroupByNodeDialog method createAdvancedOptionsBox.
private JComponent createAdvancedOptionsBox() {
// general option box
final Box generalBox = new Box(BoxLayout.X_AXIS);
final DialogComponentStringSelection colNamePolicy = new DialogComponentStringSelection(m_columnNamePolicy, "Column naming:", ColumnNamePolicy.getPolicyLabels());
generalBox.add(colNamePolicy.getComponentPanel());
// Advanced settings box
final Box box = new Box(BoxLayout.Y_AXIS);
box.add(generalBox);
box.setMaximumSize(box.getPreferredSize());
final Box rootBox = new Box(BoxLayout.X_AXIS);
rootBox.setBorder(BorderFactory.createTitledBorder(BorderFactory.createEtchedBorder(), " Advanced settings "));
rootBox.add(Box.createHorizontalGlue());
rootBox.add(box);
rootBox.add(Box.createHorizontalGlue());
return rootBox;
}
use of javax.swing.Box in project knime-core by knime.
the class DBGroupByAggregationPanel method createListComponent.
/**
* Creates the list component that contains the possible columns to choose from (displayed on the left hand).
*
* @return the list component which contains the list of available columns to choose from
*/
private Component createListComponent() {
final Box avMethodsBox = new Box(BoxLayout.X_AXIS);
final Border border = BorderFactory.createTitledBorder(" Available columns ");
avMethodsBox.setBorder(border);
final JScrollPane compMethodsList = new JScrollPane(m_columns);
final Dimension dimension = new Dimension(150, COMPONENT_HEIGHT);
compMethodsList.setMinimumSize(dimension);
compMethodsList.setPreferredSize(dimension);
avMethodsBox.add(compMethodsList);
return avMethodsBox;
}
use of javax.swing.Box in project knime-core by knime.
the class VariableFileReaderNodeDialog method createAnalysisPanel.
private JPanel createAnalysisPanel() {
m_analyzeCancel = new JButton("Quick Scan");
m_analyzeCancel.setToolTipText("Analyze the first " + FileAnalyzer.NUMOFLINES + " lines only.");
m_analyzeCancel.addActionListener(new ActionListener() {
@Override
public void actionPerformed(final ActionEvent e) {
m_analyzeCancel.setEnabled(false);
m_analyzeCancel.setText("Scanning quickly");
m_analysisExecMonitor.setExecuteCanceled();
}
});
m_analyzeCancel.setEnabled(false);
m_analyzeProgressBar = new JProgressBar();
m_analyzeProgressBar.setIndeterminate(false);
m_analyzeProgressBar.setStringPainted(false);
m_analyzeProgressBar.setValue(0);
Box msgBox = Box.createHorizontalBox();
msgBox.add(Box.createVerticalStrut(25));
msgBox.add(m_analyzeProgressMsg);
msgBox.add(Box.createGlue());
Box progressBox = Box.createVerticalBox();
progressBox.add(msgBox);
progressBox.add(Box.createVerticalStrut(3));
progressBox.add(m_analyzeProgressBar);
Box buttonBox = Box.createHorizontalBox();
buttonBox.add(Box.createHorizontalGlue());
buttonBox.add(m_analyzeCancel);
buttonBox.add(Box.createHorizontalGlue());
Box allBox = Box.createVerticalBox();
allBox.add(progressBox);
allBox.add(Box.createVerticalStrut(5));
allBox.add(buttonBox);
Box hBox = Box.createHorizontalBox();
hBox.add(Box.createGlue());
hBox.add(Box.createGlue());
hBox.add(allBox);
hBox.add(Box.createGlue());
hBox.add(Box.createGlue());
JPanel result = new JPanel();
result.setLayout(new BorderLayout());
result.add(hBox, BorderLayout.NORTH);
return result;
}
Aggregations