Search in sources :

Example 31 with ChangeEvent

use of javax.swing.event.ChangeEvent in project ACS by ACS-Community.

the class RemoteResponseWindow method getResultPanel.

/**
 * Return the ResultPanel property value.
 * @return javax.swing.JTabbedPane
 */
/* WARNING: THIS METHOD WILL BE REGENERATED. */
private javax.swing.JTabbedPane getResultPanel() {
    if (ivjResultPanel == null) {
        try {
            ivjResultPanel = new javax.swing.JTabbedPane();
            ivjResultPanel.setName("ResultPanel");
            ivjResultPanel.insertTab("Text output", null, getTextPanel(), null, 0);
            ivjResultPanel.insertTab("Trend", null, getTrendPanel(), null, 1);
            ivjResultPanel.insertTab("Operations", null, getOperations(), null, 2);
            // set trend as default
            ivjResultPanel.setSelectedIndex(1);
            // text output switch
            ivjResultPanel.addChangeListener(new ChangeListener() {

                // This method is called whenever the selected tab changes
                public void stateChanged(ChangeEvent evt) {
                    JTabbedPane pane = (JTabbedPane) evt.getSource();
                    // Get current tab
                    textOutputTabSelected = (pane.getSelectedIndex() == 0);
                }
            });
        // user code begin {1}
        // user code end
        } catch (java.lang.Throwable ivjExc) {
            // user code begin {2}
            // user code end
            handleException(ivjExc);
        }
    }
    return ivjResultPanel;
}
Also used : ChangeEvent(javax.swing.event.ChangeEvent) JTabbedPane(javax.swing.JTabbedPane) JTabbedPane(javax.swing.JTabbedPane) ChangeListener(javax.swing.event.ChangeListener)

Example 32 with ChangeEvent

use of javax.swing.event.ChangeEvent in project EnrichmentMapApp by BaderLab.

the class JRangeSlider method fireChangeEvent.

/**
	 * Fire a change event to all listeners.
	 */
protected void fireChangeEvent() {
    repaint();
    if (changeEvent == null)
        changeEvent = new ChangeEvent(this);
    Iterator iter = listeners.iterator();
    while (iter.hasNext()) ((ChangeListener) iter.next()).stateChanged(changeEvent);
}
Also used : ChangeEvent(javax.swing.event.ChangeEvent) Iterator(java.util.Iterator)

Example 33 with ChangeEvent

use of javax.swing.event.ChangeEvent in project EnrichmentMapApp by BaderLab.

the class SliderBarPanel method fireChangeEvent.

protected void fireChangeEvent() {
    Iterator<Object> iter = listeners.iterator();
    ChangeEvent evt = new ChangeEvent(this);
    while (iter.hasNext()) {
        ChangeListener cl = (ChangeListener) iter.next();
        cl.stateChanged(evt);
    }
}
Also used : ChangeEvent(javax.swing.event.ChangeEvent) ChangeListener(javax.swing.event.ChangeListener)

Example 34 with ChangeEvent

use of javax.swing.event.ChangeEvent in project intellij-community by JetBrains.

the class RepositoryLibraryPropertiesEditor method initVersionsPanel.

