|
|||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
An interface is used to manage a geography map and paint it.
GeographyMap manages coordinate system, coordinate transformation, and coordinate correction. Every map object is set the default CRS(Coordinate Reference System), WGS84, which helps to transform a set of geography ordinates to a set of screen ordinates. In the future you can set custom CRS to a map object. GeographyMap can project an area of the map (named window of the map) to a specified rectangle area of the display device (view port).After you have correctly define the window and view port, you can success in getting correct coordinate transformation and non-fuzzily displaying a map.
GeographyMap handles the event occurring on the map. When some import property of the map is changed, some MapEvent will occur and be dispatched to all the registered listeners. GeographyMap object can manage these listeners( added, removed, and so on) and dispatches these kinds of events to the listeners. For example, if the window of a map is changed, a MapEvent with the MAP_WINDOW_CHANGED type will occurs on the map. The map will dispatch this event to the registered listener which is interested in the map events.
Geography layers are the contents of a map. A GeographyMap object manages these layers. With a map object, you can
add, remove, delete a layer, change the style of a specified layer, query the features of a layer, and even handle
the event occurring on layers. If you are interested in some kind of MapLayerChangedEvent
,
you should register a MapLayerListener
to the map. When some MapLayerChangedEvent occurs,
the map will dispatch the event to the listener.
Field Summary | |
static int |
FILRER_DWITHIN
Constant defining the relationship between two geometries( A geometry and B geometry). |
static int |
FILTER_WITHIN
Constant defining the relationship between two geometries( A geometry and B geometry). |
static int |
GEOGRAPHYMAP_TYPE_SHPFILE
Constant for defining a geographical map object's type.It specifies shape files will be used as the data source of the map object. |
static int |
GEOGRAPHYMAP_TYPE_TILE
Constant for defining a geographical map object's type.It specifies some GIS servers will be used as the data source of the map object. |
static int |
GROUNDING_STYLE_DEFAULT
Constant which defines the style of painting the grounding of the map. |
static int |
GROUNDING_STYLE_GRADIENT_HORIZONTAL
Constant which defines the style of painting the grounding of the map. |
static int |
GROUNDING_STYLE_GRADIENT_ROUND
Constant which defines the style of painting the grounding of the map. |
static int |
GROUNDING_STYLE_GRADIENT_VERTICAL
Constant which defines the style of painting the grounding of the map. |
static int |
IMAGELAYER_INDEX
|
static int |
LAYERMOVE_TYPE_DOWN
Constant for moving a layer. |
static int |
LAYERMOVE_TYPE_TOBOTTOM
Constant for moving a layer. |
static int |
LAYERMOVE_TYPE_TOTOP
Constant for moving a layer. |
static int |
LAYERMOVE_TYPE_UP
Constant for moving a layer. |
static int |
MAPMODE_AREA_DWITHIN_SELECT
Constant which defines how to operate the map. |
static int |
MAPMODE_AREA_WITHIN_SELECT
Constant which defines how to operate the map. |
static int |
MAPMODE_DEFAULT
Constant which defines how to operate the map. |
static int |
MAPMODE_DISTANCE
Constant which defines how to operate the map. |
static int |
MAPMODE_PAN
Constant which defines how to operate the map. |
static int |
MAPMODE_SELECT
Constant which defines how to operate the map. |
static int |
MAPMODE_ZOOMIN
Constant which defines how to operate the map. |
static int |
MAPMODE_ZOOMIN_BYSCALE
|
static int |
MAPMODE_ZOOMOUT
Constant which defines how to operate the map. |
static int |
MAPMODE_ZOOMRESET
Constant which defines how to operate the map. |
static int |
UNIT_CENTIMETER
|
static int |
UNIT_FEET
|
static int |
UNIT_KILOMETER
|
static int |
UNIT_METER
|
static int |
UNIT_MILE
|
Method Summary | |
void |
addBackAndForwardTask()
Adds a task to the redo/undo queue of the map object. |
void |
addGridLayer()
Adds the grid layer to the map with the default settings. |
void |
addGridLayer(int gridCount,
java.awt.Color gridColor)
Adds the grid layer and specifies the grid density and color used to paint the grid. |
void |
addLayer(java.lang.String mapPath)
Adds a geographical layer to the map from the specified path, and @see twaver.gis.tiles.Executor#EXECUTOR_TYPE_SHAPEFILE will be used as the default executor type. |
void |
addLayer(java.lang.String layerName,
int executorType)
Adds a geographical layer to the map by specifying corresponding executor type. |
void |
addLayer(java.lang.String layerName,
int executorType,
java.lang.String serverPath)
|
void |
addLayer(java.lang.String path,
java.lang.String property)
Adds a geographical layer and specifies which non-geometric property value will be displayed in the map. |
void |
addLayer(java.net.URL mapPath)
Adds a geographical layer to the map from the specified path, and @see twaver.gis.tiles.Executor#EXECUTOR_TYPE_SHAPEFILE will be used as the default executor type. |
void |
addLayer(java.net.URL mapPath,
java.lang.String property)
Adds a geographical layer and specifies which non-geometric property value will be displayed in the map. |
void |
addMapLayerListeren(MapLayerListener listener)
Adds the specified MapLayerListener to the listener list. |
void |
addMapListener(MapListener listener)
Adds the specified MapChangedListener to the listener list. |
void |
addPanActionFilter(PanActionFilter filter)
Adds a PanActionFilter instance to the map. |
void |
addScaleBar()
Adds scale bar to the map with the default settings. |
void |
addScaleBar(java.awt.Color scaleBarColor,
java.awt.Font scaleBarFont)
Adds the scale bar to the map with specified color and font. |
boolean |
canGoBack()
Determines whether the map object can go back right now. |
boolean |
canGoForward()
Determines whether the map object can go forward right now. |
boolean |
canPan()
Determines if the map can be panned. |
void |
clearSelection()
Clears all features from the selected features collection. |
void |
drawMap(java.awt.image.BufferedImage bufferImage)
|
void |
drawMap(java.awt.Graphics2D g)
Draws the context in the window of the map to something with the specified Graphics2D object |
void |
drawMap(java.awt.Graphics2D g,
java.awt.Rectangle viewport)
Deprecated. |
void |
drawMap(java.awt.Graphics2D g,
java.awt.Rectangle viewport,
int tileWidth,
int tileHeight,
int tileRow,
int tileCol,
java.awt.geom.Rectangle2D window)
Paints the specified area of the map on the specified view port. |
void |
drawMap(java.awt.Graphics2D g2d,
java.awt.Rectangle viewport,
java.awt.geom.Rectangle2D window)
Deprecated. |
void |
drawOverview(java.awt.Graphics2D g,
java.awt.Rectangle viewport,
java.awt.geom.Rectangle2D window)
Draws the overview of the map. |
void |
drawSelected(java.awt.Graphics2D g)
Draws the selected context of the map with the specified Graphics2D object |
java.lang.Object[] |
getAllLayerNames()
Gets the names of all the layers stored in the map. |
GeoCoordinate |
getCenterPoint()
Gets the center point of the map, and the point is described by a GeoCoordinate instance. |
int |
getCroundingStyle()
Gets the style uesed to paint the grounding of the map. |
double |
getDistance(java.util.ArrayList pointList)
Measures the summation of the distances between the points stored in the specified ArrayList. |
double |
getDistance(double fromLongitude,
double fromLatitude,
double toLongitude,
double toLatitude)
Measures the distance between the two points specified by the given coordinates. |
java.awt.image.BufferedImage |
getFullImage(java.awt.Dimension viewportSize)
Gets a image on which the context of the whole map is drawn referring to the specified projection range. |
java.awt.Color |
getGroundingColor()
Gets the grounding color of the map |
GeographyLayer |
getLayer(int index)
Gets a GeographyLayer object in the map with the specified index. |
GeographyLayer |
getLayer(java.lang.String layerName)
Gets a GeographyLayer object by the specified layer name. |
int |
getLayerCount()
Gets the count of the layers stored in the map. |
int |
getLayerIndex(java.lang.String layerName)
Gets a layer's index by the specified layer name. |
java.net.URL |
getLayerPath(java.lang.String layerName)
Gets the URL of a layer according to the specified layer name. |
java.util.Vector |
getLayerPaths()
Gets all URLs of all the layers. |
double[] |
getLL(double x,
double y)
Gets the geographical coordinate of a specified screen point which is described by x-y axes. |
java.awt.geom.Rectangle2D |
getMapArea()
Gets the whole map's bound. |
double |
getMapLatitude(double y)
Converts Y coordinate of the screen to latitude referring to map's projection. |
double |
getMapLongitude(double x)
Converts X coordinate of the screen to longitude referring to the map's geographic information. |
int |
getMapMode()
Gets the operation mode of the map. |
int |
getMapType()
Gets the type of the map object. |
java.awt.Dimension |
getOverviewDimesion()
Gets the predefined dimension of the overview panel. |
int |
getQueryLayerIndex()
Gets the index of the query layer. |
java.awt.image.BufferedImage |
getRasterData()
Gets the raster data of the map. |
int |
getScale()
Gets the denominator of the map's scale. |
GeographyFeature[] |
getSelectedFeatures()
Gets all selected GeographyFeatures |
java.awt.geom.Rectangle2D |
getSelectedFeaturesArea()
Gets the area which is covered by the selected features. |
java.util.Map |
getSelectedFeaturesAttributes()
Gets the attributes of all selected features. |
java.awt.Color |
getSelectedFilledColor()
Gets the color used to fill the selected features. |
java.awt.Color |
getSelectedStrokeColor()
Gets the color used to paint the selected features' bounds. |
int |
getThresholdLevel()
Gets the threshold level of the map according to the current scale denominator of the map. |
int |
getThresholdLevel(int scale)
Gets the threshold level according to the specified scale denominator |
int |
getThresholdsNum()
Gets the number of the defined thresholds. |
java.awt.Rectangle |
getViewport()
Gets the projection range. |
java.awt.geom.Rectangle2D |
getWindow()
Gets the window of the map. |
double |
getWindowMaxx()
Gets the max longitude of the map's window. |
double |
getWindowMaxy()
Gets the max latitude of the map's window. |
double |
getWindowMinx()
Gets the minimal longitude of the map's window. |
double |
getWindowMiny()
Gets the minimal latitude of the map's window. |
double |
getX(double longitude)
Converts longitude to X coordinate of the screen referring to map's projection. |
double[] |
getXY(double longitude,
double latitude)
Gets the screen coordinate of the point which is described by geographical coordinate. |
double |
getY(double latitude)
Converts latitude to Y coordinate of the screen referring to map's projection. |
int |
getZoom()
Gets current zoom of the map object. |
int |
getZoomLoLimit()
Gets the lower limit of the map's zoom. |
int |
getZoomUpLimit()
Gets the upper limit of the map's zoom. |
void |
goBack()
Goes back to the last state of the map object which is stored in the map's redo/undo queue. |
void |
goForward()
Goes forward to the next state of the map object which is stored in the map's redo/undo queue. |
boolean |
isGridLayerVisible()
Determines whether the grid layer is visible. |
boolean |
isScaleBarVisible()
Determines whether the scale bar is visible on the map. |
boolean |
isSupportingBackAndForward()
Determines whether the map object supports redo/undo tasks. |
boolean |
isVisible(int index)
Determines whether the layer specified by the index is visible. |
boolean |
isVisible(java.lang.String layerName)
Determines whether the specified layer in the map is visible. |
void |
moveLayer(java.lang.String layerName,
int layerMovedType)
Moves the specified geography layer upward or downward. |
void |
registerThresholds(int level,
int mapScaleThreshold)
Registers the thresholds to synchronize the element's size with the scale of the geographical map. |
void |
removeAllLayers()
Removes all layers stored in the map. |
void |
removeGridLayer()
Removes the grid layer from the map. |
void |
removeLayer(int index)
Removes a layer specified by the index. |
void |
removeLayer(java.lang.String layerName)
Removes a layer specified by the layer name. |
void |
removeLayers(java.lang.String[] layerNames)
Removes the layers specified by their names. |
void |
removeMapLayerListener(MapLayerListener listener)
Removes the specified MapLayerListener from the listener list. |
void |
removeMapListener(MapListener listener)
Removes the specified MapChangedListener from the listener list. |
void |
removeScaleBar()
Removes the scale bar from the map. |
void |
reset()
Resets the window of the map. |
java.awt.geom.Rectangle2D |
reviseWholeMap(java.awt.Rectangle viewport)
Revises the window which can cover the whole map referring to the specified projection area. |
void |
reviseWindow()
Revises current window. |
void |
selectFeatures(double x,
double y)
Selects the feature on the query layer by the specified point described by X and Y coordinates. |
void |
selectFeatures(java.awt.geom.Rectangle2D area,
int filterType)
Selects features according to the relationships between their geometries and a specified rectangle. |
void |
selectFeatures(java.lang.String attributeName,
int operator,
java.lang.Object value)
Selects the features on the query layer by the specified attribute value. |
void |
setAnchors(java.util.Vector anchors)
Sets the anchors of the raster data. |
void |
setBackAndForwardLimit(int limit)
Specifies the capability of the map object's redo/undo queue. |
void |
setCenterPoint(double longitude,
double latitude)
Sets the center point of the map. |
void |
setCenterPoint(GeoCoordinate center)
Specifies the center point of the map. |
void |
setGroundingColor(java.awt.Color color)
Sets the grounding color of the map. |
void |
setGroundingStyle(int style)
Defines the style used to painting the grounding of the map. |
void |
setLayerComplexStyle(java.lang.String layerName,
java.awt.Color strokeColor,
java.awt.Color fillColor,
double width,
double alpha,
boolean needText,
java.awt.Font font,
java.awt.Color fontColor,
boolean withHalo,
java.awt.Color haloColor,
java.lang.String property)
Sets the style of the specified layer by the layer name. |
void |
setLayerComplexStyle(java.lang.String layerName,
java.awt.Color strokeColor,
java.awt.Color fillColor,
double width,
double alpha,
boolean needText,
java.awt.Font font,
java.awt.Color fontColor,
java.lang.String property)
Sets the style of the specified layer by the layer name. |
void |
setMapMode(int value)
Sets the operation mode of the map. |
void |
setOverviewDimension(java.awt.Dimension overview)
Defines the dimension of the overview panel. |
void |
setQueryLayer(int index)
Defines which layer is the query layer by the specified index. |
void |
setQueryLayer(java.lang.String layerName)
Defines which layer is the query layer by the specified layerName. |
void |
setSelectedFeaturesStyle(java.awt.Color strokeColor,
java.awt.Color fillColor)
Specifies the style of all the selected features. |
void |
setSelectedFeaturesStyle(java.awt.Color strokeColor,
java.awt.Color fillColor,
double width,
double alpha)
Sets the geometric style used to paint the selected features. |
void |
setSupportingBackAndForward(boolean supportingUndo)
Specifies the if the map can support redo/undo tasks. |
void |
setViewport(java.awt.Rectangle viewportRect)
Sets the projection range. |
void |
setWindow(double minLongitude,
double minLatitude,
double maxLongitude,
double maxLatitude)
Defines the window on the map with the specified area in latitude and longitude coordinates. |
void |
setWindowByScreen(java.awt.geom.Rectangle2D rect)
Defines the window on the map with the specified Rectangle2D in screen coordinates. |
void |
setZoom(int zoom)
Sets the zoom of the map object. |
void |
setZoomLoLimit(int lolimit)
Sets the lower limit of the map's zoom. |
void |
setZoomUpLimint(int uplimit)
Sets the upper limit of the map's zoom. |
void |
stopRendering()
Stops rendering the map. |
Field Detail |
public static final int GEOGRAPHYMAP_TYPE_SHPFILE
public static final int GEOGRAPHYMAP_TYPE_TILE
public static final int IMAGELAYER_INDEX
public static final int LAYERMOVE_TYPE_UP
moveLayer(java.lang.String, int)
,
Constant Field Valuespublic static final int LAYERMOVE_TYPE_DOWN
moveLayer(java.lang.String, int)
,
Constant Field Valuespublic static final int LAYERMOVE_TYPE_TOTOP
moveLayer(java.lang.String, int)
,
Constant Field Valuespublic static final int LAYERMOVE_TYPE_TOBOTTOM
moveLayer(java.lang.String, int)
,
Constant Field Valuespublic static final int MAPMODE_DEFAULT
getMapMode()
,
setMapMode(int)
,
Constant Field Valuespublic static final int MAPMODE_ZOOMIN
getMapMode()
,
setMapMode(int)
,
Constant Field Valuespublic static final int MAPMODE_ZOOMOUT
getMapMode()
,
setMapMode(int)
,
Constant Field Valuespublic static final int MAPMODE_ZOOMRESET
getMapMode()
,
setMapMode(int)
,
Constant Field Valuespublic static final int MAPMODE_PAN
getMapMode()
,
setMapMode(int)
,
Constant Field Valuespublic static final int MAPMODE_SELECT
getMapMode()
,
setMapMode(int)
,
Constant Field Valuespublic static final int MAPMODE_DISTANCE
public static final int MAPMODE_AREA_WITHIN_SELECT
getMapMode()
,
setMapMode(int)
,
Constant Field Valuespublic static final int MAPMODE_AREA_DWITHIN_SELECT
getMapMode()
,
setMapMode(int)
,
Constant Field Valuespublic static final int MAPMODE_ZOOMIN_BYSCALE
public static final int FILTER_WITHIN
selectFeatures(Rectangle2D, int)
,
Constant Field Valuespublic static final int FILRER_DWITHIN
selectFeatures(Rectangle2D, int)
,
Constant Field Valuespublic static final int GROUNDING_STYLE_DEFAULT
setGroundingStyle(int)
,
Constant Field Valuespublic static final int GROUNDING_STYLE_GRADIENT_HORIZONTAL
setGroundingStyle(int)
,
Constant Field Valuespublic static final int GROUNDING_STYLE_GRADIENT_VERTICAL
setGroundingStyle(int)
,
Constant Field Valuespublic static final int GROUNDING_STYLE_GRADIENT_ROUND
setGroundingStyle(int)
,
Constant Field Valuespublic static final int UNIT_METER
public static final int UNIT_CENTIMETER
public static final int UNIT_KILOMETER
public static final int UNIT_FEET
public static final int UNIT_MILE
Method Detail |
public void setGroundingColor(java.awt.Color color)
color
- the grounding color.public java.awt.Color getGroundingColor()
public void setGroundingStyle(int style)
style
- the specified style.
You have the following choices:
GROUNDING_STYLE_DEFAULT
,
GROUNDING_STYLE_GRADIENT_HORIZONTAL
,
GROUNDING_STYLE_GRADIENT_VERTICAL
,
GROUNDING_STYLE_GRADIENT_ROUND
public int getCroundingStyle()
public int getMapMode()
MAPMODE_DEFAULT
,
MAPMODE_ZOOMIN
,
MAPMODE_ZOOMOUT
,
MAPMODE_ZOOMOUT
,
MAPMODE_PAN
,
MAPMODE_SELECT
,
MAPMODE_DISTANCE
,
MAPMODE_AREA_WITHIN_SELECT
,
MAPMODE_AREA_DWITHIN_SELECT
public void setMapMode(int value)
value
- defines the operation mode. You must specify one of the following choices:MAPMODE_DEFAULT
,
MAPMODE_ZOOMIN
,
MAPMODE_ZOOMOUT
,
MAPMODE_ZOOMOUT
,
MAPMODE_PAN
,
MAPMODE_SELECT
,
MAPMODE_DISTANCE
,
MAPMODE_AREA_WITHIN_SELECT
,
MAPMODE_AREA_DWITHIN_SELECT
public void addMapListener(MapListener listener)
listener
- the specified MapChangedListenerpublic void removeMapListener(MapListener listener)
listener
- the specified MapChangedListenerpublic void addMapLayerListeren(MapLayerListener listener)
listener
- the specified MapLayerListenerpublic void removeMapLayerListener(MapLayerListener listener)
listener
- the specified MapLayerListenerpublic boolean isVisible(java.lang.String layerName)
layerName
- the name of the specified layer.
public void reset()
public double getMapLongitude(double x)
x
- the specified X coordinate on the screen
GisToolkits.convertScreenToLatLong(GeographyMap, double, double)
public double getMapLatitude(double y)
y
- the specified Y coordinate on the screen
GisToolkits.convertScreenToLatLong(GeographyMap, double, double)
public double getX(double longitude)
longitude
- the specified longitude
GisToolkits.convertLatLongToScreen(GeographyMap, GeoCoordinate)
public double getY(double latitude)
latitude
- the specified latitude
GisToolkits.convertLatLongToScreen(GeographyMap, GeoCoordinate)
public void moveLayer(java.lang.String layerName, int layerMovedType)
layerName
- the name of the layer which will be movedlayerMovedType
- the type which specifies how to move the specified layer. You must specify one of the following
choices:LAYERMOVE_TYPE_UP
,
LAYERMOVE_TYPE_DOWN
,
LAYERMOVE_TYPE_TOTOP
,
LAYERMOVE_TYPE_TOBOTTOM
public java.awt.geom.Rectangle2D getMapArea()
public void addLayer(java.lang.String layerName, int executorType)
layerName
- the name of the layer which is being added into a map object.executorType
- the type of the executor which provides data for the specified layer.Executor.EXECUTOR_TYPE_SHAPEFILE
,
Executor.EXECUTOR_TYPE_GEOSERVER_WMS
,
Executor.EXECUTOR_TYPE_GEOSERVER_CACHE
public void addLayer(java.lang.String layerName, int executorType, java.lang.String serverPath)
public void addLayer(java.lang.String mapPath) throws java.io.IOException
mapPath
- the specified path.
java.lang.Exception
java.io.IOException
public void addLayer(java.net.URL mapPath) throws java.io.IOException
mapPath
- the specified path
java.io.IOException
public java.awt.geom.Rectangle2D reviseWholeMap(java.awt.Rectangle viewport)
viewport
- the specified projection area
public void addLayer(java.lang.String path, java.lang.String property) throws java.io.IOException
path
- the specified path of the layer.property
- the specified non-geometric property name
java.io.IOException
public void addLayer(java.net.URL mapPath, java.lang.String property) throws java.io.IOException
mapPath
- the specified path of the layerproperty
- the specified non-geometric property name
java.io.IOException
public GeographyLayer getLayer(int index)
index
- the specified index
public int getLayerIndex(java.lang.String layerName)
layerName
- the specified layer name
public GeographyLayer getLayer(java.lang.String layerName)
layerName
- the specified layer name
public int getLayerCount()
public java.lang.Object[] getAllLayerNames()
public void setQueryLayer(int index)
index
- the specified index.public void setQueryLayer(java.lang.String layerName)
layerName
- the specified layer name.public boolean isVisible(int index)
index
- the specified index
public void setWindow(double minLongitude, double minLatitude, double maxLongitude, double maxLatitude)
minLongitude
- the minimal longitudeminLatitude
- the minimal latitudemaxLongitude
- the max longitudemaxLatitude
- the max latitudepublic void setWindowByScreen(java.awt.geom.Rectangle2D rect)
rect
- the specified Rectangle2Dpublic java.awt.geom.Rectangle2D getWindow()
public double getWindowMinx()
public double getWindowMiny()
public double getWindowMaxx()
public double getWindowMaxy()
public void setViewport(java.awt.Rectangle viewportRect)
viewportRect
- the projection rangepublic java.awt.Rectangle getViewport()
public void drawMap(java.awt.Graphics2D g)
g
- the specified Graphics2D objectpublic void drawMap(java.awt.image.BufferedImage bufferImage)
public void drawMap(java.awt.Graphics2D g, java.awt.Rectangle viewport)
g
- the specified Graphics2D object to paint the mapviewport
- the target view portpublic void drawMap(java.awt.Graphics2D g2d, java.awt.Rectangle viewport, java.awt.geom.Rectangle2D window)
g2d
- viewport
- window
- public java.awt.image.BufferedImage getFullImage(java.awt.Dimension viewportSize)
viewportSize
- the specified projection range
public void setOverviewDimension(java.awt.Dimension overview)
If you want to display the whole map on an overview panel, you should set the dimension with this method.
overview
- the dimension of the overview panel.public java.awt.Dimension getOverviewDimesion()
public GeographyFeature[] getSelectedFeatures()
public java.awt.geom.Rectangle2D getSelectedFeaturesArea()
public void selectFeatures(java.lang.String attributeName, int operator, java.lang.Object value)
attributeName
- the name of the attribute which is used to be compared.operator
- the type of comparison operation. You can pick the following choices:value
- used as the reference value For example: selectFeatures("NAME",TWaverGisConst.OPERATOR_EQUAL,"New
York"); will pick out all the features which have the "NAME" attribute and the attribute value is "New
York".TWaverGisConst.OPERATOR_LESSOREQUAL
,
TWaverGisConst.OPERATOR_LESS
,
TWaverGisConst.OPERATOR_GREATER
,
TWaverGisConst.OPERATOR_GREATEROREQUAL
,
TWaverGisConst.OPERATOR_EQUAL
public void selectFeatures(double x, double y)
x
- the X coordinate on the screeny
- the Y coordinate on the screenpublic void selectFeatures(java.awt.geom.Rectangle2D area, int filterType)
area
- the screen area, in which you want to select featuresfilterType
- the specified filter type. You have the following choices:FILTER_WITHIN
,
FILRER_DWITHIN
public void setLayerComplexStyle(java.lang.String layerName, java.awt.Color strokeColor, java.awt.Color fillColor, double width, double alpha, boolean needText, java.awt.Font font, java.awt.Color fontColor, java.lang.String property)
layerName
- the specified layer name.strokeColor
- the color of the stroke used to paint.fillColor
- the color used to fill the layer.width
- the width of the stroke.alpha
- the alpha used to paint the layer.needText
- the flag defining if the label will be displayed.font
- the label's font if needText is true.fontColor
- the color of the label font if needText is true.property
- the name of the property which should be displayed by label.public void setLayerComplexStyle(java.lang.String layerName, java.awt.Color strokeColor, java.awt.Color fillColor, double width, double alpha, boolean needText, java.awt.Font font, java.awt.Color fontColor, boolean withHalo, java.awt.Color haloColor, java.lang.String property)
layerName
- the specified layer name.strokeColor
- the color of the stroke used to paint.fillColor
- the color used to fill the layer.width
- the width of the stroke.alpha
- the alpha used to paint the layer.needText
- the flag defining if the label will be displayed.font
- the label's font if needText is true.fontColor
- the color of the label font if needText is true.withHalo
- defines whether the label has a halo.haloColor
- specifies the color of label's halo.property
- the name of the property which should be displayed by label.public int getQueryLayerIndex()
public java.util.Map getSelectedFeaturesAttributes()
public void setSelectedFeaturesStyle(java.awt.Color strokeColor, java.awt.Color fillColor)
strokeColor
- the color used to draw the selected featuresfillColor
- the color used to fill the selected featurespublic void setSelectedFeaturesStyle(java.awt.Color strokeColor, java.awt.Color fillColor, double width, double alpha)
strokeColor
- the color of the stroke used to paint the selected features.fillColor
- the color used to fill the selected features.width
- the width of the stroke.alpha
- the alpha used to fill the selected features.public double getDistance(double fromLongitude, double fromLatitude, double toLongitude, double toLatitude)
fromLongitude
- the from point's longitude coordinate.fromLatitude
- the from point's latitude coordinate.toLongitude
- the to point's longitude coordinate.toLatitude
- the to point's latitude coordinate.
public double getDistance(java.util.ArrayList pointList)
pointList
- the specified ArrayList object, which stores the points.
public int getScale()
public void drawSelected(java.awt.Graphics2D g)
g
- the specified Graphics2D object.public void removeLayer(java.lang.String layerName)
layerName
- the name of the layerpublic void removeLayer(int index)
index
- the specified index.public void removeAllLayers()
public void removeLayers(java.lang.String[] layerNames)
layerNames
- the specified names , stored in an array.public void reviseWindow()
public void clearSelection()
public void stopRendering()
If you use multithread mechanism to draw a map, in order to synchronize the threads and , you should invoke this method before draw a map.
public java.awt.Color getSelectedFilledColor()
public java.awt.Color getSelectedStrokeColor()
public void addScaleBar()
public void addScaleBar(java.awt.Color scaleBarColor, java.awt.Font scaleBarFont)
scaleBarColor
- the color used to fill the scale barscaleBarFont
- the font for the description of the scale barpublic void removeScaleBar()
public void addGridLayer()
public void addGridLayer(int gridCount, java.awt.Color gridColor)
gridCount
- the grid density to cover the screen.gridColor
- the color used to paint the grid.Default color is white.public void removeGridLayer()
public boolean isScaleBarVisible()
public boolean isGridLayerVisible()
public java.net.URL getLayerPath(java.lang.String layerName)
layerName
- the layer name
public java.util.Vector getLayerPaths()
public java.awt.image.BufferedImage getRasterData()
public void setAnchors(java.util.Vector anchors)
anchors
- the list of all anchors on the raster data.public void drawOverview(java.awt.Graphics2D g, java.awt.Rectangle viewport, java.awt.geom.Rectangle2D window)
g
- the Graphics object used to display the mapviewport
- a Rectangle object which is described by screen coordinates in pixels,
is used to specify the view port of the map.window
- the window on the map. The Rectangle2D object is described by geographical coordinates in degrees.public void drawMap(java.awt.Graphics2D g, java.awt.Rectangle viewport, int tileWidth, int tileHeight, int tileRow, int tileCol, java.awt.geom.Rectangle2D window)
g
- the original Graphics object.viewport
- view port of the target. Defined by a Rectangle object in x and y decimaltileWidth
- tileHeight
- tileRow
- tileCol
- window
- public void registerThresholds(int level, int mapScaleThreshold)
level
- the level of elements' size. If it is set as zero, all the elements should keep their original size.
If the level is larger,the elements' size will be smaller.mapScaleThreshold
- the scale of the geographical map. Defines the scale threshold which if the scale reaches, the elements' sizes should be changed at the same time.public int getThresholdsNum()
public int getThresholdLevel()
public int getThresholdLevel(int scale)
scale
- the specified scale denominator
public void setBackAndForwardLimit(int limit)
public void setSupportingBackAndForward(boolean supportingUndo)
supportingUndo
- public boolean isSupportingBackAndForward()
public boolean canGoBack()
public boolean canGoForward()
public void goBack() throws javax.swing.undo.CannotUndoException
javax.swing.undo.CannotUndoException
public void goForward() throws javax.swing.undo.CannotUndoException
javax.swing.undo.CannotUndoException
public void addBackAndForwardTask()
public void setZoom(int zoom)
GEOGRAPHYMAP_TYPE_TILE
, this method works correctly.
zoom
- the specified zoom.public int getZoom()
GEOGRAPHYMAP_TYPE_TILE
, this method returns correct value.
public int getMapType()
GEOGRAPHYMAP_TYPE_SHPFILE
,
GEOGRAPHYMAP_TYPE_TILE
public void setCenterPoint(GeoCoordinate center)
setZoom(int)
,getZoom()
and etc,
only when the map's type is GEOGRAPHYMAP_TYPE_TILE
, this method works correctly.
The center point should be described by geographical coordinate wrapped by GeoCoordinate
class.
center
- the center point .public GeoCoordinate getCenterPoint()
GeoCoordinate
instance.
public void setCenterPoint(double longitude, double latitude)
GEOGRAPHYMAP_TYPE_TILE
, this method works correctly.
longitude
- the longitude of the center point of the map.latitude
- the latitude of the center point of the map.public double[] getLL(double x, double y)
GEOGRAPHYMAP_TYPE_TILE
, this method works correctly.
x
- the x value of the specified screen pointy
- the y value of the specified screen point
GisToolkits.convertScreenToLatLong(GeographyMap, double, double)
public double[] getXY(double longitude, double latitude)
GEOGRAPHYMAP_TYPE_TILE
, this method works correctly.
longitude
- the longitude of the specified point.latitude
- the latitude of the specified point.
GisToolkits.convertLatLongToScreen(GeographyMap, double, double)
public void addPanActionFilter(PanActionFilter filter)
PanActionFilter
instance to the map.
filter
- a PanActionFilter
instancepublic boolean canPan()
public void setZoomUpLimint(int uplimit)
uplimit
- the specified upper limit of the map's zoom.public void setZoomLoLimit(int lolimit)
lolimit
- the specified lower limit of the map's zoom.public int getZoomUpLimit()
public int getZoomLoLimit()
|
|||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |