public class PolygonBehavior extends PolylineBehavior
Behavior that permits user to draw a polygon by its vertexes on the image of the associated
MapControl
using a PolylineListener
.
arrayX, arrayY, isClicked, listener
BUTTON_LEFT, BUTTON_MIDDLE, BUTTON_RIGHT, geomManager
Constructor and Description |
---|
PolygonBehavior(PolylineListener ali)
Creates a new behavior for drawing a polygon by its vertexes.
|
Modifier and Type | Method and Description |
---|---|
void |
mouseDragged(MouseEvent e) |
void |
mouseMoved(MouseEvent e) |
void |
mousePressed(MouseEvent 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. |
addPoint, changeLastPoint, drawPolyLine, getListener, setListener
clean, createArc, createArc, createArc, createCircle, createLineString, createPoint, createPoint, getImageCursor, getMapControl, isMyButton, isMyButton, mouseClicked, mouseEntered, mouseExited, mouseReleased, mouseWheelMoved, paintComponent, resetMyButton, setMapControl
public PolygonBehavior(PolylineListener ali)
Creates a new behavior for drawing a polygon by its vertexes.
ali
- tool listener used to permit this object to work with the associated MapControl
public void paintComponent(MapControlDrawer mapControlDrawer)
IBehavior
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.
paintComponent
in interface IBehavior
paintComponent
in class PolylineBehavior
Graphics.drawImage(java.awt.Image, int, int, java.awt.image.ImageObserver)
public void mousePressed(MouseEvent e) throws BehaviorException
mousePressed
in interface IBehavior
mousePressed
in class PolylineBehavior
BehaviorException
- any exception processing the action associated to a mouse pressed event, by the IBehavior
objectMouseListener.mousePressed(java.awt.event.MouseEvent)
public void mouseMoved(MouseEvent e) throws BehaviorException
mouseMoved
in interface IBehavior
mouseMoved
in class PolylineBehavior
BehaviorException
- any exception processing the action associated to a mouse moved event, by the IBehavior
objectMouseMotionListener.mouseMoved(java.awt.event.MouseEvent)
public void mouseDragged(MouseEvent e) throws BehaviorException
mouseDragged
in interface IBehavior
mouseDragged
in class PolylineBehavior
BehaviorException
- any exception processing the action associated to a mouse dragged event, by the IBehavior
objectMouseMotionListener.mouseDragged(java.awt.event.MouseEvent)