org.gvsig.fmap.mapcontrol.tools.Behavior
Class PolygonBehavior

java.lang.Object
  extended by org.gvsig.fmap.mapcontrol.tools.Behavior.Behavior
      extended by org.gvsig.fmap.mapcontrol.tools.Behavior.PolylineBehavior
          extended by org.gvsig.fmap.mapcontrol.tools.Behavior.PolygonBehavior
All Implemented Interfaces:
IBehavior

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.

Author:
Vicente Caballero Navarro, Pablo Piqueras Bartolomé

Field Summary
 
Fields inherited from class org.gvsig.fmap.mapcontrol.tools.Behavior.PolylineBehavior
arrayX, arrayY, isClicked, listener
 
Fields inherited from class org.gvsig.fmap.mapcontrol.tools.Behavior.Behavior
geomManager
 
Constructor Summary
PolygonBehavior(PolylineListener ali)
          Creates a new behavior for drawing a polygon by its vertexes.
 
Method Summary
 void mouseDragged(java.awt.event.MouseEvent e)
           
 void mouseMoved(java.awt.event.MouseEvent e)
           
 void mousePressed(java.awt.event.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.
 
Methods inherited from class org.gvsig.fmap.mapcontrol.tools.Behavior.PolylineBehavior
addPoint, changeLastPoint, drawPolyLine, getListener, setListener
 
Methods inherited from class org.gvsig.fmap.mapcontrol.tools.Behavior.Behavior
createArc, createArc, createArc, createCircle, createLineString, createPoint, createPoint, getImageCursor, getMapControl, mouseClicked, mouseEntered, mouseExited, mouseReleased, mouseWheelMoved, setMapControl
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

PolygonBehavior

public PolygonBehavior(PolylineListener ali)

Creates a new behavior for drawing a polygon by its vertexes.

Parameters:
ali - tool listener used to permit this object to work with the associated MapControl
Method Detail

mouseDragged

public void mouseDragged(java.awt.event.MouseEvent e)
                  throws BehaviorException
Specified by:
mouseDragged in interface IBehavior
Overrides:
mouseDragged in class PolylineBehavior
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)

mouseMoved

public void mouseMoved(java.awt.event.MouseEvent e)
                throws BehaviorException
Specified by:
mouseMoved in interface IBehavior
Overrides:
mouseMoved in class PolylineBehavior
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

public void mousePressed(java.awt.event.MouseEvent e)
                  throws BehaviorException
Specified by:
mousePressed in interface IBehavior
Overrides:
mousePressed in class PolylineBehavior
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)

paintComponent

public void paintComponent(MapControlDrawer mapControlDrawer)
Description copied from interface: 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.

Specified by:
paintComponent in interface IBehavior
Overrides:
paintComponent in class PolylineBehavior
See Also:
Graphics.drawImage(java.awt.Image, int, int, java.awt.image.ImageObserver)


Copyright © 2014 gvSIG Association. All Rights Reserved.