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, listenerBUTTON_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, setListenerclean, createArc, createArc, createArc, createCircle, createLineString, createPoint, createPoint, getImageCursor, getMapControl, isMyButton, isMyButton, mouseClicked, mouseEntered, mouseExited, mouseReleased, mouseWheelMoved, paintComponent, resetMyButton, setMapControlpublic 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 MapControlpublic 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 IBehaviorpaintComponent in class PolylineBehaviorGraphics.drawImage(java.awt.Image, int, int, java.awt.image.ImageObserver)public void mousePressed(MouseEvent e) throws BehaviorException
mousePressed in interface IBehaviormousePressed in class PolylineBehaviorBehaviorException - 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 IBehaviormouseMoved in class PolylineBehaviorBehaviorException - 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 IBehaviormouseDragged in class PolylineBehaviorBehaviorException - any exception processing the action associated to a mouse dragged event, by the IBehavior objectMouseMotionListener.mouseDragged(java.awt.event.MouseEvent)