Java Code Examples for javax.swing.event.ChangeEvent

The following are top voted examples for showing how to use javax.swing.event.ChangeEvent. These examples are extracted from open source projects. You can vote up the examples you like and your votes will be used in our system to generate more good examples.
Example 1
Project: LogiGSK   File: G910SpectrumUKQWERTY.java   Source Code and License 6 votes vote down vote up
private void jSliderBreathingEffectSpeedStateChanged(javax.swing.event.ChangeEvent evt) {//GEN-FIRST:event_jSliderBreathingEffectSpeedStateChanged
    if (breathingSpeedSliderManualChange) {
        return;
    }
    if (!jSliderBreathingEffectSpeed.getValueIsAdjusting()) {
        int speed = getSpeedFromSlider(Effects.Type.Breathing, jSliderBreathingEffectSpeed.getValue());
        if (gKeyboard.getEffect() != null) {
            if (gKeyboard.getEffect().BreathingSpeed != speed) {
                gKeyboard.getEffect().BreathingSpeed = speed;
                if (breathingThread != null) {
                    breathingThread.terminate();
                    breathingThread = null;
                }
                gKeyboard.getEffect().BreathingColour = IOOperations.getHexStringFromColour(jPanelBreathingColour.getBackground());
                breathingThread = new VirtualKeyboardBreathingThread();
                breathingThread.setKeyboardJpanels(getKeyboardJPanels(), jLayeredPane1);
                breathingThread.setSpeed(gKeyboard.getEffect().BreathingSpeed);
                breathingThread.setBreathingColour(gKeyboard.getEffect().BreathingColour);
                gKeyboard.setFXBreathing(gKeyboard.getEffect().BreathingColour, gKeyboard.getEffect().BreathingSpeed);
                breathingThread.start();
            }
        }
    }
}
 
Example 2
Project: incubator-netbeans   File: LiveFlatProfileCollectorPanel.java   Source Code and License 6 votes vote down vote up
public LiveFlatProfileCollectorPanel(TargetAppRunner runner, CPUResUserActionsHandler actionsHandler,
                                     CPUSelectionHandler selectionHandler, boolean sampling) {
    super(actionsHandler, selectionHandler, sampling);
    //    setCPUSelectionHandler(selectionHandler);
    this.runner = runner;

    addFilterListener(new ChangeListener() {
        public void stateChanged(ChangeEvent e) {
            if (flatProfileContainer != null) {
                setDataToDisplay(flatProfileContainer);
            }
        }
    });

    initComponents();
}
 
Example 3
Project: VASSAL-src   File: ZoneHighlight.java   Source Code and License 6 votes vote down vote up
public Component getControls() {

      final JSlider slider = new JSlider(JSlider.HORIZONTAL,0,100,opacity);

      final HashMap<Integer,JLabel> labelTable = new HashMap<Integer,JLabel>();
      labelTable.put(0, new JLabel("Transparent"));
      labelTable.put(100, new JLabel("Opaque"));

      slider.setMajorTickSpacing(10);
      slider.setPaintTicks(true);
      // Note: JSlider uses the outdated Hashtable. Eventually Hashtable
      // will be deprecated and we'll be able to use the HashMap directly.
      slider.setLabelTable(new Hashtable<Integer,JLabel>(labelTable));
      slider.setPaintLabels(true);
      slider.setBorder(javax.swing.BorderFactory.createTitledBorder(name));
      slider.addChangeListener(new ChangeListener() {
        public void stateChanged(ChangeEvent e) {
          final JSlider source = (JSlider) e.getSource();
          if (!source.getValueIsAdjusting()) {
            opacity = source.getValue();
          }
        }});

      return slider;
    }
 
Example 4
Project: Hotel-Properties-Management-System   File: HotelPropertiesWindow.java   Source Code and License 6 votes vote down vote up
private ChangeListener setTypeFields() {
    ChangeListener changeListener = new ChangeListener() {
        @Override
        public void stateChanged(ChangeEvent e) {
            int count = (int) roomTypeSpinner.getValue();
            if (count > typeValue) {
                for (int i = 0; i < count; i++) {
                    roomTypeFields[i].setVisible(true);
                    roomTypeFields[i].revalidate();
                    roomTypeFields[i].repaint();
                }
            } else if (count < typeValue) {

                roomTypeFields[count].setVisible(false);
                roomTypeFields[count].revalidate();
                roomTypeFields[count].repaint();
            }
            typeValue = count;

        }
    };
    return changeListener;
}
 