private void initVersionsPanel() {
    final int selection = getSelection(model.getVersion(), versions);
    CollectionComboBoxModel<String> versionSelectorModel = new CollectionComboBoxModel<>(versions);
    //noinspection unchecked
    versionSelector.setModel(versionSelectorModel);
    versionSelector.setSelectedIndex(selection);
    setState(State.Loaded);
    initVersionKindSelector();
    versionSelector.addItemListener(new ItemListener() {

        @Override
        public void itemStateChanged(ItemEvent e) {
            model.setVersion(getSelectedVersion());
            onChangeListener.onChange(RepositoryLibraryPropertiesEditor.this);
        }
    });
    downloadSourcesCheckBox.setSelected(model.isDownloadSources());
    downloadSourcesCheckBox.addChangeListener(new ChangeListener() {

        @Override
        public void stateChanged(ChangeEvent e) {
            model.setDownloadSources(downloadSourcesCheckBox.isSelected());
            onChangeListener.onChange(RepositoryLibraryPropertiesEditor.this);
        }
    });
    downloadJavaDocsCheckBox.setSelected(model.isDownloadJavaDocs());
    downloadJavaDocsCheckBox.addChangeListener(new ChangeListener() {

        @Override
        public void stateChanged(ChangeEvent e) {
            model.setDownloadJavaDocs(downloadJavaDocsCheckBox.isSelected());
            onChangeListener.onChange(RepositoryLibraryPropertiesEditor.this);
        }
    });
}
Also used : ItemEvent(java.awt.event.ItemEvent) ChangeEvent(javax.swing.event.ChangeEvent) CollectionComboBoxModel(com.intellij.ui.CollectionComboBoxModel) ItemListener(java.awt.event.ItemListener) ChangeListener(javax.swing.event.ChangeListener)

Example 35 with ChangeEvent

use of javax.swing.event.ChangeEvent in project intellij-community by JetBrains.

the class GroovyMapParameterDialog method setUpDialog.

private void setUpDialog(final String[] possibleNames, boolean createNew) {
    setTitle(GroovyIntentionsBundle.message("convert.param.to.map.entry"));
    if (GroovyApplicationSettings.getInstance().CONVERT_PARAM_CREATE_NEW_PARAM != null) {
        myCreateNew.setSelected(createNew = GroovyApplicationSettings.getInstance().CONVERT_PARAM_CREATE_NEW_PARAM.booleanValue());
    } else {
        myCreateNew.setSelected(createNew);
    }
    myNameLabel.setLabelFor(myNameComboBox);
    myCbTypeSpec.setMnemonic(KeyEvent.VK_T);
    myCbTypeSpec.setFocusable(false);
    setUpNameComboBox(possibleNames);
    setModal(true);
    if (GroovyApplicationSettings.getInstance().CONVERT_PARAM_SPECIFY_MAP_TYPE != null) {
        myCbTypeSpec.setSelected(GroovyApplicationSettings.getInstance().CONVERT_PARAM_SPECIFY_MAP_TYPE.booleanValue());
    } else {
        myCbTypeSpec.setSelected(true);
    }
    myCbTypeSpec.setEnabled(createNew);
    myNameComboBox.setEnabled(createNew);
    myNameLabel.setEnabled(createNew);
    myCreateNew.addChangeListener(new ChangeListener() {

        @Override
        public void stateChanged(final ChangeEvent e) {
            final boolean flag = myCreateNew.isSelected();
            myCbTypeSpec.setEnabled(flag);
            myNameComboBox.setEnabled(flag);
            myNameLabel.setEnabled(flag);
        }
    });
}
Also used : ChangeEvent(javax.swing.event.ChangeEvent) ChangeListener(javax.swing.event.ChangeListener)

Aggregations

ChangeEvent (javax.swing.event.ChangeEvent)245 ChangeListener (javax.swing.event.ChangeListener)206 JPanel (javax.swing.JPanel)60 ActionEvent (java.awt.event.ActionEvent)52 ActionListener (java.awt.event.ActionListener)47 JLabel (javax.swing.JLabel)40 Dimension (java.awt.Dimension)30 GridBagConstraints (java.awt.GridBagConstraints)27 GridBagLayout (java.awt.GridBagLayout)24 JCheckBox (javax.swing.JCheckBox)24 Insets (java.awt.Insets)22 JButton (javax.swing.JButton)21 JSlider (javax.swing.JSlider)21 PropertyChangeEvent (java.beans.PropertyChangeEvent)20 JSpinner (javax.swing.JSpinner)19 SpinnerNumberModel (javax.swing.SpinnerNumberModel)19 BorderLayout (java.awt.BorderLayout)18 PropertyChangeListener (java.beans.PropertyChangeListener)17 IOException (java.io.IOException)16 BoxLayout (javax.swing.BoxLayout)16