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.
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:
- a mouse button was pressed or released
and the location of the cursor at that time
- the Display has finished rendering some data
- a ScalarMap or DataReference has been added or removed
- the Display is being destroyed
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.
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.
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:
- the ScalarMap's range was changed by either the
Display's autoscaling logic or by a user action.
- the control associated with this ScalarMap was
added, replaced or destroyed.
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