org.gvsig.fmap.mapcontrol.tools.Behavior
Interface IBehavior

All Known Implementing Classes:
Behavior, CircleBehavior, CompoundBehavior, DraggerBehavior, MouseMovementBehavior, MouseWheelBehavior, MoveBehavior, PointBehavior, PolygonBehavior, PolylineBehavior, RectangleBehavior

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.


Method Summary
 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.
 

Method Detail

getImageCursor

java.awt.Image getImageCursor()

Gets the mouse cursor of the tool listener associated to this behavior.

Returns:
the mouse cursor of the tool listener associated

getListener

ToolListener getListener()

Gets the ToolListener used by this behavior to perform actions on the associated MapControl object.

Returns:
the ToolListener used by this behavior

getMapControl

MapControl getMapControl()

Returns the reference to the MapControl object that this behavior uses.

Returns:
the MapControl object used this behavior
See Also:
setMapControl(MapControl)

mouseClicked

void mouseClicked(java.awt.event.MouseEvent e)
                  throws BehaviorException
Throws:
BehaviorException - any exception processing the action associated to a mouse clicked event, by the IBehavior object
See Also:
MouseListener.mouseClicked(java.awt.event.MouseEvent)

mouseDragged

void mouseDragged(java.awt.event.MouseEvent e)
                  throws BehaviorException
Throws:
BehaviorException - any exception processing the action associated to a mouse dragged event, by the IBehavior object
See Also:
MouseMotionListener.mouseDragged(java.awt.event.MouseEvent)

mouseEntered

void mouseEntered(java.awt.event.MouseEvent e)
                  throws BehaviorException
Throws:
BehaviorException - any exception processing the action associated to a mouse entered event, by the IBehavior object
See Also:
MouseListener.mouseEntered(java.awt.event.MouseEvent)

mouseExited

void mouseExited(java.awt.event.MouseEvent e)
                 throws BehaviorException
Throws:
BehaviorException - any exception processing the action associated to a mouse exited event, by the IBehavior object
See Also:
MouseListener.mouseExited(java.awt.event.MouseEvent)

mouseMoved

void mouseMoved(java.awt.event.MouseEvent e)
                throws BehaviorException
Throws:
BehaviorException - any exception processing the action associated to a mouse moved event, by the IBehavior object
See Also:
MouseMotionListener.mouseMoved(java.awt.event.MouseEvent)

mousePressed

void mousePressed(java.awt.event.MouseEvent e)
                  throws BehaviorException
Throws:
BehaviorException - any exception processing the action associated to a mouse pressed event, by the IBehavior object
See Also:
MouseListener.mousePressed(java.awt.event.MouseEvent)

mouseReleased

void mouseReleased(java.awt.event.MouseEvent e)
                   throws BehaviorException
Throws:
BehaviorException - any exception processing the action associated to a mouse released event, by the IBehavior object
See Also:
MouseListener.mouseReleased(java.awt.event.MouseEvent)

mouseWheelMoved

void mouseWheelMoved(java.awt.event.MouseWheelEvent e)
                     throws BehaviorException
Throws:
BehaviorException - any exception processing the action associated to a mouse wheel event, by the IBehavior object
See Also:
MouseWheelListener.mouseWheelMoved(java.awt.event.MouseWheelEvent)

paintComponent

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.

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:
Graphics.drawImage(java.awt.Image, int, int, java.awt.image.ImageObserver)

setMapControl

void setMapControl(MapControl mc)

Associates this behavior to a MapControl object.

Parameters:
mc - the MapControl object to associate
See Also:
getMapControl()


Copyright © 2014 gvSIG Association. All Rights Reserved.