Example 5
Project: incubator-netbeans   File: VCSVisibilityQueryTest.java   Source Code and License 6 votes vote down vote up
public void testFireForAll() throws IOException {
    final boolean [] received = new boolean[] {false};
    ChangeListener list;
    VisibilityQuery.getDefault().addChangeListener(list = new ChangeListener() {
        @Override
        public void stateChanged(ChangeEvent ce) {
            received[0] = true;
        }
    });
    try {
        TestVCS.getInstance().getVisibilityQuery().fireVisibilityChanged();
        assertTrue(received[0]);
    } finally {
        VisibilityQuery.getDefault().removeChangeListener(list);
    }
}
 
Example 6
Project: openjdk-jdk10   File: PaletteChooser.java   Source Code and License 6 votes vote down vote up
public PaletteChooser(ResourceManager resourceManager) {
    this.resourceManager = resourceManager;
    palette = new Palette(MAX_COLOR - MIN_COLOR, MIN_COLOR, MAX_COLOR,
            Math.toRadians(R_ANGLE), Math.toRadians(G_ANGLE),
            Math.toRadians(B_ANGLE), R_STEPS, G_STEPS, B_STEPS);
    shower = new JPaletteShower(palette, 250, 25);

    //<snip>Use single change listener for several spinners
    changeListener = new ChangeListener() {
        @Override
        public void stateChanged(ChangeEvent e) {
            setPalette(createPalette());
            shower.setPalette(palette);
            repaint();
        }
    };
    //</snip>

    setBorder(BorderFactory.createTitledBorder(
            resourceManager.getString("SpinnerDemo.colorPalette")));
    setLayout(new BoxLayout(this, BoxLayout.Y_AXIS));
    add(shower);
    add(createControlPanel());
}
 
Example 7
Project: incubator-netbeans   File: TemplatesPanel.java   Source Code and License 6 votes vote down vote up
private void fireTemplateChanged(FileObject fo) {
    ChangeEvent che = new ChangeEvent(fo);
    ChangeListener[] ls;
    synchronized (listeners) {
        ls = listeners.toArray(new ChangeListener[] {});
    }
    for (ChangeListener chl : ls) {
        chl.stateChanged(che);
    }
}
 
Example 8
Project: Pogamut3   File: VariableTable.java   Source Code and License 6 votes vote down vote up
public void editingStopped(ChangeEvent e) {
    synchronized(mutex) {
        if (recursion) return;
        recursion = true;
    }
    try {
        // Take in the new value
        TableCellEditor editor = getCellEditor();
        if (editor != null) {
            editor.stopCellEditing();
            Object value = editor.getCellEditorValue();
            setValueAt(value, editingRow, editingColumn);
            removeEditor();
        }
    } finally {
        recursion = false;
    }
}
 
Example 9
Project: incubator-netbeans   File: CloneWizardAction.java   Source Code and License 6 votes vote down vote up
public void stateChanged(ChangeEvent e) {
    if(wizardIterator==null) {
        return;
    }
    WizardDescriptor.Panel step = wizardIterator.current();
    if(step == null) {
        return;
    }
    if (step == cloneRepositoryWizardPanel) {
        errorMessage = cloneRepositoryWizardPanel.getErrorMessage();
    } else if (step == clonePathsWizardPanel) {
        //not validated during modification of text
        //errorMessage = clonePathsWizardPanel.getErrorMessage();
    } else if (step == cloneDestinationDirectoryWizardPanel) {
        errorMessage = cloneDestinationDirectoryWizardPanel.getErrorMessage();
    }
    if (wizardDescriptor != null) {
        wizardDescriptor.putProperty(WizardDescriptor.PROP_ERROR_MESSAGE, errorMessage); // NOI18N
    }
}
 
