Class ImageRegistryMonitor

java.lang.Object
gov.nih.mipav.view.ImageRegistryMonitor
All Implemented Interfaces:
FocusListener, Runnable, EventListener

public class ImageRegistryMonitor extends Object implements Runnable, FocusListener
Tracks registered images, and notifies anybody who is interested in finding out about them.
  • Field Details

    • changeEvent

      private ChangeEvent changeEvent
      DOCUMENT ME!
    • listenerList

      private EventListenerList listenerList
      DOCUMENT ME!
    • registeredNames

      private Vector<String> registeredNames
      DOCUMENT ME!
    • sleepAmount

      private long sleepAmount
      DOCUMENT ME!
    • thread

      private volatile Thread thread
      DOCUMENT ME!
  • Constructor Details

    • ImageRegistryMonitor

      public ImageRegistryMonitor()
      Constructor. Creates the list for listeners
  • Method Details

    • addImageRegistryChangeListener

      public void addImageRegistryChangeListener(ChangeListener l)
      add a memory change listener.
      Parameters:
      l - DOCUMENT ME!
    • focusGained

      public void focusGained(FocusEvent fe)
      focus gained.
      Specified by:
      focusGained in interface FocusListener
      Parameters:
      fe - DOCUMENT ME!
    • focusLost

      public void focusLost(FocusEvent fe)
      when focus is lost the source is assumed to be a JTextField, and it sets the sample period.
      Specified by:
      focusLost in interface FocusListener
      Parameters:
      fe - DOCUMENT ME!
    • getRegisteredNames

      public Vector<String> getRegisteredNames()
      The name of images currently registered.
      Returns:
      Vector of image names
    • removeImageRegistryChangeListener

      public void removeImageRegistryChangeListener(ChangeListener l)
      removes the change listener.
      Parameters:
      l - DOCUMENT ME!
    • run

      public void run()
      when the thread wakes up, it collects information from the runtime on current memory status. It then notifies all listeners.
      Specified by:
      run in interface Runnable
    • start

      public void start()
      Start the thread as a minimum priority thread.
    • stop

      public void stop()
      kill the thread.
    • fireImageRegistryChanged

      protected void fireImageRegistryChanged()
      Notify all listeners that have registered interest for notification on this event type. The event instance is lazily created using the parameters passed into the fire method.