Package jmri.beans

Class SwingPropertyChangeListener

  • All Implemented Interfaces:
    java.beans.PropertyChangeListener, java.util.EventListener

    public class SwingPropertyChangeListener
    extends java.lang.Object
    implements java.beans.PropertyChangeListener
    If constructed with SwingPropertyChangeListener(listener, true) this subclass of PropertyChangeListener ensures listener is only ever notified on the Event Dispatch Thread.
    • Constructor Summary

      Constructors 
      Constructor Description
      SwingPropertyChangeListener​(java.beans.PropertyChangeListener listener)
      Create a SwingPropertyChangeListener with an associated listener that notifies the associated listener on the EDT.
      SwingPropertyChangeListener​(java.beans.PropertyChangeListener listener, boolean notifyOnEDT)
      Create a SwingPropertyChangeListener with an associated listener.
    • Method Summary

      All Methods Instance Methods Concrete Methods 
      Modifier and Type Method Description
      boolean isNotifyOnEDT()  
      void propertyChange​(java.beans.PropertyChangeEvent evt)
      This implementation calls the listener's implementation on the EDT if isNotifyOnEDT() is true.
      • Methods inherited from class java.lang.Object

        clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
    • Constructor Detail

      • SwingPropertyChangeListener

        public SwingPropertyChangeListener​(java.beans.PropertyChangeListener listener)
        Create a SwingPropertyChangeListener with an associated listener that notifies the associated listener on the EDT.
        Parameters:
        listener - the listener that PropertyChangeEvents will be passed to
      • SwingPropertyChangeListener

        public SwingPropertyChangeListener​(java.beans.PropertyChangeListener listener,
                                           boolean notifyOnEDT)
        Create a SwingPropertyChangeListener with an associated listener.
        Parameters:
        listener - the listener that PropertyChangeEvents will be passed to
        notifyOnEDT - true to notify listener on the EDT; false to notify listener on current thread
    • Method Detail

      • propertyChange

        public void propertyChange​(java.beans.PropertyChangeEvent evt)
        This implementation calls the listener's implementation on the EDT if isNotifyOnEDT() is true.
        Specified by:
        propertyChange in interface java.beans.PropertyChangeListener