Example 10
Project: Dahlem_SER316   File: NotesControlPanel.java   Source Code and License 6 votes vote down vote up
void tabbedPane_stateChanged(ChangeEvent e) {
	if (notesList != null)
		notesList.clearSelection();
	switch (tabbedPane.getSelectedIndex()) {
	case 0:
		notesList = notesListPanel.notesList;
		break;
	case 1:
		notesList = bookmarksListPanel.notesList;
		break;
	case 2:
		notesList = searchPanel.notesList;
		break;
	case 3:
		notesList = tagFilterPanel.notesList;
		break;
	}

	ppAddBkmrk.setEnabled(false);
	ppRemoveBkmrk.setEnabled(false);
}
 
Example 11
Project: incubator-netbeans   File: ProjectImporterWizard.java   Source Code and License 6 votes vote down vote up
/** Starts Eclipse importer wizard. */
public void start() {
    final EclipseWizardIterator iterator = new EclipseWizardIterator();
    final WizardDescriptor wizardDescriptor = new WizardDescriptor(iterator);
    iterator.addChangeListener(new ChangeListener() {
        public void stateChanged(ChangeEvent e) {
            wizardDescriptor.putProperty(WizardDescriptor.PROP_ERROR_MESSAGE, // NOI18N
                    iterator.getErrorMessage());
        }
    });
    wizardDescriptor.setTitleFormat(new java.text.MessageFormat("{1}")); // NOI18N
    wizardDescriptor.setTitle(
            ProjectImporterWizard.getMessage("CTL_WizardTitle")); // NOI18N
    Dialog dialog = DialogDisplayer.getDefault().createDialog(wizardDescriptor);
    dialog.setVisible(true);
    dialog.toFront();
    cancelled = wizardDescriptor.getValue() != WizardDescriptor.FINISH_OPTION;
    if (!cancelled) {
        projects = iterator.getProjects();
        //showAdditionalInfo(projects);
        destination = iterator.getDestination();
        recursively = iterator.getRecursively();
        numberOfImportedProjects = iterator.getNumberOfImportedProject();
        extraPanels = iterator.getExtraPanels();
    }
}
 
Example 12
Project: Hotel-Properties-Management-System   File: HotelPropertiesWindow.java   Source Code and License 6 votes vote down vote up
private ChangeListener starsChangedListner() {
    ChangeListener changeListener = new ChangeListener() {
        @Override
        public void stateChanged(ChangeEvent e) {
            int count = (int) starsSpinner.getValue();
            if (count > starValue) {
                for (int i = 0; i < count; i++) {
                    starlabels[i].setVisible(true);
                    starlabels[i].revalidate();
                    starlabels[i].repaint();
                }
            } else if (count < starValue) {

                starlabels[count].setVisible(false);
                starlabels[count].revalidate();
                starlabels[count].repaint();
            }
            starValue = count;

        }
    };
    return changeListener;
}
 
Example 13
Project: automatic-variants   File: StatsPanel.java   Source Code and License 6 votes vote down vote up
@Override
public void stateChanged(ChangeEvent event) {
    SwingUtilities.invokeLater(new Runnable() {

	@Override
	public void run() {
	    SwingUtilities.invokeLater(new Runnable() {

		@Override
		public void run() {
		    updateChart();
		}
	    });
	}
    });

}
 
Example 14
Project: QN-ACTR-Release   File: ClassesPanel.java   Source Code and License 6 votes vote down vote up
public void stateChanged(ChangeEvent e) {
	//stop editing text inside spinner
	try {
		classNumSpinner.commitEdit();
	} catch (ParseException pe) {
		//if string does not represent a number, return
		return;
	}
	//new number of classes
	int x = -1;
	try {
		x = ((Integer) classNumSpinner.getValue()).intValue();
	} catch (NumberFormatException nfe) {
	} catch (ClassCastException cce) {
	}
	//if new number is valid, proceed updating number
	if (x != -1) {
		setNumberOfClasses(x);
	} else {
		//otherwise, reset to 0
		classNumSpinner.setValue(new Integer(0));
	}
}
 
