Class BaseMapTool
- All Implemented Interfaces:
ActionListener,EventListener,IBehavior,CircleListener,PanListener,PointListener,PolylineListener,RectangleListener,ToolListener,MapTool
-
Field Summary
FieldsModifier and TypeFieldDescriptionprotected IBehaviorprotected booleanprotected ToolListenerprotected intFields inherited from interface org.gvsig.fmap.mapcontrol.tools.MapTool
ACTION_AREA, ACTION_MEASURE, ACTION_PAN, ACTION_SELECTION, ACTION_ZOOM, EVENT_MEASURE, EVENT_MOVE, EVENT_POINT, EVENT_POINTDOUBLECLICKED, EVENT_POINTFIXED, EVENT_POINTS, EVENT_POLYLINEFINISHED, EVENT_RECTANGLE, TYPE_CIRCLE, TYPE_MOUSEDRAGGED, TYPE_MOUSEMOVENENT, TYPE_MOVE, TYPE_POINT, TYPE_POLYGON, TYPE_POLYLINE, TYPE_RECTANGLE, TYPE_UNKNOW -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionvoidactionPerformed(ActionEvent arg0) protected voidcallActionPerformed(Object event, int type, String actionCommand) booleanDetermines if the drawing process that this tool executes on theMapControlinstance could be canceled or not.voidcircle(MeasureEvent event) Called when user defines a circular area.Gets the mouse cursor of the tool listener associated to this behavior.Gets theToolListenerused by this behavior to perform actions on the associatedMapControlobject.Returns the reference to theMapControlobject that this behavior uses.getName()intgetType()voidvoidvoidvoidvoidvoidvoidvoidvoidCalled when user drags the mouse on the view.voidpaintComponent(MapControlDrawer renderer) Method executed in real-time, when user is working with a tool on the associatedMapControlobject, repainting theMapControl's image.voidpoint(PointEvent event) Called when one click is pressed on the associatedMapControl, or the location of the cursor of the mouse has changed on it.voidpointDoubleClick(PointEvent event) Called when a double click is pressed on the associatedMapControl.voidpointFixed(MeasureEvent event) Called when user executes a mouse click and selects a vertex of the polyline.voidpoints(MeasureEvent event) Called when user moves the mouse after selecting a vertex of the polyline.voidpolylineFinished(MeasureEvent event) Called when user executes a double click with the mouse, finishing the drawn of the polyline.voidrectangle(EnvelopeEvent event) Called when user executes a double click with the mouse, finishing the drawn of the rectangle.voidAssociates this behavior to aMapControlobject.protected voidvoidsetType(int type) Methods inherited from class org.gvsig.fmap.mapcontrol.tools.Listeners.AbstractCircleListener
circleFinished
-
Field Details
-
type
protected int type -
listener
-
behavior
-
isCancelDrawing
protected boolean isCancelDrawing
-
-
Constructor Details
-
BaseMapTool
public BaseMapTool(int type) -
BaseMapTool
-
-
Method Details
-
setName
-
getName
-
actionPerformed
- Specified by:
actionPerformedin interfaceActionListener
-
getImageCursor
Description copied from interface:IBehaviorGets the mouse cursor of the tool listener associated to this behavior.
- Specified by:
getImageCursorin interfaceIBehavior- Specified by:
getImageCursorin interfaceMapTool- Specified by:
getImageCursorin interfaceToolListener- Returns:
- the mouse cursor of the tool listener associated
-
cancelDrawing
public boolean cancelDrawing()Description copied from interface:ToolListenerDetermines if the drawing process that this tool executes on the
MapControlinstance could be canceled or not.- Specified by:
cancelDrawingin interfaceToolListener- Returns:
trueif is cancellable; otherwise returnsfalse
-
setType
public void setType(int type) -
getType
public int getType() -
getMapControl
Description copied from interface:IBehaviorReturns the reference to the
MapControlobject that this behavior uses.- Specified by:
getMapControlin interfaceIBehavior- Specified by:
getMapControlin interfaceMapTool- Returns:
- the
MapControlobject used this behavior - See Also:
-
setMapControl
Description copied from interface:IBehaviorAssociates this behavior to a
MapControlobject.- Specified by:
setMapControlin interfaceIBehavior- Parameters:
mc- theMapControlobject to associate- See Also:
-
getListener
Description copied from interface:IBehaviorGets the
ToolListenerused by this behavior to perform actions on the associatedMapControlobject.- Specified by:
getListenerin interfaceIBehavior- Returns:
- the
ToolListenerused by this behavior
-
callActionPerformed
-
rectangle
Description copied from interface:RectangleListenerCalled when user executes a double click with the mouse, finishing the drawn of the rectangle.
All features of the active and vector layers of the associated
MapControlobject that their area intersect with the polygonal area defined in the event, will be selected.- Specified by:
rectanglein interfaceRectangleListener- Parameters:
event- mouse event and information about the rectangle defined- Throws:
BehaviorException- will be thrown when fails the process of this tool
-
points
Description copied from interface:PolylineListenerCalled when user moves the mouse after selecting a vertex of the polyline.
Each kind of polyline listener calculates different information with the data of the
MeasureEvent, according its nature.- Specified by:
pointsin interfacePolylineListener- Parameters:
event- information about the mouse event, and geometry data of the polyline- Throws:
BehaviorException- will be thrown when fails the process of this tool
-
pointFixed
Description copied from interface:PolylineListenerCalled when user executes a mouse click and selects a vertex of the polyline.
- Specified by:
pointFixedin interfacePolylineListener- Parameters:
event- information about the mouse event, and geometry data of the polyline- Throws:
BehaviorException- will be thrown when fails the process of this tool
-
polylineFinished
Description copied from interface:PolylineListenerCalled when user executes a double click with the mouse, finishing the drawn of the polyline.
All features of the active and vector layers of the associated
MapControlobject that their area intersect with the polygonal area defined in the event, will be selected.- Specified by:
polylineFinishedin interfacePolylineListener- Parameters:
event- information about the mouse event, and geometry data of the polyline- Throws:
BehaviorException- will be thrown when fails the process of this tool
-
point
Description copied from interface:PointListenerCalled when one click is pressed on the associated
MapControl, or the location of the cursor of the mouse has changed on it.- Specified by:
pointin interfacePointListener- Parameters:
event- mouse event with the coordinates of the point selected on the associatedMapControl- Throws:
BehaviorException- will be thrown when fails the process of this tool
-
pointDoubleClick
Description copied from interface:PointListenerCalled when a double click is pressed on the associated
MapControl.- Specified by:
pointDoubleClickin interfacePointListener- Parameters:
event- mouse event and the coordinates of the point selected on the associatedMapControl- Throws:
BehaviorException- will be thrown when fails the process of this tool
-
move
Description copied from interface:PanListenerCalled when user drags the mouse on the view.
Updates the extent coordinates according to the direction of the movement between the initial and final points of line determined by the move of the mouse.
- Specified by:
movein interfacePanListener- Parameters:
event- mouse event information about the initial and final positions of the movement- Throws:
BehaviorException- will be thrown when fails the process of this tool
-
circle
Description copied from interface:CircleListenerCalled when user defines a circular area.
- Specified by:
circlein interfaceCircleListener- Parameters:
event- information about the mouse event, and geometry data related with the operation done- Throws:
BehaviorException- will be thrown when fails the process of this tool
-
paintComponent
Description copied from interface:IBehaviorMethod executed in real-time, when user is working with a tool on the associated
MapControlobject, repainting theMapControl'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:
paintComponentin interfaceIBehavior- See Also:
-
mouseClicked
- Specified by:
mouseClickedin interfaceIBehavior- Throws:
BehaviorException- any exception processing the action associated to a mouse clicked event, by theIBehaviorobject- See Also:
-
mouseEntered
- Specified by:
mouseEnteredin interfaceIBehavior- Throws:
BehaviorException- any exception processing the action associated to a mouse entered event, by theIBehaviorobject- See Also:
-
mouseExited
- Specified by:
mouseExitedin interfaceIBehavior- Throws:
BehaviorException- any exception processing the action associated to a mouse exited event, by theIBehaviorobject- See Also:
-
mousePressed
- Specified by:
mousePressedin interfaceIBehavior- Throws:
BehaviorException- any exception processing the action associated to a mouse pressed event, by theIBehaviorobject- See Also:
-
mouseReleased
- Specified by:
mouseReleasedin interfaceIBehavior- Throws:
BehaviorException- any exception processing the action associated to a mouse released event, by theIBehaviorobject- See Also:
-
mouseDragged
- Specified by:
mouseDraggedin interfaceIBehavior- Throws:
BehaviorException- any exception processing the action associated to a mouse dragged event, by theIBehaviorobject- See Also:
-
mouseMoved
- Specified by:
mouseMovedin interfaceIBehavior- Throws:
BehaviorException- any exception processing the action associated to a mouse moved event, by theIBehaviorobject- See Also:
-
mouseWheelMoved
- Specified by:
mouseWheelMovedin interfaceIBehavior- Throws:
BehaviorException- any exception processing the action associated to a mouse wheel event, by theIBehaviorobject- See Also:
-