Class ImageRegistryMonitor

  • All Implemented Interfaces:
    java.awt.event.FocusListener, java.lang.Runnable, java.util.EventListener

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

      Fields 
      Modifier and Type Field Description
      private javax.swing.event.ChangeEvent changeEvent
      DOCUMENT ME!
      private javax.swing.event.EventListenerList listenerList
      DOCUMENT ME!
      private java.util.Vector<java.lang.String> registeredNames
      DOCUMENT ME!
      private long sleepAmount
      DOCUMENT ME!
      private java.lang.Thread thread
      DOCUMENT ME!
    • Method Summary

      All Methods Instance Methods Concrete Methods 
      Modifier and Type Method Description
      void addImageRegistryChangeListener​(javax.swing.event.ChangeListener l)
      add a memory change listener.
      protected void fireImageRegistryChanged()
      Notify all listeners that have registered interest for notification on this event type.
      void focusGained​(java.awt.event.FocusEvent fe)
      focus gained.
      void focusLost​(java.awt.event.FocusEvent fe)
      when focus is lost the source is assumed to be a JTextField, and it sets the sample period.
      java.util.Vector<java.lang.String> getRegisteredNames()
      The name of images currently registered.
      void removeImageRegistryChangeListener​(javax.swing.event.ChangeListener l)
      removes the change listener.
      void run()
      when the thread wakes up, it collects information from the runtime on current memory status.
      void start()
      Start the thread as a minimum priority thread.
      void stop()
      kill the thread.
      • Methods inherited from class java.lang.Object

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

      • changeEvent

        private javax.swing.event.ChangeEvent changeEvent
        DOCUMENT ME!
      • listenerList

        private javax.swing.event.EventListenerList listenerList
        DOCUMENT ME!
      • registeredNames

        private java.util.Vector<java.lang.String> registeredNames
        DOCUMENT ME!
      • sleepAmount

        private long sleepAmount
        DOCUMENT ME!
      • thread

        private volatile java.lang.Thread thread
        DOCUMENT ME!
    • Constructor Detail

      • ImageRegistryMonitor

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

      • addImageRegistryChangeListener

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

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

        public void focusLost​(java.awt.event.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 java.awt.event.FocusListener
        Parameters:
        fe - DOCUMENT ME!
      • getRegisteredNames

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

        public void removeImageRegistryChangeListener​(javax.swing.event.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 java.lang.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.