|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objecttwaver.gis.utils.GisToolkits
A collection of utility methods for TWaverGIS.
Constructor Summary | |
GisToolkits()
|
Method Summary | |
static void |
addOnReadyListener(OnReadyListener listener)
|
static java.awt.geom.Point2D |
convertLatLongToScreen(GeographyMap map,
double longitude,
double latitude)
Converts geographical coordinate to screen coordinate |
static java.awt.geom.Point2D |
convertLatLongToScreen(GeographyMap map,
twaver.GeoCoordinate co)
Converts geographical coordinate to screen coordinate |
static twaver.GeoCoordinate |
convertScreenToLatLong(GeographyMap map,
double screenX,
double screenY)
Converts screen coordinate to geographical coordinate |
static twaver.GeoCoordinate |
convertScreenToLatLong(GeographyMap map,
java.awt.geom.Point2D screenPoint)
Converts screen coordinate to geographical coordinate |
static GeographyMap |
createDefaultMap()
Creates a GeographyMap object which displays the map as tiles. |
static GeographyFeature |
createFeture(java.util.List shape,
java.lang.String type,
java.lang.String[] attributeNames,
java.lang.Object[] values)
|
static int |
getAppropriateZoomLevel(GridBbox bbox,
GeographyMap map)
Gets appropriate zoom level by referring to the specified geographical area. |
static double |
getDegree(double[] degreeDescription)
|
static double |
getDistance(double fromLongitude,
double fromLatitude,
double toLongitude,
double toLatitude)
|
static java.util.List |
getFeaturePoints(GeographyMap map,
java.util.List list,
boolean toScreenPoint,
boolean optimize)
|
static java.lang.String |
getFormatNumber(double value,
int decimal)
|
static java.awt.Shape |
getGeographyFeatureShape(GeographyMap map,
GeographyFeature feature)
Gets the shape of a GeographyFeature . |
static twaver.GeoCoordinate |
getGeoPointFromPixelXY(double pixelx,
double pixely,
int zoomLevel,
int projectionType)
|
static twaver.GeoCoordinate |
getGeoPointFromScreenPoint(double x,
double y,
twaver.GeoCoordinate mapCenter,
int viewWidth,
int viewHeight,
int zoomLevel,
int projectionType)
Converts screen point to geographic coordinate according to the specified projection. |
static java.awt.Image |
getImage(java.lang.String path)
Gets an Image object according to the specified file path. |
static javax.swing.ImageIcon |
getImageIcon(java.lang.String path)
|
static java.awt.geom.Point2D |
getPixelXY(twaver.GeoCoordinate geoPoint,
int zoomLevel,
int projectionType)
|
static java.awt.Color |
getRandomColor()
Gets a random color. |
static java.util.List |
getRegionPath(GeographyMap map,
twaver.ShapeNode region,
boolean optimize)
|
static java.awt.geom.Point2D |
getScreenLocation(twaver.Element element,
GeographyMap map)
Gets the screen location of the an Element object. |
static java.awt.geom.Point2D |
getScreenPointFromGeoPoint(twaver.GeoCoordinate geoPoint,
twaver.GeoCoordinate mapCenter,
int viewWidth,
int viewHeight,
int zoomLevel,
int projectionType)
Converts geographical point to screen point according to the specified projection. |
static java.lang.String |
getServerByExecutorType(int executorType)
|
static java.awt.Container |
getTopContainer(javax.swing.JComponent component)
|
static java.awt.geom.Rectangle2D |
getVisibleElementsBounds(twaver.network.TNetwork network,
GeographyMap map)
Gets the geographical bounds of all visible elements of the network. |
static java.lang.String |
getWFSCapabilities(int executorType,
java.lang.String WFSURL)
Gets the contents of WFS capabilities. |
static java.util.List |
getWFSLayers(int executorType,
java.lang.String WFSURL)
Gets the layers information of WFS capabilities contents. |
static java.util.List |
getWMSCapabilities(int executorType,
java.lang.String WMSURL)
Gets the WMS capabilities contents. |
static void |
goBack(twaver.network.TNetwork network,
GeographyMap map)
Redo last zoom out or in operation. |
static void |
locateElement(twaver.Element element,
GeographyMap map)
Locates the element on the screen according to the element's geographical coordinate and the map instance. |
static void |
setGeographicalCoordinate(GeographyMap map,
twaver.Element element)
Sets the value of the element's TWaverGisConst.GEOCOORDINATE client property. |
Methods inherited from class java.lang.Object |
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
public GisToolkits()
Method Detail |
public static void addOnReadyListener(OnReadyListener listener)
public static java.awt.geom.Point2D convertLatLongToScreen(GeographyMap map, double longitude, double latitude)
map
- the referential map objectlongitude
- the longitude of the specified geographical pointlatitude
- the latitude of the specified geographical point
public static java.awt.geom.Point2D convertLatLongToScreen(GeographyMap map, twaver.GeoCoordinate co)
map
- the referential map objectco
- the geographical point's coordinate
public static twaver.GeoCoordinate convertScreenToLatLong(GeographyMap map, double screenX, double screenY)
map
- the map instance according which to convert the coordinates.screenX
- the x value of the specified screen coordinatescreenY
- the y value of the specified screen coordinate
public static twaver.GeoCoordinate convertScreenToLatLong(GeographyMap map, java.awt.geom.Point2D screenPoint)
map
- the map instance according which to convert the coordinatesscreenPoint
- the location of the point on the screen.
public static GeographyMap createDefaultMap()
public static GeographyFeature createFeture(java.util.List shape, java.lang.String type, java.lang.String[] attributeNames, java.lang.Object[] values)
public static int getAppropriateZoomLevel(GridBbox bbox, GeographyMap map)
bbox
- the specified geographical area.map
- relative GeographyMap object
public static double getDegree(double[] degreeDescription)
public static double getDistance(double fromLongitude, double fromLatitude, double toLongitude, double toLatitude)
public static java.util.List getFeaturePoints(GeographyMap map, java.util.List list, boolean toScreenPoint, boolean optimize)
public static java.lang.String getFormatNumber(double value, int decimal)
public static java.awt.Shape getGeographyFeatureShape(GeographyMap map, GeographyFeature feature)
GeographyFeature
. TWaverGIS can create GeographyFeature objects though WFS. Every
feature contains geometric attribute which describe the track of a geographical feature. But the track is
described by latitude and longitude coordinate. This method can return the shape of the track and the shape is
described by x/y coordinate.
map
- the referential map object.feature
- the source GeographyFeature object.
public static twaver.GeoCoordinate getGeoPointFromPixelXY(double pixelx, double pixely, int zoomLevel, int projectionType)
public static twaver.GeoCoordinate getGeoPointFromScreenPoint(double x, double y, twaver.GeoCoordinate mapCenter, int viewWidth, int viewHeight, int zoomLevel, int projectionType)
x
- x value of the screen pointy
- y value of the screen pointmapCenter
- the center geographical point of the mapviewWidth
- the width of view portviewHeight
- the height of view portzoomLevel
- the specified zoomprojectionType
- the specified projection type
TWaverGisConst.PROJECTIONTYPE_4326
,
TWaverGisConst.PROJECTIONTYPE_MERCATOR
public static final java.awt.Image getImage(java.lang.String path)
path
- the specified file path. Like 'file:/e:/test/a.png' or 'http://www.sss.com/a.png' or
'/project/resources/c.png'
public static final javax.swing.ImageIcon getImageIcon(java.lang.String path)
public static java.awt.geom.Point2D getPixelXY(twaver.GeoCoordinate geoPoint, int zoomLevel, int projectionType)
public static java.awt.Color getRandomColor()
public static java.util.List getRegionPath(GeographyMap map, twaver.ShapeNode region, boolean optimize)
public static java.awt.geom.Point2D getScreenLocation(twaver.Element element, GeographyMap map)
element
- the target elementmap
- the relative map object
public static java.awt.geom.Point2D getScreenPointFromGeoPoint(twaver.GeoCoordinate geoPoint, twaver.GeoCoordinate mapCenter, int viewWidth, int viewHeight, int zoomLevel, int projectionType)
geoPoint
- the specified geographical pointmapCenter
- the center geographical point of the mapviewWidth
- the width of view portviewHeight
- the height of view portzoomLevel
- the specified zoomprojectionType
- the specified projection type
TWaverGisConst.PROJECTIONTYPE_4326
,
TWaverGisConst.PROJECTIONTYPE_MERCATOR
public static java.lang.String getServerByExecutorType(int executorType)
public static java.awt.Container getTopContainer(javax.swing.JComponent component)
public static java.awt.geom.Rectangle2D getVisibleElementsBounds(twaver.network.TNetwork network, GeographyMap map)
network
- the network object contains the whole topological datasmap
- the reference map
public static java.lang.String getWFSCapabilities(int executorType, java.lang.String WFSURL)
executorType
- the specified executor type. TWaverGIS implements the getCapabilities interface of the WFS provided by
GeoServer.WFSURL
- the specified server's URL.
public static java.util.List getWFSLayers(int executorType, java.lang.String WFSURL)
executorType
- the specified executor type. TWaverGIS implements the getCapabilities interface of the WFS provided by
GeoServer.WFSURL
- the specified server's URL.
public static java.util.List getWMSCapabilities(int executorType, java.lang.String WMSURL)
executorType
- the specified executor type. TWaverGIS implements the getCapabilities interface of the WMS provided by
GeoServer, ArcGIS and MapXtream.WMSURL
- the specified server's URL.
public static void goBack(twaver.network.TNetwork network, GeographyMap map)
network
- the specified TNetwork object.map
- the relative map object.public static void locateElement(twaver.Element element, GeographyMap map)
element
- an Element object with the client property TWaverGisConst.GEOCOORDINATE
.map
- the specified map instance.public static void setGeographicalCoordinate(GeographyMap map, twaver.Element element)
TWaverGisConst.GEOCOORDINATE
client property.
map
- the referential map objectelement
- the target which should be located on the correct position of the screen.
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |