|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||
java.lang.Objectorg.gvsig.fmap.mapcontrol.tools.AreaListenerImpl
public class AreaListenerImpl
Listener for calculating the area of a polygon, defined in the associated MapControl
object.
If the view port of the associated MapControl isn't projected gets the area according the
geographical coordinates.
| Field Summary | |
|---|---|
protected MeasureEvent |
event
Information about all vertexes and GeneralPathXs of the polyline. |
protected MapControl |
mapCtrl
Reference to the MapControl object that uses. |
| Constructor Summary | |
|---|---|
AreaListenerImpl(MapControl mc)
Creates a new listener for calculating the area of a polygon. |
|
| Method Summary | |
|---|---|
boolean |
cancelDrawing()
Determines if the drawing process that this tool executes on the MapControl
instance could be canceled or not. |
java.awt.Image |
getImageCursor()
Gets the Cursor associated to this tool. |
static void |
main(java.lang.String[] args)
|
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. |
protected double |
returnArea(java.awt.geom.Point2D point)
Returns the area of the polygon, using returnCoordsArea
if the ViewPort of the associated MapControl is projected, or using
returnGeoCArea if isn't. |
double |
returnCoordsArea(java.lang.Double[] xs,
java.lang.Double[] ys,
java.awt.geom.Point2D point)
Returns the area of the polygon using point as initial, in real values with the current measure unit, according the projection in the ViewPort
of the MapControl. |
double |
returnGeoCArea(java.lang.Double[] xs,
java.lang.Double[] ys,
java.awt.geom.Point2D point)
Returns the area in geographical coordinates of the polygon, according the Haversine function. |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Field Detail |
|---|
protected MeasureEvent event
GeneralPathXs of the polyline.
protected MapControl mapCtrl
MapControl object that uses.
| Constructor Detail |
|---|
public AreaListenerImpl(MapControl mc)
Creates a new listener for calculating the area of a polygon.
mc - the MapControl where is calculated the area| Method Detail |
|---|
public boolean cancelDrawing()
ToolListenerDetermines if the drawing process that this tool executes on the MapControl
instance could be canceled or not.
cancelDrawing in interface ToolListenertrue if is cancellable; otherwise returns falsepublic java.awt.Image getImageCursor()
ToolListenerGets the Cursor associated to this tool.
getImageCursor in interface ToolListenerpublic static void main(java.lang.String[] args)
public void pointFixed(MeasureEvent event)
PolylineListenerCalled when user executes a mouse click and selects a vertex of the polyline.
pointFixed in interface PolylineListenerevent - information about the mouse event, and geometry data of the polylinepublic void points(MeasureEvent event)
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.
points in interface PolylineListenerevent - information about the mouse event, and geometry data of the polylinepublic void polylineFinished(MeasureEvent event)
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 MapControl object that
their area intersect with the polygonal area defined in the event, will be selected.
polylineFinished in interface PolylineListenerevent - information about the mouse event, and geometry data of the polylineprotected double returnArea(java.awt.geom.Point2D point)
Returns the area of the polygon, using returnCoordsArea
if the ViewPort of the associated MapControl is projected, or using
returnGeoCArea if isn't.
point - unused parameter
MapControl
isn't projected, in geographical coordinatesreturnCoordsArea(Double[], Double[], Point2D),
returnGeoCArea(Double[], Double[], Point2D)
public double returnCoordsArea(java.lang.Double[] xs,
java.lang.Double[] ys,
java.awt.geom.Point2D point)
Returns the area of the polygon using point as initial, in
real values with the current measure unit, according the projection in the ViewPort
of the MapControl.
xs - abscissa coordinate of all vertexes of the polygonys - ordinate coordinate of all vertexes of the polygonpoint - point 2D used as first vertex in the calculation of the area
public double returnGeoCArea(java.lang.Double[] xs,
java.lang.Double[] ys,
java.awt.geom.Point2D point)
Returns the area in geographical coordinates of the polygon, according the Haversine function.
Geo.sphericalPolyArea(double[], double[], int)
|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||