public abstract class Behavior extends java.lang.Object implements IBehavior
When user is working with a tool on a MapControl instance,
Behavior defines the basic ways of interacting: selecting a
point, a circle, a rectangle, or ...
All events generated will be MouseEvent, and will depend on the
nature of the behavior, like the kind of tool for applying the
changes.
Behavior defines the common and basic functionality for all
kinds of interacting ways with the MapControl object.
IBehavior| Modifier and Type | Field and Description |
|---|---|
static int |
BUTTON_LEFT |
static int |
BUTTON_MIDDLE |
static int |
BUTTON_RIGHT |
protected org.gvsig.fmap.geom.GeometryManager |
geomManager |
protected static org.slf4j.Logger |
LOG |
protected static org.slf4j.Logger |
LOGGER |
| Modifier and Type | Method and Description |
|---|---|
void |
clean(MapControlDrawer mapControlDrawer) |
protected org.gvsig.fmap.geom.primitive.Arc |
createArc(double centerX,
double centerY,
double radious,
double angleStart,
double angleExtent)
Create an arc.
|
protected org.gvsig.fmap.geom.primitive.Arc |
createArc(java.awt.geom.Point2D p1,
java.awt.geom.Point2D p2,
java.awt.geom.Point2D p3)
Create an Arc.
|
protected org.gvsig.fmap.geom.primitive.Arc |
createArc(org.gvsig.fmap.geom.primitive.Point p1,
org.gvsig.fmap.geom.primitive.Point p2,
org.gvsig.fmap.geom.primitive.Point p3)
Create an arc.
|
protected org.gvsig.fmap.geom.primitive.Circle |
createCircle(double centerX,
double centerY,
double radious)
Create an circle.
|
protected org.gvsig.fmap.geom.primitive.Ellipse |
createEllipse(java.awt.geom.Point2D p1,
java.awt.geom.Point2D p2,
java.awt.geom.Point2D p3) |
protected org.gvsig.fmap.geom.primitive.Point |
createPoint(double x,
double y)
Create point.
|
protected org.gvsig.fmap.geom.primitive.Point |
createPoint(java.awt.geom.Point2D p1)
Create a curve point.
|
java.awt.Image |
getImageCursor()
Gets the mouse cursor of the tool listener associated to this behavior.
|
abstract 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. |
boolean |
getUseSnapping() |
boolean |
isMyButton() |
boolean |
isMyButton(java.awt.event.MouseEvent e) |
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 mapControlDrawer)
Method executed in real-time, when user is working with a tool on the associated
MapControl
object, repainting the MapControl's image. |
void |
paintComponent(MapControlDrawer mapControlDrawer,
boolean clean) |
void |
resetMyButton() |
void |
setMapControl(MapControl mc)
Associates this behavior to a
MapControl object. |
void |
setUseSnapping(boolean useSnapping) |
public static final int BUTTON_LEFT
public static final int BUTTON_MIDDLE
public static final int BUTTON_RIGHT
protected org.gvsig.fmap.geom.GeometryManager geomManager
protected static final org.slf4j.Logger LOG
protected static final org.slf4j.Logger LOGGER
public void clean(MapControlDrawer mapControlDrawer)
protected org.gvsig.fmap.geom.primitive.Arc createArc(double centerX,
double centerY,
double radious,
double angleStart,
double angleExtent)
null and add the error
to the logcenterX - centerY - radious - angleStart - angleExtent - protected org.gvsig.fmap.geom.primitive.Arc createArc(java.awt.geom.Point2D p1,
java.awt.geom.Point2D p2,
java.awt.geom.Point2D p3)
null and add the error
to the logp1 - p2 - p3 - protected org.gvsig.fmap.geom.primitive.Arc createArc(org.gvsig.fmap.geom.primitive.Point p1,
org.gvsig.fmap.geom.primitive.Point p2,
org.gvsig.fmap.geom.primitive.Point p3)
null and add the error
to the logp1 - p2 - p3 - protected org.gvsig.fmap.geom.primitive.Circle createCircle(double centerX,
double centerY,
double radious)
null and add the error
to the logcenterX - centerY - radious - protected org.gvsig.fmap.geom.primitive.Ellipse createEllipse(java.awt.geom.Point2D p1,
java.awt.geom.Point2D p2,
java.awt.geom.Point2D p3)
protected org.gvsig.fmap.geom.primitive.Point createPoint(double x,
double y)
null and add the error
to the logx - The X coordinatey - The y coordinateprotected org.gvsig.fmap.geom.primitive.Point createPoint(java.awt.geom.Point2D p1)
null and add the error
to the logp1 - The AWT pointpublic java.awt.Image getImageCursor()
IBehaviorGets the mouse cursor of the tool listener associated to this behavior.
getImageCursor in interface IBehaviorpublic abstract ToolListener getListener()
IBehaviorGets the ToolListener used by this behavior to perform actions on the
associated MapControl object.
getListener in interface IBehaviorToolListener used by this behaviorpublic MapControl getMapControl()
IBehaviorReturns the reference to the MapControl object that this behavior uses.
getMapControl in interface IBehaviorMapControl object used this behaviorIBehavior.setMapControl(MapControl)public boolean getUseSnapping()
public boolean isMyButton()
public boolean isMyButton(java.awt.event.MouseEvent e)
public void mouseClicked(java.awt.event.MouseEvent e)
throws BehaviorException
mouseClicked in interface IBehaviorBehaviorException - any exception processing the action associated to a mouse clicked event, by the IBehavior objectMouseListener.mouseClicked(java.awt.event.MouseEvent)public void mouseDragged(java.awt.event.MouseEvent e)
throws BehaviorException
mouseDragged in interface IBehaviorBehaviorException - any exception processing the action associated to a mouse dragged event, by the IBehavior objectMouseMotionListener.mouseDragged(java.awt.event.MouseEvent)public void mouseEntered(java.awt.event.MouseEvent e)
throws BehaviorException
mouseEntered in interface IBehaviorBehaviorException - any exception processing the action associated to a mouse entered event, by the IBehavior objectMouseListener.mouseEntered(java.awt.event.MouseEvent)public void mouseExited(java.awt.event.MouseEvent e)
throws BehaviorException
mouseExited in interface IBehaviorBehaviorException - any exception processing the action associated to a mouse exited event, by the IBehavior objectMouseListener.mouseExited(java.awt.event.MouseEvent)public void mouseMoved(java.awt.event.MouseEvent e)
throws BehaviorException
mouseMoved in interface IBehaviorBehaviorException - any exception processing the action associated to a mouse moved event, by the IBehavior objectMouseMotionListener.mouseMoved(java.awt.event.MouseEvent)public void mousePressed(java.awt.event.MouseEvent e)
throws BehaviorException
mousePressed in interface IBehaviorBehaviorException - any exception processing the action associated to a mouse pressed event, by the IBehavior objectMouseListener.mousePressed(java.awt.event.MouseEvent)public void mouseReleased(java.awt.event.MouseEvent e)
throws BehaviorException
mouseReleased in interface IBehaviorBehaviorException - any exception processing the action associated to a mouse released event, by the IBehavior objectMouseListener.mouseReleased(java.awt.event.MouseEvent)public void mouseWheelMoved(java.awt.event.MouseWheelEvent e)
throws BehaviorException
mouseWheelMoved in interface IBehaviorBehaviorException - any exception processing the action associated to a mouse wheel event, by the IBehavior objectMouseWheelListener.mouseWheelMoved(java.awt.event.MouseWheelEvent)public void paintComponent(MapControlDrawer mapControlDrawer)
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 IBehaviorGraphics.drawImage(java.awt.Image, int, int, java.awt.image.ImageObserver)public void paintComponent(MapControlDrawer mapControlDrawer, boolean clean)
public void resetMyButton()
public void setMapControl(MapControl mc)
IBehaviorAssociates this behavior to a MapControl object.
setMapControl in interface IBehaviormc - the MapControl object to associateIBehavior.getMapControl()public void setUseSnapping(boolean useSnapping)
Copyright © 2026 gvSIG Association. All rights reserved.