Package gov.nih.mipav.view
Class ImageRegistryMonitor
- java.lang.Object
-
- gov.nih.mipav.view.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.FocusListenerTracks 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.ChangeEventchangeEventDOCUMENT ME!private javax.swing.event.EventListenerListlistenerListDOCUMENT ME!private java.util.Vector<java.lang.String>registeredNamesDOCUMENT ME!private longsleepAmountDOCUMENT ME!private java.lang.ThreadthreadDOCUMENT ME!
-
Constructor Summary
Constructors Constructor Description ImageRegistryMonitor()Constructor.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description voidaddImageRegistryChangeListener(javax.swing.event.ChangeListener l)add a memory change listener.protected voidfireImageRegistryChanged()Notify all listeners that have registered interest for notification on this event type.voidfocusGained(java.awt.event.FocusEvent fe)focus gained.voidfocusLost(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.voidremoveImageRegistryChangeListener(javax.swing.event.ChangeListener l)removes the change listener.voidrun()when the thread wakes up, it collects information from the runtime on current memory status.voidstart()Start the thread as a minimum priority thread.voidstop()kill the thread.
-
-
-
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!
-
-
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:
focusGainedin interfacejava.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:
focusLostin interfacejava.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:
runin interfacejava.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.
-
-