Interface IBehavior
- All Known Implementing Classes:
BaseMapTool,Behavior,CircleBehavior,CompoundBehavior,DraggerBehavior,EllipseBehavior,FreehandBehavior,MouseMovementBehavior,MouseWheelBehavior,MoveBehavior,MoveWithMiddleButtonBehavior,PointBehavior,PolygonBehavior,PolylineBehavior,RectangleBehavior,TwoLinesBehavior
When a programmer needs to add a way to permit user to interact with the current object where the graphical
information is stored and represented, (see MapControl), must analyze and decide the basic
behavior nature of the interaction.
That behavior will manage mouse events and generate information and tool events that the
associated ToolListener will use to interact with the MapControl object ultimately.
It will be possible also combine more than one behavior for a tool listener, for having a richness tool.
-
Method Summary
Modifier and TypeMethodDescriptionGets the mouse cursor of the tool listener associated to this behavior.Gets theToolListenerused by this behavior to perform actions on the associatedMapControlobject.Returns the reference to theMapControlobject that this behavior uses.voidvoidvoidvoidvoidvoidvoidvoidvoidpaintComponent(MapControlDrawer renderer) Method executed in real-time, when user is working with a tool on the associatedMapControlobject, repainting theMapControl's image.voidAssociates this behavior to aMapControlobject.
-
Method Details
-
getListener
ToolListener getListener()Gets the
ToolListenerused by this behavior to perform actions on the associatedMapControlobject.- Returns:
- the
ToolListenerused by this behavior
-
paintComponent
Method executed in real-time, when user is working with a tool on the associated
MapControlobject, repainting theMapControl's image.Returns immediately in all cases, even if the complete image has not yet been loaded.
This method will be implemented according to the specific nature of each behavior, and its extra and particular features.
- See Also:
-
setMapControl
Associates this behavior to a
MapControlobject.- Parameters:
mc- theMapControlobject to associate- See Also:
-
getImageCursor
Image getImageCursor()Gets the mouse cursor of the tool listener associated to this behavior.
- Returns:
- the mouse cursor of the tool listener associated
-
getMapControl
MapControl getMapControl()Returns the reference to the
MapControlobject that this behavior uses.- Returns:
- the
MapControlobject used this behavior - See Also:
-
mouseClicked
- Throws:
BehaviorException- any exception processing the action associated to a mouse clicked event, by theIBehaviorobject- See Also:
-
mouseEntered
- Throws:
BehaviorException- any exception processing the action associated to a mouse entered event, by theIBehaviorobject- See Also:
-
mouseExited
- Throws:
BehaviorException- any exception processing the action associated to a mouse exited event, by theIBehaviorobject- See Also:
-
mousePressed
- Throws:
BehaviorException- any exception processing the action associated to a mouse pressed event, by theIBehaviorobject- See Also:
-
mouseReleased
- Throws:
BehaviorException- any exception processing the action associated to a mouse released event, by theIBehaviorobject- See Also:
-
mouseDragged
- Throws:
BehaviorException- any exception processing the action associated to a mouse dragged event, by theIBehaviorobject- See Also:
-
mouseMoved
- Throws:
BehaviorException- any exception processing the action associated to a mouse moved event, by theIBehaviorobject- See Also:
-
mouseWheelMoved
- Throws:
BehaviorException- any exception processing the action associated to a mouse wheel event, by theIBehaviorobject- See Also:
-