visad.collab
Interface DisplayMonitor

All Superinterfaces:
ControlListener, DisplayListener, EventListener, MessageListener, ScalarMapListener, Serializable
All Known Subinterfaces:
RemoteDisplayMonitor
All Known Implementing Classes:
DisplayMonitorImpl, RemoteDisplayMonitorImpl

public interface DisplayMonitor
extends ControlListener, DisplayListener, MessageListener, ScalarMapListener, Serializable

DisplayMonitor is the interface for objects which monitor the state of Controls, Displays and ScalarMaps.


Field Summary
static int UNKNOWN_LISTENER_ID
          Connection ID used to indicate errors
 
Method Summary
 void addListener(MonitorCallback callback, int id)
          Adds the specified listener to receive MonitorEvents when the monitored Display's state changes.
 void addListener(RemoteDisplay rd, int id)
          Adds the specified remote display to receive MonitorEvents when the monitored Display's state changes.
 void addRemoteListener(RemoteDisplay rd)
          Initializes links so that MonitorEvents will be exchanged with the specified remote Display.
 int checkID(int id)
          Returns a suggestion for a unique listener identifier which is equal to or greater than the supplied ID.
 void destroy()
          destroy this monitor
 int getConnectionID(RemoteDisplay rmtDpy)
          Return the ID associated with the specified RemoteDisplay.
 boolean hasEventQueued(Control ctl)
          Returns true if there is a MonitorEvent for the specified Control waiting to be delivered to any listener.
 boolean hasEventQueued(int listenerID, Control ctl)
          Returns true if there is a MonitorEvent for the specified Control waiting to be delivered to the listener with the specified id.
 boolean isEmpty()
           
 void notifyListeners(MonitorEvent evt)
          Forwards the MonitorEvent to all the listeners associated with this DisplayMonitor.
 void setDisplaySync(DisplaySync sync)
          Set the display synchronization object for this display
 
Methods inherited from interface visad.ControlListener
controlChanged
 
Methods inherited from interface visad.DisplayListener
displayChanged
 
Methods inherited from interface visad.MessageListener
receiveMessage
 
Methods inherited from interface visad.ScalarMapListener
controlChanged, mapChanged
 

Field Detail

UNKNOWN_LISTENER_ID

static final int UNKNOWN_LISTENER_ID
Connection ID used to indicate errors

See Also:
Constant Field Values
Method Detail

addListener

void addListener(MonitorCallback callback,
                 int id)
                 throws RemoteException,
                        VisADException
Adds the specified listener to receive MonitorEvents when the monitored Display's state changes.

Parameters:
callback - The object to which events are delivered.
id - The unique identifier.
Throws:
RemoteException - If there was an RMI-related problem.
VisADException - If the listener Vector is uninitialized.

addListener

void addListener(RemoteDisplay rd,
                 int id)
                 throws RemoteException,
                        VisADException
Adds the specified remote display to receive MonitorEvents when the monitored Display's state changes.

Parameters:
rd - The remote display to add.
id - The unique listener identifier.
Throws:
RemoteException - If there was an RMI-related problem.
VisADException - If the listener Vector is uninitialized.

addRemoteListener

void addRemoteListener(RemoteDisplay rd)
                       throws RemoteException,
                              RemoteVisADException
Initializes links so that MonitorEvents will be exchanged with the specified remote Display.

Parameters:
rd - The remote Display to synchronize.
Throws:
RemoteException - If there was an RMI-related problem.
RemoteVisADException - If the inter-Display links could not be made.

checkID

int checkID(int id)
            throws RemoteException
Returns a suggestion for a unique listener identifier which is equal to or greater than the supplied ID.

Parameters:
id - The identifier to check.
Throws:
RemoteException - If there was an RMI-related problem.

destroy

void destroy()
             throws RemoteException,
                    RemoteVisADException
destroy this monitor

Throws:
RemoteException
RemoteVisADException

getConnectionID

int getConnectionID(RemoteDisplay rmtDpy)
                    throws RemoteException
Return the ID associated with the specified RemoteDisplay.

Returns:
UNKNOWN_LISTENER_ID if not found; otherwise, returns the ID.
Throws:
RemoteException

hasEventQueued

boolean hasEventQueued(Control ctl)
                       throws RemoteException
Returns true if there is a MonitorEvent for the specified Control waiting to be delivered to any listener.

Parameters:
ctl - The Control being found.
Throws:
RemoteException - If there was an RMI-related problem.

hasEventQueued

boolean hasEventQueued(int listenerID,
                       Control ctl)
                       throws RemoteException
Returns true if there is a MonitorEvent for the specified Control waiting to be delivered to the listener with the specified id.

Parameters:
listenerID - The identifier for the listener.
ctl - The Control being found.
Throws:
RemoteException - If there was an RMI-related problem.

isEmpty

boolean isEmpty()
                throws RemoteException
Throws:
RemoteException

notifyListeners

void notifyListeners(MonitorEvent evt)
                     throws RemoteException,
                            RemoteVisADException
Forwards the MonitorEvent to all the listeners associated with this DisplayMonitor.

Parameters:
evt - The event to forward.
Throws:
RemoteException - If there was an RMI-related problem.
RemoteVisADException - If there is an internal error.

setDisplaySync

void setDisplaySync(DisplaySync sync)
                    throws RemoteException
Set the display synchronization object for this display

Throws:
RemoteException