|
|||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objecttwaver.gis.GisToolkits
The GisToolkits provides some methods to help developers do some calculation, deal with image object and do some presettings, etc.
Field Summary | |
static java.awt.Font |
DEFAULT_FONT
Default Font used in TWaver GIS. |
Constructor Summary | |
GisToolkits()
|
Method Summary | |
static void |
addLayer(GeographyMap map,
java.io.File file)
Add the specified shape file into a map. |
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,
GeoCoordinate co)
Converts geographical coordinate to screen coordinate |
static GeoCoordinate |
convertScreenToLatLong(GeographyMap map,
double screenX,
double screenY)
Converts screen coordinate to geographical coordinate |
static GeoCoordinate |
convertScreenToLatLong(GeographyMap map,
java.awt.geom.Point2D screenPoint)
Converts screen coordinate to geographical coordinate |
static GeographyMap |
createDefaultMap()
Creates a GeographyMap object which supports shape files. |
static GeographyMap |
createMap(int type)
Create a GeographyMap with the specified map type. |
static double |
getDegree(double[] degreeDescription)
|
static java.lang.String |
getFormatNumber(double value,
int decimal)
|
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.io.InputStream |
getInputStream(java.lang.String path)
|
static java.awt.Color |
getRandomColor()
Gets a random color. |
static java.lang.String |
getString(java.lang.String prefix,
java.lang.String key)
|
static double |
getSynchronizeScale(GeographyMap map)
Gets the new scale of the network element's size, if you have registered the thresholds into a GeographyMap object, when the scale |
static double |
getSynchronizeScale(int thresholdsNum,
double thresholdLevel)
|
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 void |
goBack(twaver.network.TNetwork network,
GeographyMap map)
Redo last 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 |
matchMapWithGridData(twaver.network.TNetwork network,
GeographyMap map)
Match the vector data of the map with the grid data. |
static void |
setGeographicalCoordinate(GeographyMap map,
twaver.Element element)
Sets the value of the element's TWaverGisConst.GEOCOORDINATE client property. |
static void |
showExportSettingDialog(twaver.network.TNetwork network,
GeographyMap map)
Shows out a dialog used to set exporting image options. |
static void |
showPrintDialog(twaver.network.TNetwork network,
GeographyMap map,
boolean isPreview)
Shows out a dialog used to set print options. |
Methods inherited from class java.lang.Object |
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
public static java.awt.Font DEFAULT_FONT
Constructor Detail |
public GisToolkits()
Method Detail |
public static java.awt.Color getRandomColor()
public static GeographyMap createDefaultMap()
public static GeographyMap createMap(int type)
type
- the specified map type.
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 java.lang.String getFormatNumber(double value, int decimal)
public static final javax.swing.ImageIcon getImageIcon(java.lang.String path)
public static final java.io.InputStream getInputStream(java.lang.String path)
public static java.awt.Container getTopContainer(javax.swing.JComponent component)
public static void showPrintDialog(twaver.network.TNetwork network, GeographyMap map, boolean isPreview)
network
- the specified TNetwork objectmap
- the specified GeographyMap object which will be printedisPreview
- the flag decides if the dialog is a print dialog or a print preview dialog.
true to display a print preview dialog, and false to display a print dialog.public static void showExportSettingDialog(twaver.network.TNetwork network, GeographyMap map)
network
- map
- public static void matchMapWithGridData(twaver.network.TNetwork network, GeographyMap map)
network
- map
- 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 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 double getDegree(double[] degreeDescription)
public static void addLayer(GeographyMap map, java.io.File file)
map
- the target map objectfile
- the specified shape file objectpublic static 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 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 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, GeoCoordinate co)
map
- the referential map objectco
- the geographical point's coordinate
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.public static double getSynchronizeScale(GeographyMap map)
map
- the specified GeographyMap into which the thresholds have been registered.
public static double getSynchronizeScale(int thresholdsNum, double thresholdLevel)
public static java.lang.String getString(java.lang.String prefix, java.lang.String key)
|
|||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |