public class DisplayMonitorImpl extends Object implements DisplayMonitor
Display
monitor
implementation.
DisplayMonitorImpl is not Serializable
and
should not be copied between JVMs.
UNKNOWN_LISTENER_ID
Constructor and Description |
---|
DisplayMonitorImpl(DisplayImpl dpy)
Creates a monitor for the specified
Display . |
Modifier and Type | Method and Description |
---|---|
void |
addListener(MonitorCallback listener,
int id)
Adds the specified listener to receive
MonitorEvents
when the monitored Display's state changes. |
void |
addListener(RemoteDisplay rmtDpy,
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 |
controlChanged(ControlEvent evt)
Handles
Control changes.If the ControlEvent is not ignored, a
ControlMonitorEvent will be sent to all listeners. |
void |
controlChanged(ScalarMapControlEvent evt)
Handles ScalarMap control changes.
This is just a stub which ignores the event. |
void |
destroy()
destroy this monitor
|
void |
displayChanged(DisplayEvent evt)
Handles notification of objects being added to or removed from
the
Display .If the DisplayEvent is not ignored, a
MapMonitorEvent or ReferenceMonitorEvent
will be sent to all listeners. |
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 |
mapChanged(ScalarMapEvent evt)
Handles ScalarMap data changes.
If the ScalarMapEvent is not ignored, a
MapMonitorEvent will be sent to all listeners. |
void |
notifyListeners(MonitorEvent evt)
Forwards the
MonitorEvent to all the listeners
associated with this DisplayMonitor . |
void |
receiveMessage(MessageEvent msg)
Handles MessageEvent forwarding.
|
void |
removeListener(MonitorCallback l)
Stops forwarding
MonitorEvent s to the specified listener. |
void |
setDisplaySync(DisplaySync sync)
Set the display synchronization object for this display
|
String |
toString()
Returns the name of this
DisplayMonitor . |
public DisplayMonitorImpl(DisplayImpl dpy)
Display
.dpy
- The Display
to monitor.public void addListener(MonitorCallback listener, int id) throws RemoteException, VisADException
MonitorEvents
when the monitored Display's
state changes.addListener
in interface DisplayMonitor
listener
- The listener to add.id
- The unique listener identifier.VisADException
- If the listener Vector
is uninitialized.RemoteException
- If there was an RMI-related problem.public void addListener(RemoteDisplay rmtDpy, int id) throws RemoteException, VisADException
MonitorEvents
when the monitored Display's
state changes.addListener
in interface DisplayMonitor
rmtDpy
- The remote display to add.id
- The unique listener identifier.VisADException
- If the listener Vector
is uninitialized.RemoteException
- If there was an RMI-related problem.public void addRemoteListener(RemoteDisplay rd) throws RemoteException, RemoteVisADException
MonitorEvents
will be
exchanged with the specified remote Display
.addRemoteListener
in interface DisplayMonitor
rd
- The remote Display
to synchronize.RemoteException
- If there was an RMI-related problem.RemoteVisADException
- If the inter-Display
links could not be made.public int checkID(int id)
checkID
in interface DisplayMonitor
id
- The identifier to check.public void controlChanged(ControlEvent evt)
Control
changes.ControlEvent
is not ignored, a
ControlMonitorEvent
will be sent to all listeners.controlChanged
in interface ControlListener
evt
- The details of the Control
change.public void controlChanged(ScalarMapControlEvent evt)
controlChanged
in interface ScalarMapListener
evt
- The details of the ScalarMap
change.public void destroy()
destroy
in interface DisplayMonitor
public void displayChanged(DisplayEvent evt)
Display
.DisplayEvent
is not ignored, a
MapMonitorEvent
or ReferenceMonitorEvent
will be sent to all listeners.displayChanged
in interface DisplayListener
evt
- The details of the Display
change.public int getConnectionID(RemoteDisplay rmtDpy)
getConnectionID
in interface DisplayMonitor
public boolean hasEventQueued(Control ctl)
MonitorEvent
for the specified Control
waiting to be delivered to
any listener.hasEventQueued
in interface DisplayMonitor
ctl
- The Control
being found.public boolean hasEventQueued(int listenerID, Control ctl)
MonitorEvent
for the specified Control
waiting to be delivered to the
listener with the specified id.hasEventQueued
in interface DisplayMonitor
listenerID
- The identifier for the listener.ctl
- The Control
being found.public boolean isEmpty()
isEmpty
in interface DisplayMonitor
public void mapChanged(ScalarMapEvent evt)
ScalarMapEvent
is not ignored, a
MapMonitorEvent
will be sent to all listeners.mapChanged
in interface ScalarMapListener
evt
- The details of the ScalarMap
change.public void notifyListeners(MonitorEvent evt)
MonitorEvent
to all the listeners
associated with this DisplayMonitor
.notifyListeners
in interface DisplayMonitor
evt
- The event to forward.public void receiveMessage(MessageEvent msg)
receiveMessage
in interface MessageListener
msg
- The message to forward.public void removeListener(MonitorCallback l)
MonitorEvent
s to the specified listener.l
- Listener to remove.public void setDisplaySync(DisplaySync sync)
setDisplaySync
in interface DisplayMonitor
public String toString()
DisplayMonitor
.Copyright © 1996–2023 The SSEC Visualization Project. All rights reserved.