Example 15
Project: incubator-netbeans   File: ProjectWhiteListQueryImplementation.java   Source Code and License 6 votes vote down vote up
public void changeData(@NonNull TreeSet<String> privatePackages) {
    synchronized (IMPL_LOCK) {
        this.privatePackages = privatePackages;
    }

    ArrayList<ChangeListener> changes = new ArrayList<ChangeListener>();

    synchronized (listeners) {
        changes.addAll(listeners);
    }

    for (ChangeListener change : changes) {
        change.stateChanged(new ChangeEvent(this));
    }

}
 
Example 16
Project: LogiGSK   File: G610OrionUSQWERTY.java   Source Code and License 6 votes vote down vote up
private void jSliderBreathingEffectSpeedStateChanged(javax.swing.event.ChangeEvent evt) {//GEN-FIRST:event_jSliderBreathingEffectSpeedStateChanged
    if (breathingSpeedSliderManualChange) {
        return;
    }
    if (!jSliderBreathingEffectSpeed.getValueIsAdjusting()) {
        int speed = getSpeedFromSlider(Effects.Type.Breathing, jSliderBreathingEffectSpeed.getValue());
        if (gKeyboard.getEffect() != null) {
            if (gKeyboard.getEffect().BreathingSpeed != speed) {
                gKeyboard.getEffect().BreathingSpeed = speed;
                if (breathingThread != null) {
                    breathingThread.terminate();
                    breathingThread = null;
                }
                gKeyboard.getEffect().BreathingColour = IOOperations.getHexStringFromColour(jPanelBreathingColour.getBackground());
                breathingThread = new VirtualKeyboardBreathingThread();
                breathingThread.setKeyboardJpanels(getKeyboardJPanels(), jLayeredPane1);
                breathingThread.setSpeed(gKeyboard.getEffect().BreathingSpeed);
                breathingThread.setBreathingColour(gKeyboard.getEffect().BreathingColour);
                gKeyboard.setFXBreathing(gKeyboard.getEffect().BreathingColour, gKeyboard.getEffect().BreathingSpeed);
                breathingThread.start();
            }
        }
    }
}
 
Example 17
Project: SuperMarketManageSystem   File: KeHuGuanLi.java   Source Code and License 6 votes vote down vote up
public KeHuGuanLi() {
	setIconifiable(true);
	setClosable(true);
	setTitle("�ͻ���Ϣ����");
	JTabbedPane tabPane = new JTabbedPane();
	final KeHuXiuGaiPanel khxgPanel = new KeHuXiuGaiPanel();
	final KeHuTianJiaPanel khtjPanel = new KeHuTianJiaPanel();
	tabPane.addTab("�ͻ���Ϣ���", null, khtjPanel, "�ͻ����");
	tabPane.addTab("�ͻ���Ϣ�޸���ɾ��", null, khxgPanel, "�޸���ɾ��");
	getContentPane().add(tabPane);
	tabPane.addChangeListener(new ChangeListener() {
		public void stateChanged(ChangeEvent e) {
			khxgPanel.initComboBox();
		}
	});
	pack();
	setVisible(true);
}
 
Example 18
Project: incubator-netbeans   File: FontEditor.java   Source Code and License 6 votes vote down vote up
@Override
public void stateChanged(ChangeEvent e) {
    if (ignoreUpdates) return;
    ignoreUpdates = true;
    NbFont propertyValue = ((NbFont)getUnwrappedValue()).copy();
    Object source = e.getSource();
    if (source == relativeSize) {
        propertyValue.size = ((Number)relativeSize.getValue()).intValue();
        synchronizeSizeControls(propertyValue);
    } else if(source == absoluteSize) {
        propertyValue.size = ((Number)absoluteSize.getValue()).intValue();
        synchronizeSizeControls(propertyValue);
    }
    ignoreUpdates = false;
    setValue(propertyValue);
}
 
