public class MoveBehavior extends Behavior
Behavior that permits user to move the image of the associated
MapControl using a PanListener.
| Modifier and Type | Field and Description |
|---|---|
protected java.awt.geom.Point2D |
m_FirstPoint
First point of the path in image coordinates.
|
protected java.awt.geom.Point2D |
m_LastPoint
Last point of the path in image coordinates.
|
BUTTON_LEFT, BUTTON_MIDDLE, BUTTON_RIGHT, geomManager, LOG| Constructor and Description |
|---|
MoveBehavior(PanListener pli) |
MoveBehavior(PanListener pli,
int mouseButton)
Creates a new behavior for moving the mouse.
|
| Modifier and Type | Method and Description |
|---|---|
protected void |
doMouseReleased(java.awt.event.MouseEvent e) |
ToolListener |
getListener()
Gets the
ToolListener used by this behavior to perform actions on the
associated MapControl object. |
void |
mouseDragged(java.awt.event.MouseEvent e) |
void |
mousePressed(java.awt.event.MouseEvent e) |
void |
mouseReleased(java.awt.event.MouseEvent 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 |
setListener(ToolListener listener)
Sets a tool listener to work with the
MapControl using this
behavior. |
clean, createArc, createArc, createArc, createCircle, createEllipse, createPoint, createPoint, getImageCursor, getMapControl, getUseSnapping, isMyButton, isMyButton, mouseClicked, mouseEntered, mouseExited, mouseMoved, mouseWheelMoved, paintComponent, resetMyButton, setMapControl, setUseSnappingprotected java.awt.geom.Point2D m_FirstPoint
protected java.awt.geom.Point2D m_LastPoint
public MoveBehavior(PanListener pli, int mouseButton)
Creates a new behavior for moving the mouse.
pli - listener used to permit this object to work with the
associated MapControlmouseButton - public MoveBehavior(PanListener pli)
public void paintComponent(MapControlDrawer renderer)
IBehaviorMethod 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.
paintComponent in interface IBehaviorpaintComponent in class BehaviorGraphics.drawImage(java.awt.Image, int, int, java.awt.image.ImageObserver)public void mousePressed(java.awt.event.MouseEvent e)
mousePressed in interface IBehaviormousePressed in class BehaviorMouseListener.mousePressed(java.awt.event.MouseEvent)public void mouseReleased(java.awt.event.MouseEvent e)
throws BehaviorException
mouseReleased in interface IBehaviormouseReleased in class BehaviorBehaviorException - any exception processing the action associated to a mouse released event, by the IBehavior objectMouseListener.mouseReleased(java.awt.event.MouseEvent)protected void doMouseReleased(java.awt.event.MouseEvent e)
throws BehaviorException
BehaviorExceptionpublic void mouseDragged(java.awt.event.MouseEvent e)
mouseDragged in interface IBehaviormouseDragged in class BehaviorMouseMotionListener.mouseDragged(java.awt.event.MouseEvent)public void setListener(ToolListener listener)
Sets a tool listener to work with the MapControl using this
behavior.
listener - a PanListener object for this behaviorpublic ToolListener getListener()
IBehaviorGets the ToolListener used by this behavior to perform actions on the
associated MapControl object.
getListener in interface IBehaviorgetListener in class BehaviorToolListener used by this behavior