VisADEvents

ControlEvent

Controls are used as a kind of externally visible snapshot of internal state. All Displays provide a GraphicsModeControl, a ProjectionControl, and a RendererControl as well as other display-dependent Controls, and many ScalarMaps provide an appropriate Control. There are methods like getControl() and getControls() to fetch Controls from the Display or ScalarMap.

ControlEvents are sent by Controls to all registered listeners whenever the control changes in some significant way. An object implements the ControlListener interface, which consists of only a controlChanged(ControlEvent) method, then registers to receive ControlEvents using the Control's addControlListener(ControlListener) method. When the control is changed, it passes a ControlEvent to every listener. Each listener can retrieve the Control from the ControlEvent and query it to determine exactly what changed.

DisplayEvent

DisplayEvents are sent by either the Display or its associated MouseBehavior to listeners who have implemented the displayChanged(DisplayEvent) method and have registered themselves using the Display's addDisplayListener(DisplayListener) method .

Each DisplayEvent contains the originating Display object along with the x and y position associated with this event and, most significantly, the event type. There are many different types of DisplayEvents, indicating that:

DisplayMapEvent

This is an extension of DisplayEvent used for MAP_ADDED events, when a new ScalarMap or ConstantMap is added to the Display. It has a getMap() method which can be used to fetch the ScalarMap associated with this event.

DisplayReferenceEvent

This is an extension of DisplayEvent used for REFERENCE_ADDED events, when a new DataReference is added to the Display. It has a getDataDisplayLink() method which can be used to fetch the DataDisplayLink associated with the DataReference which triggered this event.

ScalarMapEvent

ScalarMapEvents are sent by a ScalarMap to listeners who have implemented the mapChanged(ScalarMapEvent) method and have registered themselves using the addScalarMapListener(ScalarMapListener) method.
Each ScalarMapEvent contains the ScalarMap object from which it came along with the event type, indicating that:

ScalarMapControlEvent

This is an extension of ScalarMapEvent used for CONTROL_ADDED, CONTROL_REPLACED, and CONTROL_REMOVED events. It has a getControl() method which can be used to fetch the Control associated with this event.
Last modified: Tue Feb 12 11:32:17 CST 2002