Example 19
Project: LogiGSK   File: G410AtlasSpectrumUSQWERTY.java   Source Code and License 5 votes vote down vote up
private void jSliderBrightnessStateChanged(javax.swing.event.ChangeEvent evt) {//GEN-FIRST:event_jSliderBrightnessStateChanged
    if (!jSliderBrightness.getValueIsAdjusting()) {
        if ((jSliderBrightness.getValue() % 10) != 0) {
            return;
        }
        int brightness = jSliderBrightness.getValue();
        setBrightness(brightness);
    }
}
 
Example 20
Project: incubator-netbeans   File: FiltersManagerImpl.java   Source Code and License 5 votes vote down vote up
private void fireChange() {
    FilterChangeListener lCopy;
    synchronized (L_LOCK) {
        // no listener = no notification
        if (clientL == null) {
            return;
        }
        lCopy = clientL;
    }

    // notify listener
    lCopy.filterStateChanged(new ChangeEvent(FiltersManagerImpl.this));
}
 
Example 21
Project: AlipayOrdersSupervisor-GUI   File: MainController.java   Source Code and License 5 votes vote down vote up
private void InitListeners() {
    // Tab 切换
    tabbedPane.addChangeListener((ChangeEvent e) -> {
        logger.debug(Integer.toString(tabbedPane.getSelectedIndex()));
        TabController tabController = (TabController)tabbedPane.getSelectedComponent();
        Settings.getInstance().setCurrentTab(tabController.getTabType());
    });
}
 
Example 22
Project: incubator-netbeans   File: VisibilitySupport.java   Source Code and License 5 votes vote down vote up
@Override
public void stateChanged(ChangeEvent e) {
    visibilityCache.clear();
    if (Crawler.listenOnVisibility()) {            
        if (e instanceof VisibilityQueryChangeEvent) {
            final FileObject[] affectedFiles = ((VisibilityQueryChangeEvent)e).getFileObjects();
            visibilityTask.localChange(affectedFiles);
        } else {
            visibilityTask.globalChange();
        }
        visibilityChanged.schedule(VISIBILITY_CHANGE_WINDOW);
    }
}
 
Example 23
Project: jmt   File: SemaphoreEditor.java   Source Code and License 5 votes vote down vote up
private void updateSpinner() {
	jNumField.setValue(threshold);
	jNumField.addChangeListener(new ChangeListener() {
		@Override
		public void stateChanged(ChangeEvent e) {
			Integer i = (Integer) jNumField.getValue();
			if (i.intValue() < 1) {
				i = new Integer(1);
				jNumField.setValue(i);
			}
			SemaphoreStrategy ss = (SemaphoreStrategy) stations.getSemaphoreStrategy(stationKey, classKey);
			ss.setThreshold(i);
		}
	});
}
 
Example 24
Project: incubator-netbeans   File: VCSVisibilityQueryTest.java   Source Code and License 5 votes vote down vote up
public void testFireForFiles() throws IOException {
    final List<String> received = new ArrayList<String>();
    ChangeListener list;
    VisibilityQuery.getDefault().addChangeListener(list = new ChangeListener() {
        @Override
        public void stateChanged(ChangeEvent ce) {
            Assert.assertTrue(ce instanceof VisibilityQueryChangeEvent);
            FileObject[] fos = ((VisibilityQueryChangeEvent)ce).getFileObjects();
            Assert.assertEquals(2, fos.length);
            received.add(fos[0].getName());
            received.add(fos[1].getName());
        }
    });
            
    try {
        File f1 = createVersionedFile("f1", true);
        File f2 = createVersionedFile("f2", true);

        TestVCS.getInstance().getVisibilityQuery().fireVisibilityChanged(
                new VCSFileProxy[] {
                    VCSFileProxy.createFileProxy(f1), 
                    VCSFileProxy.createFileProxy(f2)});

        assertTrue(received.contains(f1.getName()));
        assertTrue(received.contains(f2.getName()));
    } finally {
        VisibilityQuery.getDefault().removeChangeListener(list);
    }
}
 
Example 25
Project: Logisim   File: ExportImage.java   Source Code and License 5 votes vote down vote up
@Override
public void stateChanged(ChangeEvent e) {
	double scale = getScale();
	curScale.setText((int) Math.round(100.0 * scale) + "%");
	if (curScaleDim != null)
		curScale.setPreferredSize(curScaleDim);
}
 
