Package java.beans

Examples of java.beans.PropertyChangeEvent


     */
    protected void fireProviderStatusMessageChangeEvent(
        String oldStatusMessage,
        String newStatusMessage)
    {
        PropertyChangeEvent evt
            = new PropertyChangeEvent(
                    parentProvider,
                    ProviderPresenceStatusListener.STATUS_MESSAGE,
                    oldStatusMessage,
                    newStatusMessage);

View Full Code Here


 
  /**
   * @param event
   */
  private void firePropertyChanged(Object source, String key, Object oldVal, Object newVal) {
    PropertyChangeEvent evt = null;
    synchronized(listeners) {
      for(int i = listeners.size() - 1; i >= 0 ; i-- ) {
        if(evt == null) {
          evt = new PropertyChangeEvent(source, key, oldVal, newVal);         
        }
        ((PropertyChangeListener)listeners.elementAt(i)).propertyChange(evt);
      }
    }   
  }
View Full Code Here

            String propertyName = ev.getPropertyName();
            Object oldValue = ev.getOldValue();
            Object newValue = getValue(propertyName);
            if (PluginAction.Property.ENABLED.name().equals(propertyName)) {
              propertyChangeSupport.firePropertyChange(
                  new PropertyChangeEvent(ev.getSource(), "enabled", oldValue, newValue));
            } else {
              // In case a property value changes, fire the new value decorated in subclasses
              // unless new value is null (most Swing listeners don't check new value is null !)
              if (newValue != null) {
                if (PluginAction.Property.NAME.name().equals(propertyName)) {
                  propertyChangeSupport.firePropertyChange(new PropertyChangeEvent(ev.getSource(),
                      Action.NAME, oldValue, newValue));
                } else if (PluginAction.Property.SHORT_DESCRIPTION.name().equals(propertyName)) {
                  propertyChangeSupport.firePropertyChange(new PropertyChangeEvent(ev.getSource(),
                      Action.NAME, oldValue, newValue));
                } else if (PluginAction.Property.MNEMONIC.name().equals(propertyName)) {
                  propertyChangeSupport.firePropertyChange(new PropertyChangeEvent(ev.getSource(),
                      Action.MNEMONIC_KEY,
                      oldValue != null
                          ? new Integer((Character)oldValue)
                          : null, newValue));
                } else if (PluginAction.Property.SMALL_ICON.name().equals(propertyName)) {
                  propertyChangeSupport.firePropertyChange(new PropertyChangeEvent(ev.getSource(),
                      Action.SMALL_ICON,
                      oldValue != null
                         ? IconManager.getInstance().getIcon((Content)oldValue, DEFAULT_SMALL_ICON_HEIGHT, HomePane.this)
                         : null, newValue));
                } else {
                  propertyChangeSupport.firePropertyChange(new PropertyChangeEvent(ev.getSource(),
                      propertyName, oldValue, newValue));
                }
              }
            }
          }
View Full Code Here

            } else {
              Object newValue = getValue(propertyName);
              // In case a property value changes, fire the new value decorated in subclasses
              // unless new value is null (most Swing listeners don't check new value is null !)
              if (newValue != null) {
                propertyChangeSupport.firePropertyChange(new PropertyChangeEvent(ev.getSource(),
                    propertyName, ev.getOldValue(), newValue));
              }
            }
          }
        });
View Full Code Here

    if (newTracker != null) {
      if (newPropertyValue instanceof IComponent) {
        for (Map.Entry<String, Object> property : ((IComponent) newPropertyValue)
            .straightGetProperties().entrySet()) {
          if (oldPropertyValue instanceof IComponent) {
            newTracker.propertyChange(new PropertyChangeEvent(newPropertyValue,
                property.getKey(), null, property.getValue()));
          } else {
            newTracker.propertyChange(new PropertyChangeEvent(newPropertyValue,
                property.getKey(), null, property.getValue()));
          }
        }
      }
    } else if (oldTracker != null) {
      if (oldPropertyValue instanceof IComponent) {
        for (Map.Entry<String, Object> property : ((IComponent) oldPropertyValue)
            .straightGetProperties().entrySet()) {
          oldTracker.propertyChange(new PropertyChangeEvent(oldPropertyValue,
              property.getKey(), property.getValue(), null));
        }
      }
    }
  }
View Full Code Here

    public void removePropertyChangeListener(PropertyChangeListener listener) {
        listeners.remove(listener);
    }

    private void firePropertyChangeEvent(String propertyName, Object oldValue, Object newValue) {
        PropertyChangeEvent evt = null;
        if (propertyName.equals(SELECTED_LAYOUT)) {
            evt = new PropertyChangeEvent(this, SELECTED_LAYOUT, oldValue, newValue);
        } else if (propertyName.equals(RUNNING)) {
            evt = new PropertyChangeEvent(this, RUNNING, oldValue, newValue);
        } else {
            return;
        }
        for (PropertyChangeListener l : listeners) {
            l.propertyChange(evt);
View Full Code Here

        defaultValues();
        limits = VizController.getInstance().getLimits();
    }

    public void init() {
        final PropertyChangeEvent evt = new PropertyChangeEvent(this, "init", null, null);
        SwingUtilities.invokeLater(new Runnable() {

            public void run() {
                for (PropertyChangeListener l : listeners) {
                    l.propertyChange(evt);
View Full Code Here

    public void removePropertyChangeListener(PropertyChangeListener listener) {
        listeners.remove(listener);
    }

    public void fireProperyChange(String propertyName, Object oldvalue, Object newValue) {
        PropertyChangeEvent evt = new PropertyChangeEvent(this, propertyName, oldvalue, newValue);
        for (PropertyChangeListener l : listeners) {
            l.propertyChange(evt);
        }
    }
View Full Code Here

        listeners.remove(changeListener);
    }

    private void firePropertyChangeEvent(String key, Object oldValue, Object newValue) {
        //System.out.println("fire "+key+" = "+newValue);
        PropertyChangeEvent evt = new PropertyChangeEvent(this, key, oldValue, newValue);
        for (PropertyChangeListener listener : listeners) {
            listener.propertyChange(evt);
        }
    }
View Full Code Here

    public void removePropertyChangeListener(PropertyChangeListener listener) {
        listeners.remove(listener);
    }

    private void firePropertyChangeEvent(String propertyName, Object beforeValue, Object afterValue) {
        PropertyChangeEvent event = new PropertyChangeEvent(this, propertyName, beforeValue, afterValue);
        for (PropertyChangeListener listener : listeners) {
            listener.propertyChange(event);
        }
    }
View Full Code Here

TOP

Related Classes of java.beans.PropertyChangeEvent

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.