public class MapRegion
extends java.lang.Object
Modifier and Type | Method and Description |
---|---|
void |
addChangeListener(javax.swing.event.ChangeListener l)
Adds a change listener to listen for queryWindow changes.
|
double |
getCurrentRatioScale()
Returns the current ratio scale.
|
java.awt.geom.Rectangle2D |
getDataWindow()
Gets the data window rectangle
|
int |
getDataWindowSrid()
Gets the data window SRID
|
double |
getMapScale()
Gets the current map scale denominator in the ratio scale.
|
int |
getMapSrid()
Gets the current map SRID
|
SRS |
getSRS()
Returns the map region SRS object.
|
java.awt.geom.AffineTransform |
getTransformDifference(java.awt.geom.AffineTransform oldXFM) |
int |
getUserSrid() |
java.awt.geom.AffineTransform |
getViewportTransform() |
void |
pan(int tx, int ty)
Moves the map display by 'tx' pixels on the X axis, and 'ty' pixels on the Y axis in the device coordinate system.
|
void |
removeChangeListener(javax.swing.event.ChangeListener l)
Removes the give change listener
|
void |
setDataWindow(java.awt.geom.Rectangle2D dataWindow)
Sets the data window rectangle
|
void |
setDataWindow(java.awt.geom.Rectangle2D dataWindow, int zoomLevelDif)
Sets the data window rectangle and zoom level
|
void |
setDataWindowByScale(double centerX, double centerY, double scale)
Sets the data window size using the given scale
|
void |
setDataWindowSrid(int dataWindowSrid)
Sets the data window srid
|
void |
setMapSrid(int mapSrid)
Sets the current map SRID
|
void |
setSRS(SRS srs)
Sets the map region SRS information.
|
void |
setUserSrid(int userSrid)
Sometimes when a map is displayed in a projected coordinate system, the coordinates do not make much sense to a user, who expects to see coordinates such as those displayed when moving mouse around the map to be in longitude/latitude.
|
void |
zoom(java.awt.geom.Point2D deviceAnchor, double factor, int level) |
void |
zoomBox(java.awt.geom.Rectangle2D window)
Zooms to the provided box
|
void |
zoomIn()
Performs a zoom in
|
void |
zoomIn(java.awt.geom.Point2D deviceAnchor)
Performs a zoom in at the given point
|
void |
zoomOut()
Performs a zoom out
|
void |
zoomOut(java.awt.geom.Point2D deviceAnchor)
Performs a zoom out at the given pont
|
public MapRegion(MapCanvas canvas)
public void setDataWindowByScale(double centerX, double centerY, double scale) throws java.lang.Exception
centerX
-centerY
-scale
-java.lang.Exception
public int getMapSrid()
public void setMapSrid(int mapSrid)
mapSrid
-public java.awt.geom.Rectangle2D getDataWindow()
public void setDataWindow(java.awt.geom.Rectangle2D dataWindow)
dataWindow
-public void setDataWindow(java.awt.geom.Rectangle2D dataWindow, int zoomLevelDif)
dataWindow
-zoomLevelDif
-public int getDataWindowSrid()
public void setDataWindowSrid(int dataWindowSrid)
dataWindowSrid
-public double getMapScale()
public java.awt.geom.AffineTransform getViewportTransform()
public java.awt.geom.AffineTransform getTransformDifference(java.awt.geom.AffineTransform oldXFM)
public void addChangeListener(javax.swing.event.ChangeListener l)
l
-public void removeChangeListener(javax.swing.event.ChangeListener l)
l
-public void zoomBox(java.awt.geom.Rectangle2D window)
window
-public void zoomIn()
public void zoomIn(java.awt.geom.Point2D deviceAnchor)
deviceAnchor
-public void zoomOut()
public void zoomOut(java.awt.geom.Point2D deviceAnchor)
deviceAnchor
-public void zoom(java.awt.geom.Point2D deviceAnchor, double factor, int level)
public void pan(int tx, int ty)
tx
- the distance by which coordinates are translated in the X axis directionty
- the distance by which coordinates are translated in the Y axis directionpublic void setSRS(SRS srs)
srs
-public SRS getSRS()
public double getCurrentRatioScale()
public int getUserSrid()
public void setUserSrid(int userSrid)