org.gvsig.fmap.mapcontrol.tools
Class MeasureListenerImpl

java.lang.Object
  extended by org.gvsig.fmap.mapcontrol.tools.MeasureListenerImpl
All Implemented Interfaces:
PolylineListener, ToolListener

public class MeasureListenerImpl
extends Object
implements PolylineListener

Listener for calculating the length of the segments of a polyline, defined in the associated MapControl object.

Author:
Vicente Caballero Navarro

Field Summary
protected  MapControl mapCtrl
          Reference to the MapControl object that uses.
 
Constructor Summary
MeasureListenerImpl(MapControl mc)
          Creates a new listener for calculating the length of a polyline.
 
Method Summary
 boolean cancelDrawing()
          Determines if the drawing process that this tool executes on the MapControl instance could be canceled or not.
 Image getImageCursor()
          Gets the Cursor associated to this tool.
 void pointFixed(MeasureEvent event)
          Called when user executes a mouse click and selects a vertex of the polyline.
 void points(MeasureEvent event)
          Called when user moves the mouse after selecting a vertex of the polyline.
 void polylineFinished(MeasureEvent event)
          Called when user executes a double click with the mouse, finishing the drawn of the polyline.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

mapCtrl

protected MapControl mapCtrl
Reference to the MapControl object that uses.

Constructor Detail

MeasureListenerImpl

public MeasureListenerImpl(MapControl mc)

Creates a new listener for calculating the length of a polyline.

Parameters:
mc - the MapControl where is calculated the length
Method Detail

points

public void points(MeasureEvent event)
Description copied from interface: PolylineListener

Called 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:
points in interface PolylineListener
Parameters:
event - information about the mouse event, and geometry data of the polyline

getImageCursor

public Image getImageCursor()
Description copied from interface: ToolListener

Gets the Cursor associated to this tool.

Specified by:
getImageCursor in interface ToolListener
Returns:
component with the bitmap associated to this tool

pointFixed

public void pointFixed(MeasureEvent event)
Description copied from interface: PolylineListener

Called when user executes a mouse click and selects a vertex of the polyline.

Specified by:
pointFixed in interface PolylineListener
Parameters:
event - information about the mouse event, and geometry data of the polyline

cancelDrawing

public boolean cancelDrawing()
Description copied from interface: ToolListener

Determines if the drawing process that this tool executes on the MapControl instance could be canceled or not.

Specified by:
cancelDrawing in interface ToolListener
Returns:
true if is cancellable; otherwise returns false

polylineFinished

public void polylineFinished(MeasureEvent event)
Description copied from interface: PolylineListener

Called 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 MapControl object that their area intersect with the polygonal area defined in the event, will be selected.

Specified by:
polylineFinished in interface PolylineListener
Parameters:
event - information about the mouse event, and geometry data of the polyline


Copyright © 2004-2013 gvSIG. All Rights Reserved.