Package java.beans

Examples of java.beans.PropertyChangeEvent


        m_listenerList.remove(PropertyChangeListener.class, l);
    }

    protected void firePropertyChangedEvent(String name, Object oldValue, Object newValue)
    {
        PropertyChangeEvent event = null;

        // Guaranteed to return a non-null array
        Object[] listeners = m_listenerList.getListenerList();

        // Process the listeners last to first, notifying
        // those that are interested in this event
        for (int i = listeners.length - 2; i >= 0; i -= 2)
        {
            if (listeners[i] == PropertyChangeListener.class)
            {
                // Lazily create the event:
                if (event == null)
                {
                    event = new PropertyChangeEvent(this, name, oldValue, newValue);
                }
                ((PropertyChangeListener) listeners[i + 1]).propertyChange(event);
            }
        }
    }
View Full Code Here


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

View Full Code Here

  /**
   * Forteller at det buffer har forandret seg.
   */
  final void fireBufferChange() {
    for (PropertyChangeListener listener : bufferingListeners) {
      listener.propertyChange(new PropertyChangeEvent(
          transportPresentationModel.getBean(), "buffering",
          transportPresentationModel.getBean(),
          transportPresentationModel.isBuffering()));
    }
  }
View Full Code Here

  /**
   * Forteller at sentstatus har endret seg.
   */
  final void fireSentChange() {
    for (PropertyChangeListener listener : sentListeners) {
      listener.propertyChange(new PropertyChangeEvent(
          transportPresentationModel.getBean(), "sent", null,
          transportPresentationModel.isBuffering()));
    }
  }
View Full Code Here

  /**
   * Forteller at montering har endret seg
   */
  private void fireAsesemblyChanged() {
    for (PropertyChangeListener listener : assemblyChangeListeners) {
      listener.propertyChange(new PropertyChangeEvent(this, "assembly",
          null, null));
    }
  }
View Full Code Here

            new PropertyEventNameMatcher(true, (String[]) null);
            fail("Expected exception for PropertyEventNameMatcher constructor");
        } catch (IllegalArgumentException ex) {
            // expected
        }
        final PropertyChangeEvent event1 = new PropertyChangeEvent(this, "test", "old", "new");
        final PropertyChangeEvent event2 = new PropertyChangeEvent(this, "test", null, null);
        final PropertyChangeEvent event3 = new PropertyChangeEvent(this, "hello", "old", "new");
        final PropertyChangeEvent event4 = new PropertyChangeEvent(this, "hello", null, null);
        final PropertyChangeEvent event5 = new PropertyChangeEvent(this, null, null, null);

        Matcher<PropertyChangeEvent> matcher = new PropertyEventNameMatcher(true, new String[] {"test", null});
        assertEquals(true, matcher.matches(event1));
        assertEquals(true, matcher.matches(event2));
        assertEquals(false, matcher.matches(event3));
View Full Code Here

   *
   * @param buffering
   */
  void fireTransportChange(boolean buffering) {
    for (PropertyChangeListener listener : transportChangeListeners) {
      listener.propertyChange(new PropertyChangeEvent(this, null, null,
          buffering));
    }
  }
View Full Code Here

    public void addListener(ProfileListener listener, boolean canRemove) {
        if (listener == null) {
            throw new NullPointerException("Cannot add a null listener");
        }
        listeners.put(listener, canRemove);
  PropertyChangeEvent event =
      new PropertyChangeEvent(this, "com.sun.sgs.profile.threadcount",
            null, schedulerThreadCount);

        listener.propertyChange(event);
        for (ProfileConsumerImpl pc : consumers.values()) {
            for (ProfileOperation p : pc.getOperations()) {
                event =
                    new PropertyChangeEvent(this, "com.sun.sgs.profile.newop",
              null, p);
                listener.propertyChange(event);
            }
        }
    }
View Full Code Here

    /**
     * Notifies the collector that a thread has been added to the scheduler.
     */
    void notifyThreadAdded() {
        schedulerThreadCount++;
  PropertyChangeEvent event =
      new PropertyChangeEvent(this, "com.sun.sgs.profile.threadcount",
            schedulerThreadCount - 1,
            schedulerThreadCount);

        for (ProfileListener listener : listeners.keySet()) {
            listener.propertyChange(event);
View Full Code Here

     * Notifies the collector that a thread has been removed from the
     * scheduler.
     */
    void notifyThreadRemoved() {
        schedulerThreadCount--;
  PropertyChangeEvent event =
      new PropertyChangeEvent(this, "com.sun.sgs.profile.threadcount",
            schedulerThreadCount + 1,
            schedulerThreadCount);

        for (ProfileListener listener : listeners.keySet()) {
            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.