public class StatusBarListener
extends java.lang.Object
implements org.gvsig.fmap.mapcontrol.tools.Listeners.PointListener
Listener that displays at the status bar of the application's main frame, the value of the point coordinates of the mouse's
cursor on the associated MapControl, just as is received a PointEvent event.
Calculates the coordinates equivalent to the point according this rules:
formatDegrees(p.get{X or Y}() if the associated MapControl object isn't projected.formatDegrees({MapControl's projection}.toGeo(p.get{X or Y}()) if the associated
MapControl object is projected and its ViewPort's distance units are in degrees.{NumberFormat according to #setFractionDigits(Point2D)}.format((p.get{X or Y}()/MapContext.CHANGEM[mapControl.getViewPort().getDistanceUnits()])*MapContext.CHANGEM[mapControl.getViewPort().getMapUnits()])
otherwise.The prefix of the coordinate expressions will be:
MapControl's view port is in degrees.And the sufix value:
MapControl's view port is in degrees(expected latitude or longitude), according this pattern:S?GÂș M' S'', having:| Constructor and Description |
|---|
StatusBarListener(org.gvsig.fmap.mapcontrol.MapControl mc)
Creates a new
StatusBarListener object. |
| Modifier and Type | Method and Description |
|---|---|
boolean |
cancelDrawing() |
java.lang.String[] |
getCoords(java.awt.geom.Point2D p)
Returns the coordinates equivalent to
p:
Uses formatDegrees(p.get{X or Y}() if the associated MapControl object isn't projected.
Uses formatDegrees({MapControl's projection}.toGeo(p.get{X or Y}()) if the associated
MapControl object is projected and its ViewPort's distance units are in degrees.
Uses {NumberFormat according to
otherwise.
|
java.awt.Image |
getImageCursor() |
void |
point(org.gvsig.fmap.mapcontrol.tools.Events.PointEvent event) |
void |
pointDoubleClick(org.gvsig.fmap.mapcontrol.tools.Events.PointEvent event) |
java.lang.String[] |
setCoorDisplayText(java.lang.String[] axisText)
Gets the name of the coordinates:
Longitude and Latitude, if the associated MapControl object isn't projected, or the current distance unit
of the
MapControl's view port is in degrees.
X and Y, otherwise.
|
void |
setFractionDigits(java.awt.geom.Point2D p)
|
public StatusBarListener(org.gvsig.fmap.mapcontrol.MapControl mc)
Creates a new StatusBarListener object.
mc - the MapControl where will be applied the changespublic boolean cancelDrawing()
cancelDrawing in interface org.gvsig.fmap.mapcontrol.tools.Listeners.ToolListenerpublic java.lang.String[] getCoords(java.awt.geom.Point2D p)
Returns the coordinates equivalent to p:
formatDegrees(p.get{X or Y}() if the associated MapControl object isn't projected.formatDegrees({MapControl's projection}.toGeo(p.get{X or Y}()) if the associated
MapControl object is projected and its ViewPort's distance units are in degrees.{NumberFormat according to #setFractionDigits(Point2D)}.format((p.get{X or Y}()/MapContext.CHANGEM[mapControl.getViewPort().getDistanceUnits()])*MapContext.CHANGEM[mapControl.getViewPort().getMapUnits()])
otherwise.p - point 2D to convert in text coordinates according the projection of the associated MapControl and the
distance units of its ViewPort.p, according to the algorithm explained uppublic java.awt.Image getImageCursor()
getImageCursor in interface org.gvsig.fmap.mapcontrol.tools.Listeners.ToolListenerpublic void point(org.gvsig.fmap.mapcontrol.tools.Events.PointEvent event)
throws org.gvsig.fmap.mapcontrol.tools.BehaviorException
point in interface org.gvsig.fmap.mapcontrol.tools.Listeners.PointListenerorg.gvsig.fmap.mapcontrol.tools.BehaviorExceptionpublic void pointDoubleClick(org.gvsig.fmap.mapcontrol.tools.Events.PointEvent event)
throws org.gvsig.fmap.mapcontrol.tools.BehaviorException
pointDoubleClick in interface org.gvsig.fmap.mapcontrol.tools.Listeners.PointListenerorg.gvsig.fmap.mapcontrol.tools.BehaviorExceptionpublic java.lang.String[] setCoorDisplayText(java.lang.String[] axisText)
Gets the name of the coordinates:
MapControl's view port is in degrees.p - array of at least two String, where text will be stored and returnedString[0] : "Long = "String[1] : "Lat = "String[0] : "X = "String[1] : "Y = "public void setFractionDigits(java.awt.geom.Point2D p)
Sets the number of decimals of the coordinates that will be displayed, according the current projection
of the associated MapControl:
p - unused parameterCopyright © 2026 gvSIG Association. All rights reserved.