use of javax.swing.event.ChangeListener in project ACS by ACS-Community.
the class BeanGrouper method getSaveButton.
private JToggleButton getSaveButton() {
if (saveButton == null) {
saveButton = new JToggleButton();
saveButton.setIcon(new ImageIcon(getClass().getClassLoader().getResource("cl/utfsm/samplingSystemUI/img/filesave.png")));
saveButton.setSelected(false);
saveButton.setToolTipText("Press to start saving sampled data to file");
saveButton.addChangeListener(new ChangeListener() {
@Override
public void stateChanged(ChangeEvent e) {
if (saveButton.isSelected() == true) {
saveButton.setToolTipText("Press to stop saving sampled data to file");
for (DataPrinter dp : samplers) {
((PlotPrinter) dp).setDumpToFile(true);
}
} else {
saveButton.setToolTipText("Press to start saving sampled data to file");
for (DataPrinter dp : samplers) {
((PlotPrinter) dp).setDumpToFile(false);
}
}
}
});
}
return saveButton;
}
use of javax.swing.event.ChangeListener 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;
}
use of javax.swing.event.ChangeListener 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);
}
}
use of javax.swing.event.ChangeListener 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);
}
});
}
use of javax.swing.event.ChangeListener 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);
}
});
}
Aggregations