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(); } } } }
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(); }
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; }
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; }
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); } }
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()); }
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; } }
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 } }
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); }
/** 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(); } }
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; }
@Override public void stateChanged(ChangeEvent event) { SwingUtilities.invokeLater(new Runnable() { @Override public void run() { SwingUtilities.invokeLater(new Runnable() { @Override public void run() { updateChart(); } }); } }); }
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)); } }
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)); } }
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); }
@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); }
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); } }
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)); }
private void InitListeners() { // Tab 切换 tabbedPane.addChangeListener((ChangeEvent e) -> { logger.debug(Integer.toString(tabbedPane.getSelectedIndex())); TabController tabController = (TabController)tabbedPane.getSelectedComponent(); Settings.getInstance().setCurrentTab(tabController.getTabType()); }); }
@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); } }
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); } }); }
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); } }
@Override public void stateChanged(ChangeEvent e) { double scale = getScale(); curScale.setText((int) Math.round(100.0 * scale) + "%"); if (curScaleDim != null) curScale.setPreferredSize(curScaleDim); }
@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(); }
@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()); }
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)); }
private void registerClientPresenterListener(AbstractButton presenter) { presenter.addChangeListener(new ChangeListener() { public void stateChanged(ChangeEvent e) { updateClientPresentersEnabling(getClientPresenters()); } }); }
/** * 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); } } }
/** 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(); }
private void checkBoxClientAutoStateChanged( javax.swing.event.ChangeEvent evt) {//GEN-FIRST:event_checkBoxClientAutoStateChanged buttonClientRequest.setEnabled(!checkBoxClientAuto.isSelected()); if (timer.isRunning() && checkBoxClientAuto.isSelected()) { checkWelcome(null); } startTimer(); }
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); } }
/** 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()); } }); }
/** * */ 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); } } }
@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()); }
@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(); }
@Override public void stateChanged(ChangeEvent ce) { if (this.enabledChangeListener==true) { Object ceTrigger = ce.getSource(); if (ceTrigger instanceof JSpinner) { this.saveTimeModelToSimulationSetup(); } } }
public void stateChanged(ChangeEvent e) { Boolean value = null; synchronized (this) { if (condition != null) { value = condition.isRerunPossible(); } } if (value != null) { firePropertyChange("enabled", null, value); // NOI18N } }
@Override public void propertyChange(PropertyChangeEvent evt) { if (SDKVisualPanel2Download.DOWNLOAD_OK.equals(evt.getPropertyName())) { for (ChangeListener listener : listeners) { listener.stateChanged(new ChangeEvent(this)); } } }
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); }