An extension interface allowing an EventBehaviour to Lock the tool handler.
Certain types of events need to be able to "lock" the tool handler
so that it is the only event getting events until it "unlocks" the tool handler.
Example:
The Polygon tool has a BoxSelection behaviour that accepts drag events and draws a
rectangle until the mouse is released (at that point it selects the vertices that are with
the box).
The Polygon tool also has a move geometry behaviour that moves the geometry when the mouse
is dragged over an
EditGeom .
Given these two behaviours the following case can occur: The mouse is pressed (not over a
geometry) and the BoxSelection behaviour starts drawing the selection box. The mouse drags
over a Geometry and the MoveGeometry behaviour starts as well.
One solution is to put both behaviours in a
net.refractions.udig.tools.edit.MutualExclusiveEventBehavior so that if the BoxSelection
behaviour is running then the MoveGeometryBehaviour won't. However if the MoveGeometryBehaviour
starts then the BoxSelection behaviour may as well.
author: jones since: 1.1.0 |