Search in sources :

Example 51 with Box

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;
}
Also used : JCheckBox(javax.swing.JCheckBox) JPanel(javax.swing.JPanel) ItemEvent(java.awt.event.ItemEvent) BoxLayout(javax.swing.BoxLayout) Box(javax.swing.Box) JCheckBox(javax.swing.JCheckBox) ItemListener(java.awt.event.ItemListener)

Example 52 with Box

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;
}
Also used : JPanel(javax.swing.JPanel) FlowLayout(java.awt.FlowLayout) JRadioButton(javax.swing.JRadioButton) ActionListener(java.awt.event.ActionListener) ButtonGroup(javax.swing.ButtonGroup) ActionEvent(java.awt.event.ActionEvent) JLabel(javax.swing.JLabel) Box(javax.swing.Box) ColumnSelectionPanel(org.knime.core.node.util.ColumnSelectionPanel) JTextField(javax.swing.JTextField)

Example 53 with Box

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;
}
Also used : DialogComponentStringSelection(org.knime.core.node.defaultnodesettings.DialogComponentStringSelection) Box(javax.swing.Box)

Example 54 with Box

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;
}
Also used : JScrollPane(javax.swing.JScrollPane) JComboBox(javax.swing.JComboBox) Box(javax.swing.Box) Dimension(java.awt.Dimension) Border(javax.swing.border.Border)

Example 55 with Box

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;
}
Also used : JPanel(javax.swing.JPanel) ActionListener(java.awt.event.ActionListener) BorderLayout(java.awt.BorderLayout) ActionEvent(java.awt.event.ActionEvent) JButton(javax.swing.JButton) JProgressBar(javax.swing.JProgressBar) JComboBox(javax.swing.JComboBox) Box(javax.swing.Box) JCheckBox(javax.swing.JCheckBox)

Aggregations

Box (javax.swing.Box)192 JCheckBox (javax.swing.JCheckBox)95 JLabel (javax.swing.JLabel)93 JPanel (javax.swing.JPanel)87 Dimension (java.awt.Dimension)65 BorderLayout (java.awt.BorderLayout)51 JButton (javax.swing.JButton)48 JComboBox (javax.swing.JComboBox)46 JScrollPane (javax.swing.JScrollPane)42 BoxLayout (javax.swing.BoxLayout)38 ActionEvent (java.awt.event.ActionEvent)31 ActionListener (java.awt.event.ActionListener)28 JTextField (javax.swing.JTextField)25 EmptyBorder (javax.swing.border.EmptyBorder)19 Insets (java.awt.Insets)17 SearchFilterPanel (pcgen.gui2.filter.SearchFilterPanel)14 FlippingSplitPane (pcgen.gui2.tools.FlippingSplitPane)14 TitledBorder (javax.swing.border.TitledBorder)13 FilterBar (pcgen.gui2.filter.FilterBar)13 GridBagConstraints (java.awt.GridBagConstraints)12