public interface IBehavior
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.
| Modifier and Type | Method and Description |
|---|---|
java.awt.Image |
getImageCursor()
Gets the mouse cursor of the tool listener associated to this behavior.
|
ToolListener |
getListener()
Gets the
ToolListener used by this behavior to perform actions on the
associated MapControl object. |
MapControl |
getMapControl()
Returns the reference to the
MapControl object that this behavior uses. |
void |
mouseClicked(java.awt.event.MouseEvent e) |
void |
mouseDragged(java.awt.event.MouseEvent e) |
void |
mouseEntered(java.awt.event.MouseEvent e) |
void |
mouseExited(java.awt.event.MouseEvent e) |
void |
mouseMoved(java.awt.event.MouseEvent e) |
void |
mousePressed(java.awt.event.MouseEvent e) |
void |
mouseReleased(java.awt.event.MouseEvent e) |
void |
mouseWheelMoved(java.awt.event.MouseWheelEvent e) |
void |
paintComponent(MapControlDrawer renderer)
Method executed in real-time, when user is working with a tool on the associated
MapControl
object, repainting the MapControl's image. |
void |
setMapControl(MapControl mc)
Associates this behavior to a
MapControl object. |
ToolListener getListener()
Gets the ToolListener used by this behavior to perform actions on the
associated MapControl object.
ToolListener used by this behaviorvoid paintComponent(MapControlDrawer renderer)
Method executed in real-time, when user is working with a tool on the associated MapControl
object, repainting the MapControl'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.
Graphics.drawImage(java.awt.Image, int, int, java.awt.image.ImageObserver)void setMapControl(MapControl mc)
Associates this behavior to a MapControl object.
mc - the MapControl object to associategetMapControl()java.awt.Image getImageCursor()
Gets the mouse cursor of the tool listener associated to this behavior.
MapControl getMapControl()
Returns the reference to the MapControl object that this behavior uses.
MapControl object used this behaviorsetMapControl(MapControl)void mouseClicked(java.awt.event.MouseEvent e)
throws BehaviorException
BehaviorException - any exception processing the action associated to a mouse clicked event, by the IBehavior objectMouseListener.mouseClicked(java.awt.event.MouseEvent)void mouseEntered(java.awt.event.MouseEvent e)
throws BehaviorException
BehaviorException - any exception processing the action associated to a mouse entered event, by the IBehavior objectMouseListener.mouseEntered(java.awt.event.MouseEvent)void mouseExited(java.awt.event.MouseEvent e)
throws BehaviorException
BehaviorException - any exception processing the action associated to a mouse exited event, by the IBehavior objectMouseListener.mouseExited(java.awt.event.MouseEvent)void mousePressed(java.awt.event.MouseEvent e)
throws BehaviorException
BehaviorException - any exception processing the action associated to a mouse pressed event, by the IBehavior objectMouseListener.mousePressed(java.awt.event.MouseEvent)void mouseReleased(java.awt.event.MouseEvent e)
throws BehaviorException
BehaviorException - any exception processing the action associated to a mouse released event, by the IBehavior objectMouseListener.mouseReleased(java.awt.event.MouseEvent)void mouseDragged(java.awt.event.MouseEvent e)
throws BehaviorException
BehaviorException - any exception processing the action associated to a mouse dragged event, by the IBehavior objectMouseMotionListener.mouseDragged(java.awt.event.MouseEvent)void mouseMoved(java.awt.event.MouseEvent e)
throws BehaviorException
BehaviorException - any exception processing the action associated to a mouse moved event, by the IBehavior objectMouseMotionListener.mouseMoved(java.awt.event.MouseEvent)void mouseWheelMoved(java.awt.event.MouseWheelEvent e)
throws BehaviorException
BehaviorException - any exception processing the action associated to a mouse wheel event, by the IBehavior objectMouseWheelListener.mouseWheelMoved(java.awt.event.MouseWheelEvent)