visad.collab
Class DisplayMonitorImpl
- java.lang.Object
-
- visad.collab.DisplayMonitorImpl
-
- All Implemented Interfaces:
- java.io.Serializable, java.util.EventListener, DisplayMonitor, ControlListener, DisplayListener, MessageListener, ScalarMapListener
public class DisplayMonitorImpl extends java.lang.Object implements DisplayMonitor
DisplayMonitorImpl is theDisplaymonitor implementation.DisplayMonitorImpl is not
Serializableand should not be copied between JVMs.- See Also:
- Serialized Form
-
-
Field Summary
-
Fields inherited from interface visad.collab.DisplayMonitor
UNKNOWN_LISTENER_ID
-
-
Constructor Summary
Constructors Constructor and Description DisplayMonitorImpl(DisplayImpl dpy)Creates a monitor for the specifiedDisplay.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method and Description voidaddListener(MonitorCallback listener, int id)Adds the specified listener to receiveMonitorEventswhen the monitoredDisplay'sstate changes.voidaddListener(RemoteDisplay rmtDpy, int id)Adds the specified remote display to receiveMonitorEventswhen the monitoredDisplay'sstate changes.voidaddRemoteListener(RemoteDisplay rd)Initializes links so thatMonitorEventswill be exchanged with the specified remoteDisplay.intcheckID(int id)Returns a suggestion for a unique listener identifier which is equal to or greater than the supplied ID.voidcontrolChanged(ControlEvent evt)HandlesControlchanges.
If theControlEventis not ignored, aControlMonitorEventwill be sent to all listeners.voidcontrolChanged(ScalarMapControlEvent evt)Handles ScalarMap control changes.
This is just a stub which ignores the event.voiddestroy()destroy this monitorvoiddisplayChanged(DisplayEvent evt)Handles notification of objects being added to or removed from theDisplay.
If theDisplayEventis not ignored, aMapMonitorEventorReferenceMonitorEventwill be sent to all listeners.intgetConnectionID(RemoteDisplay rmtDpy)Return the ID associated with the specified RemoteDisplay.booleanhasEventQueued(Control ctl)Returns true if there is aMonitorEventfor the specifiedControlwaiting to be delivered to any listener.booleanhasEventQueued(int listenerID, Control ctl)Returns true if there is aMonitorEventfor the specifiedControlwaiting to be delivered to the listener with the specified id.booleanisEmpty()voidmapChanged(ScalarMapEvent evt)Handles ScalarMap data changes.
If theScalarMapEventis not ignored, aMapMonitorEventwill be sent to all listeners.voidnotifyListeners(MonitorEvent evt)Forwards theMonitorEventto all the listeners associated with thisDisplayMonitor.voidreceiveMessage(MessageEvent msg)Handles MessageEvent forwarding.voidremoveListener(MonitorCallback l)Stops forwardingMonitorEvents to the specified listener.voidsetDisplaySync(DisplaySync sync)Set the display synchronization object for this displayjava.lang.StringtoString()Returns the name of thisDisplayMonitor.
-
-
-
Constructor Detail
-
DisplayMonitorImpl
public DisplayMonitorImpl(DisplayImpl dpy)
Creates a monitor for the specifiedDisplay.- Parameters:
dpy- TheDisplayto monitor.
-
-
Method Detail
-
addListener
public void addListener(MonitorCallback listener, int id) throws java.rmi.RemoteException, VisADException
Adds the specified listener to receiveMonitorEventswhen the monitoredDisplay'sstate changes.- Specified by:
addListenerin interfaceDisplayMonitor- Parameters:
listener- The listener to add.id- The unique listener identifier.- Throws:
VisADException- If the listenerVectoris uninitialized.java.rmi.RemoteException- If there was an RMI-related problem.
-
addListener
public void addListener(RemoteDisplay rmtDpy, int id) throws java.rmi.RemoteException, VisADException
Adds the specified remote display to receiveMonitorEventswhen the monitoredDisplay'sstate changes.- Specified by:
addListenerin interfaceDisplayMonitor- Parameters:
rmtDpy- The remote display to add.id- The unique listener identifier.- Throws:
VisADException- If the listenerVectoris uninitialized.java.rmi.RemoteException- If there was an RMI-related problem.
-
addRemoteListener
public void addRemoteListener(RemoteDisplay rd) throws java.rmi.RemoteException, RemoteVisADException
Initializes links so thatMonitorEventswill be exchanged with the specified remoteDisplay.- Specified by:
addRemoteListenerin interfaceDisplayMonitor- Parameters:
rd- The remoteDisplayto synchronize.- Throws:
java.rmi.RemoteException- If there was an RMI-related problem.RemoteVisADException- If the inter-Displaylinks could not be made.
-
checkID
public int checkID(int id)
Returns a suggestion for a unique listener identifier which is equal to or greater than the supplied ID.- Specified by:
checkIDin interfaceDisplayMonitor- Parameters:
id- The identifier to check.
-
controlChanged
public void controlChanged(ControlEvent evt)
HandlesControlchanges.
If theControlEventis not ignored, aControlMonitorEventwill be sent to all listeners.- Specified by:
controlChangedin interfaceControlListener- Parameters:
evt- The details of theControlchange.
-
controlChanged
public void controlChanged(ScalarMapControlEvent evt)
Handles ScalarMap control changes.
This is just a stub which ignores the event.- Specified by:
controlChangedin interfaceScalarMapListener- Parameters:
evt- The details of theScalarMapchange.
-
destroy
public void destroy()
destroy this monitor- Specified by:
destroyin interfaceDisplayMonitor
-
displayChanged
public void displayChanged(DisplayEvent evt)
Handles notification of objects being added to or removed from theDisplay.
If theDisplayEventis not ignored, aMapMonitorEventorReferenceMonitorEventwill be sent to all listeners.- Specified by:
displayChangedin interfaceDisplayListener- Parameters:
evt- The details of theDisplaychange.
-
getConnectionID
public int getConnectionID(RemoteDisplay rmtDpy)
Return the ID associated with the specified RemoteDisplay.- Specified by:
getConnectionIDin interfaceDisplayMonitor- Returns:
- UNKNOWN_LISTENER_ID if not found; otherwise, returns the ID.
-
hasEventQueued
public boolean hasEventQueued(Control ctl)
Returns true if there is aMonitorEventfor the specifiedControlwaiting to be delivered to any listener.- Specified by:
hasEventQueuedin interfaceDisplayMonitor- Parameters:
ctl- TheControlbeing found.
-
hasEventQueued
public boolean hasEventQueued(int listenerID, Control ctl)Returns true if there is aMonitorEventfor the specifiedControlwaiting to be delivered to the listener with the specified id.- Specified by:
hasEventQueuedin interfaceDisplayMonitor- Parameters:
listenerID- The identifier for the listener.ctl- TheControlbeing found.
-
isEmpty
public boolean isEmpty()
- Specified by:
isEmptyin interfaceDisplayMonitor
-
mapChanged
public void mapChanged(ScalarMapEvent evt)
Handles ScalarMap data changes.
If theScalarMapEventis not ignored, aMapMonitorEventwill be sent to all listeners.- Specified by:
mapChangedin interfaceScalarMapListener- Parameters:
evt- The details of theScalarMapchange.
-
notifyListeners
public void notifyListeners(MonitorEvent evt)
Forwards theMonitorEventto all the listeners associated with thisDisplayMonitor.- Specified by:
notifyListenersin interfaceDisplayMonitor- Parameters:
evt- The event to forward.
-
receiveMessage
public void receiveMessage(MessageEvent msg)
Handles MessageEvent forwarding.- Specified by:
receiveMessagein interfaceMessageListener- Parameters:
msg- The message to forward.
-
removeListener
public void removeListener(MonitorCallback l)
Stops forwardingMonitorEvents to the specified listener.- Parameters:
l- Listener to remove.
-
setDisplaySync
public void setDisplaySync(DisplaySync sync)
Set the display synchronization object for this display- Specified by:
setDisplaySyncin interfaceDisplayMonitor
-
toString
public java.lang.String toString()
Returns the name of thisDisplayMonitor.- Overrides:
toStringin classjava.lang.Object
-
-
DMelt 3.0 © DataMelt by jWork.ORG