Search in sources :

Example 91 with CardLayout

use of java.awt.CardLayout in project knime-core by knime.

the class MissingValueHandlerFactorySelectionPanel method actionPerformed.

/**
 * {@inheritDoc}
 */
@Override
public void actionPerformed(final ActionEvent e) {
    MissingCellHandlerFactory fac = getSelectedFactory();
    if (fac.hasSettingsPanel()) {
        // Show card layout panel and activate the correct settings panel
        m_argumentsPanel.setVisible(true);
        String key = fac.getID();
        ((CardLayout) m_argumentsPanel.getLayout()).show(m_argumentsPanel, key);
    } else {
        // If the factory has no settings panel, we can hide the card layout panel.
        m_argumentsPanel.setVisible(false);
    }
    firePropertyChange(SELECTED_FACTORY_CHANGE, null, null);
}
Also used : CardLayout(java.awt.CardLayout) MissingCellHandlerFactory(org.knime.base.node.preproc.pmml.missingval.MissingCellHandlerFactory)

Example 92 with CardLayout

use of java.awt.CardLayout in project knime-core by knime.

the class TemplatesPanel method onSelectionInTemplateList.

private void onSelectionInTemplateList(final Object selected) {
    CardLayout cl = (CardLayout) (m_previewPane.getLayout());
    if (selected != null) {
        @SuppressWarnings("unchecked") T template = (T) selected;
        m_description.setText(template.getDescription());
        m_description.setCaretPosition(0);
        boolean removeable = m_provider.isRemoveable(template);
        m_removeTemplateButton.setEnabled(removeable);
        m_applyTemplateButton.setEnabled(true);
        m_controller.setPreviewSettings(template);
        cl.show(m_previewPane, CARD_PREVIEW);
        this.validate();
    } else {
        m_description.setText("");
        m_removeTemplateButton.setEnabled(false);
        m_applyTemplateButton.setEnabled(false);
        cl.show(m_previewPane, CARD_EMPTY_SELECTION);
    }
}
Also used : CardLayout(java.awt.CardLayout)

Aggregations

CardLayout (java.awt.CardLayout)92 JPanel (javax.swing.JPanel)37 BorderLayout (java.awt.BorderLayout)16 JLabel (javax.swing.JLabel)14 JScrollPane (javax.swing.JScrollPane)12 Dimension (java.awt.Dimension)9 GridBagLayout (java.awt.GridBagLayout)8 Insets (java.awt.Insets)8 JButton (javax.swing.JButton)7 ImageIcon (javax.swing.ImageIcon)6 ListSelectionEvent (javax.swing.event.ListSelectionEvent)6 JSplitPane (javax.swing.JSplitPane)5 ListSelectionListener (javax.swing.event.ListSelectionListener)5 FlowLayout (java.awt.FlowLayout)4 Font (java.awt.Font)4 Point (java.awt.Point)4 JList (javax.swing.JList)4 EmptyBorder (javax.swing.border.EmptyBorder)4 AWTException (java.awt.AWTException)3 GridBagConstraints (java.awt.GridBagConstraints)3