Example 26
Project: JBotSim   File: JViewer.java   Source Code and License 5 votes vote down vote up
@Override
public void stateChanged(ChangeEvent e) {
    if (slideBarType == BarType.COMMUNICATION) {
        jtp.topo.setCommunicationRange(slideBar.getValue());
    } else if (slideBarType == BarType.SENSING) {
        jtp.topo.setSensingRange(slideBar.getValue());
    } else if (slideBarType == BarType.SPEED) {
        jtp.topo.setClockSpeed((width - slideBar.getValue()) / 40 + 1);
    }
    jtp.updateUI();
}
 
Example 27
Project: scorekeeperfrontend   File: BracketingList.java   Source Code and License 5 votes vote down vote up
@Override
public void stateChanged(ChangeEvent e)
{
	if (e.getSource() == spinner)
		required = ((Number)spinner.getModel().getValue()).intValue();
	else
		model.reload(openCheck.isSelected(), ladiesCheck.isSelected(), bonusCheck.isSelected());
}
 
Example 28
Project: incubator-netbeans   File: CodeTemplateManagerOperation.java   Source Code and License 5 votes vote down vote up
public void registerLoadedListener(ChangeListener listener) {
    synchronized (listenerList) {
        if (!isLoaded()) {
            // not yet loaded
            listenerList.add(ChangeListener.class, listener);
            return;
        }
    }

    // already loaded
    listener.stateChanged(new ChangeEvent(manager));
}
 
Example 29
Project: incubator-netbeans   File: AbstractTopLevelController.java   Source Code and License 5 votes vote down vote up
private void registerClientPresenterListener(AbstractButton presenter) {
    presenter.addChangeListener(new ChangeListener() {
            public void stateChanged(ChangeEvent e) {
                updateClientPresentersEnabling(getClientPresenters());
            }
        });
}
 
Example 30
Project: incubator-netbeans   File: EditablePropertyDisplayer.java   Source Code and License 5 votes vote down vote up
/**
 * Notifies all registered listeners about the event.
 *
 * @param event The event to be fired
 */
private void fireStateChanged() {
    if (listenerList == null) {
        return;
    }

    Object[] listeners = listenerList.getListenerList();
    ChangeEvent event = new ChangeEvent(this);

    for (int i = listeners.length - 2; i >= 0; i -= 2) {
        if (listeners[i] == ChangeListener.class) {
            ((ChangeListener) listeners[i + 1]).stateChanged(event);
        }
    }
}
 
Example 31
Project: QN-ACTR-Release   File: MMQueues.java   Source Code and License 5 votes vote down vote up
/** Auto-generated event handler method */
protected void lambdaSStateChanged(ChangeEvent evt) {
	if (lambdaS.getValue() == 0) {
		lambdaMultiplier = 0.01;
		lambdaMultiplierChange = 0;
		lambdaS.setValue(1);
	}
	ql.setLambda(lambdaMultiplier * lambdaS.getValue());
	lambdaL.setText(lambdaStrS + Formatter.formatNumber(lambdaS.getValue() * lambdaMultiplier, 2) + lambdaStrE);
	setSSlider();
	updateFields();

}
 
Example 32
Project: sbc-qsystem   File: FAdmin.java   Source Code and License 5 votes vote down vote up
private void checkBoxClientAutoStateChanged(
    javax.swing.event.ChangeEvent evt) {//GEN-FIRST:event_checkBoxClientAutoStateChanged
    buttonClientRequest.setEnabled(!checkBoxClientAuto.isSelected());
    if (timer.isRunning() && checkBoxClientAuto.isSelected()) {
        checkWelcome(null);
    }
    startTimer();
}
 
Example 33
Project: JavaGraph   File: Options.java   Source Code and License 5 votes vote down vote up
/** Gives a button the Groove look-and-feel. */
static public void setLAF(final AbstractButton button) {
    button.setHideActionText(true);
    button.setFocusable(false);
    button.setBorder(BorderFactory.createCompoundBorder(BorderFactory.createEtchedBorder(),
        BorderFactory.createEmptyBorder(3, 2, 3, 2)));
    button.setBorderPainted(button.isEnabled());
    button.addChangeListener(new ChangeListener() {
        @Override
        public void stateChanged(ChangeEvent e) {
            button.setBorderPainted(button.isEnabled());
        }
    });
}
 
