Package gov.nih.mipav.view
Class ImageRegistryMonitor
java.lang.Object
gov.nih.mipav.view.ImageRegistryMonitor
- All Implemented Interfaces:
FocusListener,Runnable,EventListener
Tracks registered images, and notifies anybody who is interested in finding out about them.
-
Field Summary
FieldsModifier and TypeFieldDescriptionprivate ChangeEventDOCUMENT ME!private EventListenerListDOCUMENT ME!DOCUMENT ME!private longDOCUMENT ME!private ThreadDOCUMENT ME! -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionvoidadd a memory change listener.protected voidNotify all listeners that have registered interest for notification on this event type.voidfocus gained.voidfocusLost(FocusEvent fe) when focus is lost the source is assumed to be a JTextField, and it sets the sample period.The name of images currently registered.voidremoves 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 Details
-
changeEvent
DOCUMENT ME! -
listenerList
DOCUMENT ME! -
registeredNames
DOCUMENT ME! -
sleepAmount
private long sleepAmountDOCUMENT ME! -
thread
DOCUMENT ME!
-
-
Constructor Details
-
ImageRegistryMonitor
public ImageRegistryMonitor()Constructor. Creates the list for listeners
-
-
Method Details
-
addImageRegistryChangeListener
add a memory change listener.- Parameters:
l- DOCUMENT ME!
-
focusGained
focus gained.- Specified by:
focusGainedin interfaceFocusListener- Parameters:
fe- DOCUMENT ME!
-
focusLost
when focus is lost the source is assumed to be a JTextField, and it sets the sample period.- Specified by:
focusLostin interfaceFocusListener- Parameters:
fe- DOCUMENT ME!
-
getRegisteredNames
The name of images currently registered.- Returns:
- Vector of image names
-
removeImageRegistryChangeListener
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. -
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.
-