public void propertyChange(PropertyChangeEvent e) { String prop = e.getPropertyName(); if (isVisible() && (e.getSource() == optionPane) && (JOptionPane.VALUE_PROPERTY.equals(prop) || JOptionPane.INPUT_VALUE_PROPERTY.equals(prop))) { Object value = optionPane.getValue(); if (value == JOptionPane.UNINITIALIZED_VALUE) return; optionPane.setValue(JOptionPane.UNINITIALIZED_VALUE); if (button1.equals(value)) { try { double a = Double.parseDouble(left.getText()); double b = Double.parseDouble(right.getText()); double err = Double.parseDouble(error.getText()); if (a > b) { JOptionPane.showMessageDialog(this, "A < B!!!", null, JOptionPane.ERROR_MESSAGE); } else { hideIt(); graphic.startApplyingMethod(parentFrame.getSelectedMethod(), err, a, b); } } catch (Exception ex) { JOptionPane.showMessageDialog( this, "Trebuie sa fie numar real!", null, JOptionPane.ERROR_MESSAGE); } } else if (button2.equals(value)) { hideIt(); } } }
public void propertyChange(PropertyChangeEvent e) { if (e.getPropertyName().equals("minimum") && startAtMin) { start = getMinimum(); } if (e.getPropertyName().equals("minimum") || e.getPropertyName().equals("maximum")) { Enumeration keys = getLabelTable().keys(); Hashtable<Object, Object> hashtable = new Hashtable<Object, Object>(); // Save the labels that were added by the developer while (keys.hasMoreElements()) { Object key = keys.nextElement(); Object value = labelTable.get(key); if (!(value instanceof LabelUIResource)) { hashtable.put(key, value); } } clear(); createLabels(); // Add the saved labels keys = hashtable.keys(); while (keys.hasMoreElements()) { Object key = keys.nextElement(); put(key, hashtable.get(key)); } ((JSlider) e.getSource()).setLabelTable(this); } }
/** * Notifies this instance that there was a change in the value of a property of an * <tt>Endpoint</tt> participating in this multipoint conference. * * @param endpoint the <tt>Endpoint</tt> which is the source of the event/notification and is * participating in this multipoint conference * @param ev a <tt>PropertyChangeEvent</tt> which specifies the source of the event/notification, * the name of the property and the old and new values of that property */ private void endpointPropertyChange(Endpoint endpoint, PropertyChangeEvent ev) { String propertyName = ev.getPropertyName(); boolean maybeRemoveEndpoint; if (Endpoint.SCTP_CONNECTION_PROPERTY_NAME.equals(propertyName)) { // The SctpConnection of/associated with an Endpoint has changed. We // may want to fire initial events over that SctpConnection (as soon // as it is ready). SctpConnection oldValue = (SctpConnection) ev.getOldValue(); SctpConnection newValue = (SctpConnection) ev.getNewValue(); endpointSctpConnectionChanged(endpoint, oldValue, newValue); // The SctpConnection may have expired. maybeRemoveEndpoint = (newValue == null); } else if (Endpoint.CHANNELS_PROPERTY_NAME.equals(propertyName)) { // An RtpChannel may have expired. maybeRemoveEndpoint = true; } else { maybeRemoveEndpoint = false; } if (maybeRemoveEndpoint) { // It looks like there is a chance that the Endpoint may have // expired. Endpoints are held by this Conference via WeakReferences // but WeakReferences are unpredictable. We have functionality // though which could benefit from discovering that an Endpoint has // expired as quickly as possible (e.g. ConferenceSpeechActivity). // Consequently, try to expedite the removal of expired Endpoints. if (endpoint.getSctpConnection() == null && endpoint.getChannelCount(null) == 0) { removeEndpoint(endpoint); } } }
@Override public void propertyChange(PropertyChangeEvent evt) { if (evt.getSource() != beanHelper.getBean() || evt.getPropagationId() == JBeanEditor.class) { return; } refresh(); }
@Override public void propertyChange(PropertyChangeEvent evt) { String strPropertyName = evt.getPropertyName(); if ("progress".equals(strPropertyName)) { progressBar.setIndeterminate(false); int progress = (Integer) evt.getNewValue(); progressBar.setValue(progress); } }
public void propertyChange(PropertyChangeEvent e) { String prop = e.getPropertyName(); if (prop == JFileChooser.SELECTED_FILE_CHANGED_PROPERTY) { if (isShowing()) { loadImage((File) e.getNewValue()); repaint(); } } }
public void propertyChange(PropertyChangeEvent e) { String prop = e.getPropertyName(); if (prop == JFileChooser.CHOOSABLE_FILE_FILTER_CHANGED_PROPERTY) { filters = (FileFilter[]) e.getNewValue(); fireContentsChanged(this, -1, -1); } else if (prop == JFileChooser.FILE_FILTER_CHANGED_PROPERTY) { fireContentsChanged(this, -1, -1); } }
public void propertyChange(PropertyChangeEvent e) { String propertyName = e.getPropertyName(); if (e.getPropertyName().equals(Action.NAME)) { String text = (String) e.getNewValue(); menuItem.setText(text); } else if (propertyName.equals("enabled")) { Boolean enabledState = (Boolean) e.getNewValue(); menuItem.setEnabled(enabledState.booleanValue()); } }
public void propertyChange(PropertyChangeEvent e) { String propertyName = e.getPropertyName(); if (e.getPropertyName().equals(Action.NAME)) { String text = (String) e.getNewValue(); menuItem.setText(text); } else if (propertyName.equals("enabled")) { // System.out.println("Debug:TextViewer: ActionChangedListener enabled"); Boolean enabledState = (Boolean) e.getNewValue(); menuItem.setEnabled(enabledState.booleanValue()); } }
/** * A property in the observed bean has changed. First checks, if this listener should handle the * event, because the event's property name is the one to be observed or the event indicates * that any property may have changed. In case the event provides no new value, it is read from * the source bean. * * @param evt the property change event to be handled */ public void propertyChange(PropertyChangeEvent evt) { String sourcePropertyName = sourcePropertyDescriptor.getName(); if ((evt.getPropertyName() == null) || (evt.getPropertyName().equals(sourcePropertyName))) { Object newValue = evt.getNewValue(); if (newValue == null) { newValue = BeanUtils.getValue(sourceBean, sourcePropertyDescriptor); } setValueSilently( sourceBean, sourcePropertyDescriptor, targetBean, targetPropertyDescriptor, newValue); } }
/** * This method gets called when a bound property is changed. * * @param e A <code>PropertyChangeEvent</code> object describing the event source and the * property that has changed. Must not be null. * @throws NullPointerException if the parameter is null. * @since 1.5 */ public void propertyChange(PropertyChangeEvent e) { String propertyName = e.getPropertyName(); if (propertyName == "visible") { if (e.getOldValue() == Boolean.FALSE && e.getNewValue() == Boolean.TRUE) { handlePopupIsVisibleEvent(true); } else if (e.getOldValue() == Boolean.TRUE && e.getNewValue() == Boolean.FALSE) { handlePopupIsVisibleEvent(false); } } }
public void propertyChange(PropertyChangeEvent event) { try { accept((ScalarMapAdapter) event.getSource(), (ScalarMap) event.getOldValue()); } catch (Exception e) { System.err.println( getClass().getName() + ".propertyChange(): " + "Couldn't handle change to ScalarMap: " + e); } }
// // Implement PropertyChangeListener interface // @Override public void propertyChange(PropertyChangeEvent evt) { if (evt.getNewValue() instanceof Font) { if (updateFont) { Font newFont = (Font) evt.getNewValue(); setFont(newFont); lastDigits = 0; setPreferredWidth(); } else { repaint(); } } }
// // Implement the PropertyChangeListener // public void propertyChange(PropertyChangeEvent e) { // When the TableModel changes we need to update the listeners // and column widths if ("model".equals(e.getPropertyName())) { TableModel model = (TableModel) e.getOldValue(); model.removeTableModelListener(this); model = (TableModel) e.getNewValue(); model.addTableModelListener(this); adjustColumns(); } }
@Override public void vetoableChange(PropertyChangeEvent ev) throws PropertyVetoException { Object source = ev.getSource(); String eventName = ev.getPropertyName(); if (source instanceof FormProperty<?> && FormProperty.PROP_VALUE.equals(eventName)) { ev = new PropertyChangeEvent( layoutDelegate, ((FormProperty<?>) source).getName(), ev.getOldValue(), ev.getNewValue()); containerLayoutChanged(ev); } }
@Override public void propertyChange(final PropertyChangeEvent evt) { final String propertyName = evt.getPropertyName(); if (AquaFocusHandler.FRAME_ACTIVE_PROPERTY.equals(propertyName)) { final JTextComponent comp = ((JTextComponent) evt.getSource()); if (evt.getNewValue() == Boolean.TRUE) { setVisible(comp.hasFocus()); } else { setVisible(false); } if (getDot() != getMark()) comp.getUI().damageRange(comp, getDot(), getMark()); } }
// // Implement the PropertyChangeListener // public void propertyChange(PropertyChangeEvent e) { // Keep the row table in sync with the main table if ("selectionModel".equals(e.getPropertyName())) { setSelectionModel(main.getSelectionModel()); } if ("rowHeight".equals(e.getPropertyName())) { repaint(); } if ("model".equals(e.getPropertyName())) { main.getModel().addTableModelListener(this); revalidate(); } }
public void propertyChange(PropertyChangeEvent e) { String prop = e.getPropertyName(); if (JFileChooser.DIRECTORY_CHANGED_PROPERTY.equals(prop)) fc.setSelectedFile(new File(name)); else if (JFileChooser.SELECTED_FILE_CHANGED_PROPERTY.equals(prop) && !fc.getSelectedFile().isDirectory()) name = fc.getSelectedFile().getName(); }
/** * Function called when an audio device is plugged or unplugged. * * @param event The property change event which may concern the audio device. */ public void propertyChange(PropertyChangeEvent event) { if (DeviceConfiguration.PROP_AUDIO_SYSTEM_DEVICES.equals(event.getPropertyName())) { NotificationService notificationService = getNotificationService(); if (notificationService != null) { // Registers only once to the popup message notification // handler. if (!isRegisteredToPopupMessageListener) { isRegisteredToPopupMessageListener = true; managePopupMessageListenerRegistration(true); } // Fires the popup notification. ResourceManagementService resources = NeomediaActivator.getResources(); Map<String, Object> extras = new HashMap<String, Object>(); extras.put(NotificationData.POPUP_MESSAGE_HANDLER_TAG_EXTRA, this); notificationService.fireNotification( DEVICE_CONFIGURATION_HAS_CHANGED, resources.getI18NString("impl.media.configform" + ".AUDIO_DEVICE_CONFIG_CHANGED"), resources.getI18NString( "impl.media.configform" + ".AUDIO_DEVICE_CONFIG_MANAGMENT_CLICK"), null, extras); } } }
public void vetoableChange(PropertyChangeEvent e) throws PropertyVetoException { try { eventProcessor.processExceptionableEvent(e.getPropertyName(), new Object[] {e}); } catch (PropertyVetoException ex) { throw ex; } catch (Exception ex) { } }
/** * The animation changed. Handle the change. * * @param evt The event */ private void handleAnimationPropertyChange(PropertyChangeEvent evt) { // System.err.println ("Handlechange:" +evt.getPropertyName()); if (evt.getPropertyName().equals(Animation.ANI_VALUE)) { debug("handleAnimationPropertyChange value :" + evt.getPropertyName()); Real eventValue = (Real) evt.getNewValue(); // if there's nothing to do, return; if ((eventValue == null) || eventValue.isMissing()) { return; } /** The Animation associated with this widget */ DateTime time = null; try { time = new DateTime(eventValue); } catch (VisADException ve) {; } final DateTime theDateTime = time; final int theIndex = ((anime != null) ? anime.getCurrent() : -1); SwingUtilities.invokeLater( new Runnable() { public void run() { boolean oldValue = ignoreTimesCbxEvents; try { ignoreTimesCbxEvents = true; // synchronized (timesCbxMutex) { xcnt++; timesCbx.setSelectedItem(theDateTime); // } if ((boxPanel != null) && (theIndex >= 0)) { boxPanel.setOnIndex(theIndex); } timesCbx.repaint(); } finally { ignoreTimesCbxEvents = oldValue; } } }); shareValue(); } else if (evt.getPropertyName().equals(Animation.ANI_SET)) { if (ignoreAnimationSetChange) { return; } updateIndicatorInner((Set) evt.getNewValue(), true); } }
@Override public void componentLayoutChanged(int index, PropertyChangeEvent ev) throws PropertyVetoException { RADVisualComponent<?> radComp = radContainer.getSubComponent(index); if (ev != null && ev.getPropertyName() != null) { layoutDelegate.acceptComponentLayoutChange(index, ev); FormModel formModel = radContainer.getFormModel(); formModel.fireComponentLayoutChanged( radComp, ev.getPropertyName(), ev.getOldValue(), ev.getNewValue()); if (radComp.getNodeReference() != null) // propagate the change to node { radComp .getNodeReference() .firePropertyChangeHelper(ev.getPropertyName(), ev.getOldValue(), ev.getNewValue()); } } else { if (radComp.getNodeReference() != null) // propagate the change to node { radComp.getNodeReference().fireComponentPropertySetsChange(); } radComp.resetConstraintsProperties(); } }
public void propertyChange(PropertyChangeEvent event) { // session list changed if (event.getSource() instanceof CollabManager) { attachListeners(); } // either session list or session status changed updateStatus(); }
// Called on EDT public void propertyChange(PropertyChangeEvent ev) { String prop = ev.getPropertyName(); if (prop == JConsoleContext.CONNECTION_STATE_PROPERTY) { ConnectionState newState = (ConnectionState) ev.getNewValue(); switch (newState) { case DISCONNECTED: synchronized (this) { long time = System.currentTimeMillis(); times.add(time); for (Sequence seq : seqs) { seq.add(Long.MIN_VALUE); } } break; } } }
@Override public void propertyChange(PropertyChangeEvent ev) { Object source = ev.getSource(); String eventName = ev.getPropertyName(); if (source instanceof FormProperty<?> && FormProperty.PROP_VALUE.equals(eventName)) { ev = new PropertyChangeEvent( layoutDelegate, ((FormProperty<?>) source).getName(), ev.getOldValue(), ev.getNewValue()); try { containerLayoutChanged(ev); } catch (PropertyVetoException ex) { // should not happen } } }
/** * Notifies this instance that there was a change in the value of a property of {@link * #speechActivity}. * * @param ev a <tt>PropertyChangeEvent</tt> which specifies the source of the event/notification, * the name of the property and the old and new values of that property */ private void speechActivityPropertyChange(PropertyChangeEvent ev) { String propertyName = ev.getPropertyName(); if (ConferenceSpeechActivity.DOMINANT_ENDPOINT_PROPERTY_NAME.equals(propertyName)) { // The dominant speaker in this Conference has changed. We will // likely want to notify the Endpoints participating in this // Conference. dominantSpeakerChanged(); } else if (ConferenceSpeechActivity.ENDPOINTS_PROPERTY_NAME.equals(propertyName)) { speechActivityEndpointsChanged(); } }
public void propertyChange(PropertyChangeEvent e) { if (e.getSource() instanceof PanelThreadMonitor) { if (e.getPropertyName().equals("Status")) { PanelThreadMonitor mntTmp = (PanelThreadMonitor) e.getSource(); int iMonitorIndex = pnlThread.indexOfComponent(mntTmp); if (iMonitorIndex >= 0) { if (e.getNewValue().equals("Started")) { if (!pnlThread.getBackgroundAt(iMonitorIndex).equals(COLOR_STARTED)) { pnlThread.setBackgroundAt(iMonitorIndex, COLOR_STARTED); pnlThread.setForegroundAt(iMonitorIndex, COLOR_STARTED_FG); } } else if (e.getNewValue().equals("Stopped")) { if (!pnlThread.getBackgroundAt(iMonitorIndex).equals(SystemColor.controlShadow)) { pnlThread.setBackgroundAt(iMonitorIndex, UIManager.getColor("TabbedPane.background")); pnlThread.setForegroundAt(iMonitorIndex, SystemColor.textText); } } } } } }
/** * Called with a DjVuBean property has changed. * * @param e the PropertyChangeEvent. */ public void propertyChange(final PropertyChangeEvent e) { try { final String name = e.getPropertyName(); if ("page".equalsIgnoreCase(name)) { final Object object = e.getNewValue(); if (object instanceof Number) { setCheckedPage(((Number) object).intValue() - 1); } } else if ("propertyName".equalsIgnoreCase(name)) { final String propertyName = (String) e.getNewValue(); if ("navpane".equalsIgnoreCase(propertyName)) { setVisible("Outline".equalsIgnoreCase(djvuBean.properties.getProperty(propertyName))); } } } catch (final Throwable exp) { exp.printStackTrace(DjVuOptions.err); System.gc(); } }
public void propertyChange(PropertyChangeEvent event) { // A ConstantMap of the adapted data has changed. try { setChanged((DataAdapter) event.getSource()); } catch (Exception e) { System.err.println( getClass().getName() + ".propertyChange(): " + "Couldn't handle change to data: " + e); } }
@Override public void firePropertyChange(PropertyChangeEvent evt) { // do nothing if value not changed - the super method will check it anyway // but this way we don't have to log it if (ObjectUtils.equals(evt.getOldValue(), evt.getNewValue())) { return; } // improve log display for arrays Object newValue = evt.getNewValue(); Object oldValue = evt.getOldValue(); if (oldValue instanceof Object[]) { oldValue = Arrays.toString((Object[]) oldValue); newValue = Arrays.toString((Object[]) newValue); } // log change logger.log( Level.CONFIG, "Config changed - property: {0}, old: {1}, new: {2}", new Object[] {evt.getPropertyName(), oldValue, newValue}); // fire change super.firePropertyChange(evt); }