Package diva.canvas.event

Event-handling support for the Diva canvas.

See:
          Description

Interface Summary
EventAcceptor An event acceptor is a canvas component object that is prepared to accept an AWT event, and then possibly process and consume it.
LayerListener The interface for listeners that respond to mouse clicks and drags.
LayerMotionListener The interface for listeners that respond to motion of the mouse over a figure.
 

Class Summary
EventLayer An event layer is a canvas layer that accepts mouse events.
ExtendedMouseFilter A class that accepts mouse events.
LayerAdapter An adapter for layer listeners.
LayerConsumer An adapter for layer listeners that consumes events.
LayerEvent The class representing mouse events in layers.
LayerEventMulticaster A subclass of the AWT event multi-caster, which adds support for layer events.
LayerMotionAdapter An adapter for layer motion listeners.
LayerMouseAdapter An object which wraps a mouse listener and makes it compatible with the Diva canvas, sending it mouse events in the local coordinate system.
MouseFilter A class that accepts mouse events.
 

Package diva.canvas.event Description

Event-handling support for the Diva canvas. Because the canvas pane and layers in Diva implement an independent, floating-point, coordinate system, this package has to re-implement some of the basic AWT support for mouse events. A new event type, LayerEvent, which subclasses java.awt.event.MouseEvent, represents on layers and on graphical figures. It contains both the original screen coordinates of the mouse event and those coordinates translated unto the coordinate system of the containing canvas pane.

Corresponding to the layer event class are two new listener classes, LayerListener and LayerMotionListener. The former handles mouse press, drag, and release events, and the latter mouse enter, motion, and leave events. This separation avoid needless inefficiency in interactive canvases. Events can be received from Figure objects, and from the special-purpose EventLayer, which dispatches any events it received to its listeners.

An additional class, EventDispatcher is used to dispatch events to attached listeners. This class is used by the top-level package to group figures into common event-handling classes.