Example 34
Project: incubator-netbeans   File: DTDWizardIterator.java   Source Code and License 5 votes vote down vote up
/**
 *
 */
public void fireStateChanged() {
    ChangeEvent event = new ChangeEvent(this);

    Iterator<ChangeListener> i = changeListeners.iterator();
    while (i.hasNext()) {
        try {
            i.next().stateChanged(event);
        } catch (Exception e) {
            //Debug.debugNotify(e);
        }
    }
}
 
Example 35
Project: ClashRoyale-Bot   File: UI.java   Source Code and License 5 votes vote down vote up
@Override
public void stateChanged(ChangeEvent e) {
	label.setText(getLabelText());//update info
	if(listener != null)
		listener.stateChanged(e);//forward Event
	if(updater != null)
		updater.update(slider.getValue());
}
 
Example 36
Project: Logisim   File: SimulationToolbarModel.java   Source Code and License 5 votes vote down vote up
@Override
public void stateChanged(ChangeEvent e) {
	Simulator sim = project.getSimulator();
	boolean running = sim != null && sim.isRunning();
	boolean ticking = sim != null && sim.isTicking();
	simEnable.setIcon(running ? "simstop.png" : "simplay.png");
	simEnable.setToolTip(
			running ? Strings.getter("simulateDisableStepsTip") : Strings.getter("simulateEnableStepsTip"));
	tickEnable.setIcon(ticking ? "simtstop.png" : "simtplay.png");
	tickEnable.setToolTip(
			ticking ? Strings.getter("simulateDisableTicksTip") : Strings.getter("simulateEnableTicksTip"));
	fireToolbarAppearanceChanged();
}
 
Example 37
Project: AgentWorkbench   File: TimeModelContinuousConfiguration.java   Source Code and License 5 votes vote down vote up
@Override
public void stateChanged(ChangeEvent ce) {
	if (this.enabledChangeListener==true) {
		Object ceTrigger = ce.getSource();
		if (ceTrigger instanceof JSpinner) {
			this.saveTimeModelToSimulationSetup();	
		}	
	}
}
 
Example 38
Project: incubator-netbeans   File: RerunAction.java   Source Code and License 5 votes vote down vote up
public void stateChanged(ChangeEvent e) {
    Boolean value = null;
    synchronized (this) {
        if (condition != null) {
            value = condition.isRerunPossible();
        }
    }

    if (value != null) {
        firePropertyChange("enabled", null, value); // NOI18N
    }
}
 
Example 39
Project: NBANDROID-V2   File: SDKWizardPanelDownload.java   Source Code and License 5 votes vote down vote up
@Override
public void propertyChange(PropertyChangeEvent evt) {
    if (SDKVisualPanel2Download.DOWNLOAD_OK.equals(evt.getPropertyName())) {
        for (ChangeListener listener : listeners) {
            listener.stateChanged(new ChangeEvent(this));
        }
    }
}
 
Example 40
Project: sbc-qsystem   File: FAdmin.java   Source Code and License 5 votes vote down vote up
private void spinCalendarYearStateChanged(
    javax.swing.event.ChangeEvent evt) {//GEN-FIRST:event_spinCalendarYearStateChanged
    System.out.println(spinCalendarYear.getValue());
    tableCalendar.setModel((CalendarTableModel) tableCalendar.getModel());
    tableCalendar
        .setDefaultRenderer(FreeDay.class,
            new TableCell((Integer) (spinCalendarYear.getValue())));
    tableCalendar
        .setDefaultRenderer(Object.class,
            new TableCell((Integer) (spinCalendarYear.getValue())));

    ((CalendarTableModel) tableCalendar.getModel()).fireTableDataChanged();
    ((CalendarTableModel) tableCalendar.getModel()).fireTableStructureChanged();
    tableCalendar.getColumnModel().getColumn(0).setPreferredWidth(500);
}