Search in sources :

Example 41 with AbstractButton

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

the class PieProperties method addLabelDisplayListener.

/**
 * @param listener the listener to listen if the label display policy has
 *            changed
 */
protected void addLabelDisplayListener(final ActionListener listener) {
    final Enumeration<AbstractButton> buttons = m_labelDisplayPolicy.getElements();
    while (buttons.hasMoreElements()) {
        final AbstractButton button = buttons.nextElement();
        button.addActionListener(listener);
    }
}
Also used : AbstractButton(javax.swing.AbstractButton)

Example 42 with AbstractButton

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

the class PieProperties method enableAggrMethodGroup.

/**
 * @param enable <code>true</code> if the aggregation method group should
 * be enabled
 */
protected void enableAggrMethodGroup(final boolean enable) {
    final Enumeration<AbstractButton> buttons = m_aggrMethButtonGrp.getElements();
    while (buttons.hasMoreElements()) {
        final AbstractButton button = buttons.nextElement();
        button.setEnabled(enable);
        if (enable) {
            button.setToolTipText(AggregationMethod.getMethod4Command(button.getActionCommand()).getToolTip());
        } else {
            button.setToolTipText(AGGREGATION_METHOD_DISABLE_TOOLTIP);
        }
    }
}
Also used : AbstractButton(javax.swing.AbstractButton)

Example 43 with AbstractButton

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

the class AbstractHistogramProperties method addLabelOrientationListener.

/**
 * @param listener the listener to listen if the label orientation has
 *            changed
 */
protected void addLabelOrientationListener(final ActionListener listener) {
    final Enumeration<AbstractButton> buttons = m_labelOrientation.getElements();
    while (buttons.hasMoreElements()) {
        final AbstractButton button = buttons.nextElement();
        button.addActionListener(listener);
    }
}
Also used : AbstractButton(javax.swing.AbstractButton)

Example 44 with AbstractButton

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

the class AbstractHistogramProperties method addLayoutListener.

/**
 * @param listener the listener to listen if the layout has changed
 */
protected void addLayoutListener(final ActionListener listener) {
    final Enumeration<AbstractButton> buttons = m_layoutDisplayPolicy.getElements();
    while (buttons.hasMoreElements()) {
        final AbstractButton button = buttons.nextElement();
        button.addActionListener(listener);
    }
}
Also used : AbstractButton(javax.swing.AbstractButton)

Example 45 with AbstractButton

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

the class NameFilterPanel method loadConfiguration.

/**
 * Updates this filter panel by removing all current selections from the include and exclude list. The include list
 * will contains all column names from the spec afterwards.
 *
 * @param config to be loaded from
 * @param names array of names to be included or excluded (preserve order)
 */
public void loadConfiguration(final NameFilterConfiguration config, final String[] names) {
    final List<String> ins = Arrays.asList(config.getIncludeList());
    final List<String> exs = Arrays.asList(config.getExcludeList());
    if (supportsInvalidValues()) {
        m_invalidIncludes = new ArrayList<String>(Arrays.asList(config.getRemovedFromIncludeList()));
        m_invalidExcludes = new ArrayList<String>(Arrays.asList(config.getRemovedFromExcludeList()));
    }
    this.update(ins, exs, names);
    switch(config.getEnforceOption()) {
        case EnforceExclusion:
            m_enforceExclusion.setSelected(true);
            cleanInvalidValues();
            break;
        case EnforceInclusion:
            m_enforceInclusion.setSelected(true);
            cleanInvalidValues();
            break;
    }
    m_patternPanel.loadConfiguration(config.getPatternConfig(), names);
    setPatternFilterEnabled(config.isPatternFilterEnabled());
    m_currentType = config.getType();
    boolean typeOk = false;
    Enumeration<AbstractButton> buttons = m_typeGroup.getElements();
    while (buttons.hasMoreElements()) {
        AbstractButton button = buttons.nextElement();
        if (button.getActionCommand().equals(m_currentType)) {
            button.setSelected(true);
            typeOk = true;
            break;
        }
    }
    if (!typeOk) {
        m_currentType = NameFilterConfiguration.TYPE;
        m_nameButton.setSelected(true);
    }
    updateFilterPanel();
    repaint();
}
Also used : AbstractButton(javax.swing.AbstractButton)

Aggregations

AbstractButton (javax.swing.AbstractButton)50 JLabel (javax.swing.JLabel)8 JPanel (javax.swing.JPanel)8 Component (java.awt.Component)7 ButtonModel (javax.swing.ButtonModel)7 JRadioButton (javax.swing.JRadioButton)5 JButton (javax.swing.JButton)4 Dimension (java.awt.Dimension)3 File (java.io.File)3 ArrayList (java.util.ArrayList)3 NotConfigurableException (org.knime.core.node.NotConfigurableException)3 FlowLayout (java.awt.FlowLayout)2 GridBagConstraints (java.awt.GridBagConstraints)2 Insets (java.awt.Insets)2 ActionEvent (java.awt.event.ActionEvent)2 MouseEvent (java.awt.event.MouseEvent)2 JComboBox (javax.swing.JComboBox)2 JComponent (javax.swing.JComponent)2 JFileChooser (javax.swing.JFileChooser)2 JTextField (javax.swing.JTextField)2