|
|||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objecttwaver.gis.ImageLayer
The ImageLayer is an implements of the interface ImageLayer. The ImageLayer is used to manage the raster data as a GeographyLayer object.
Field Summary |
Fields inherited from interface twaver.gis.GeographyLayer |
IMAGELAYER_NAME |
Constructor Summary | |
ImageLayer(GeographyMap map)
|
Method Summary | |
void |
addCustomRule(java.lang.String attributeName,
int operator,
java.lang.Object value,
java.awt.Color strokeColor,
double width,
java.awt.Color fillColor,
double alpha)
Adds a rule to a GeographyLayer. |
void |
clearRules()
|
GeographyFeature[] |
getAllFeatures()
Gets all the GeographyFeatures of the layer. |
double |
getAlpha()
Gets the alpha value of the style which has been set to the layer. |
java.lang.String |
getAttributeName()
Gets the name of the attribute which is used as the label. |
GeographyFeature[] |
getFeatures(double longitude,
double latitude)
Gets the features which geometric shape contains the coordinates. |
java.util.Collection |
getFeaturesByAttribute(java.lang.String attributename,
java.lang.Object value)
Gets the features referring to the specified attribute's value. |
java.lang.String |
getFeatureTypeName()
Gets the name of the feature type. |
java.awt.Color |
getFillColor()
Gets the color used to fill the layer. |
java.awt.Font |
getFont()
Gets the font used to paint the label. |
java.awt.Color |
getFontColor()
Gets the color used to paint the label. |
java.awt.geom.Rectangle2D |
getLayerBounds()
Gets the bound of the layer. |
java.lang.String |
getLayerGeometryTypeName()
Gets the name of the layer's geometry type. |
java.lang.String[] |
getLayerPropertiesNames()
Gets the names of all the properties stored in the layer. |
int |
getScaleFactor()
Gets the scale factor of the layer. |
java.awt.Color |
getStrokeColor()
Gets the stroke color used to paint the layer. |
double |
getStrokeWidth()
Gets the stroke width used to paint the layer. |
java.lang.String |
getTitle()
Gets the title of the GeographyLayer. |
boolean |
isLabelVisible()
Determines whether the label can be visible. |
boolean |
isPermittedVisible()
Indicates whether the layer's visibility gets the permission. |
boolean |
isScaleVisible()
Indicates whether the layer can be visible under some scale of the map. |
boolean |
isVisible()
Indicates whether the layer is visible. |
void |
removeRules()
Removes all the custom rules, and clears all the custom styles of the features stored in the layer. |
void |
setAlpha(double alpha)
Sets the alpha of the style which is set to the layer. |
void |
setAttributeName(java.lang.String attributeName)
Defines which attribute is used to as the label and the attribute is specified by the attribute name. |
void |
setFillColor(java.awt.Color fillColor)
Sets the color used to fill the layer. |
void |
setFont(java.awt.Font font)
Sets the font used to paint the label. |
void |
setFontColor(java.awt.Color fontColor)
Sets the color used to paint the label. |
void |
setLabelVisible(java.lang.String attributeName,
boolean visible)
Defines if the specified attribute used as the label is visible. |
void |
setLabelVisible(java.lang.String attributeName,
boolean visible,
java.awt.Color fontColor,
java.awt.Font font)
Defines if the specified attribute used as the label is visible. |
void |
setLayerBounds(double minLongitude,
double minLatitude,
double maxLongitude,
double maxLatitude)
|
void |
setLayerComplexStyle(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 Layer. |
void |
setLayerComplexStyle(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 Layer. |
void |
setScaleFactor(int scaleFactor)
Sets the scale factor of the layer. |
void |
setScaleVisible(boolean value)
Sets the scale factor of the layer. |
void |
setStrokeColor(java.awt.Color strokeColor)
Sets the stroke color used to paint the layer |
void |
setStrokeWidth(double strokeWidth)
Sets the stroke width used to paint the layer. |
void |
setVisibilityPermission(boolean value)
Sets the permission of the layer's visibility. |
void |
setVisible(boolean value)
Decides whether the layer is visible. |
void |
updateDisplay()
After add the rules to a GeographyLayer, you will have to invoke this method, otherwise, what you have added into the layer will not works. |
Methods inherited from class java.lang.Object |
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
public ImageLayer(GeographyMap map)
Method Detail |
public void addCustomRule(java.lang.String attributeName, int operator, java.lang.Object value, java.awt.Color strokeColor, double width, java.awt.Color fillColor, double alpha)
GeographyLayer
For example:
There are a lot of features in a GeographyLayer.They have the same attribute named "NAME", but have different attribute values.There is one feature and the value of the "NAME" attribute is "New York". If the feature is supposed to be painted in green color, filled with red color, and be transparent described by a alpha value, you can use layer.addCustomRule("NAME",TWaverGisConst.OPERATOR_EQUAL, "New York",Color.GREEN,1,Color.RED,0.5). After that, you should invoke layer.updateDisplay to display your settings.
addCustomRule
in interface GeographyLayer
attributeName
- the attribute name which you want to refer to.operator
- the type to compare the attribute's values. You should use the following choices:value
- the attribute's value used to be compared with.strokeColor
- the color used to paint the feature.width
- the width of the stroke.fillColor
- the color used to fill the feature.alpha
- the alpha value used to fill the feature.TWaverGisConst.OPERATOR_NULL
,
TWaverGisConst.OPERATOR_LESSOREQUAL
,
TWaverGisConst.OPERATOR_LESS
,
TWaverGisConst.OPERATOR_GREATER
,
TWaverGisConst.OPERATOR_GREATEROREQUAL
,
TWaverGisConst.OPERATOR_EQUAL
public void clearRules()
clearRules
in interface GeographyLayer
public GeographyFeature[] getAllFeatures()
GeographyLayer
getAllFeatures
in interface GeographyLayer
public double getAlpha()
GeographyLayer
getAlpha
in interface GeographyLayer
public java.lang.String getAttributeName()
GeographyLayer
getAttributeName
in interface GeographyLayer
public java.lang.String getFeatureTypeName()
GeographyLayer
getFeatureTypeName
in interface GeographyLayer
public GeographyFeature[] getFeatures(double longitude, double latitude)
GeographyLayer
getFeatures
in interface GeographyLayer
longitude
- the longitude coordinate.latitude
- the latitude coordinate.
public java.util.Collection getFeaturesByAttribute(java.lang.String attributename, java.lang.Object value)
GeographyLayer
getFeaturesByAttribute
in interface GeographyLayer
attributename
- the name of a attribute.value
- the value of the attribute.
public java.awt.Color getFillColor()
GeographyLayer
getFillColor
in interface GeographyLayer
public java.awt.Font getFont()
GeographyLayer
getFont
in interface GeographyLayer
public java.awt.Color getFontColor()
GeographyLayer
getFontColor
in interface GeographyLayer
public java.awt.geom.Rectangle2D getLayerBounds()
GeographyLayer
getLayerBounds
in interface GeographyLayer
For example: Rectange2D layerBound = getLayerBounds(); System.out.println(layerBound.getMinx());
public java.lang.String getLayerGeometryTypeName()
GeographyLayer
getLayerGeometryTypeName
in interface GeographyLayer
public java.lang.String[] getLayerPropertiesNames()
GeographyLayer
getLayerPropertiesNames
in interface GeographyLayer
public int getScaleFactor()
GeographyLayer
getScaleFactor
in interface GeographyLayer
GeographyLayer.isVisible()
,
GeographyLayer.setVisible(boolean)
,
GeographyLayer.isPermittedVisible()
,
GeographyLayer.setVisibilityPermission(boolean)
,
GeographyLayer.setScaleFactor(int)
,
GeographyLayer.setScaleVisible(boolean)
,
GeographyLayer.isScaleVisible()
public java.awt.Color getStrokeColor()
GeographyLayer
getStrokeColor
in interface GeographyLayer
public double getStrokeWidth()
GeographyLayer
getStrokeWidth
in interface GeographyLayer
public java.lang.String getTitle()
GeographyLayer
getTitle
in interface GeographyLayer
public boolean isLabelVisible()
GeographyLayer
isLabelVisible
in interface GeographyLayer
public boolean isPermittedVisible()
GeographyLayer
isPermittedVisible
in interface GeographyLayer
GeographyLayer.isVisible()
,
GeographyLayer.setVisible(boolean)
,
GeographyLayer.setVisibilityPermission(boolean)
,
GeographyLayer.setScaleFactor(int)
,
GeographyLayer.getScaleFactor()
,
GeographyLayer.setScaleVisible(boolean)
,
GeographyLayer.isScaleVisible()
public boolean isScaleVisible()
GeographyLayer
isScaleVisible
in interface GeographyLayer
GeographyLayer.isVisible()
,
GeographyLayer.setVisible(boolean)
,
GeographyLayer.setVisibilityPermission(boolean)
,
GeographyLayer.isPermittedVisible()
,
GeographyLayer.setScaleFactor(int)
,
GeographyLayer.getScaleFactor()
,
GeographyLayer.setScaleVisible(boolean)
public boolean isVisible()
GeographyLayer
isVisible
in interface GeographyLayer
GeographyLayer.setVisible(boolean)
,
GeographyLayer.setVisibilityPermission(boolean)
,
GeographyLayer.isPermittedVisible()
,
GeographyLayer.setScaleFactor(int)
,
GeographyLayer.getScaleFactor()
,
GeographyLayer.setScaleVisible(boolean)
,
GeographyLayer.isScaleVisible()
public void removeRules()
GeographyLayer
removeRules
in interface GeographyLayer
public void setAlpha(double alpha)
GeographyLayer
setAlpha
in interface GeographyLayer
alpha
- the specified alpha value.public void setAttributeName(java.lang.String attributeName)
GeographyLayer
setAttributeName
in interface GeographyLayer
attributeName
- the specified attribute name.public void setFillColor(java.awt.Color fillColor)
GeographyLayer
setFillColor
in interface GeographyLayer
fillColor
- the specified color used to fill the layer.public void setFont(java.awt.Font font)
GeographyLayer
setFont
in interface GeographyLayer
font
- the specified font used to paint the labelpublic void setFontColor(java.awt.Color fontColor)
GeographyLayer
setFontColor
in interface GeographyLayer
fontColor
- the specified color used to paint the label.public void setLabelVisible(java.lang.String attributeName, boolean visible)
GeographyLayer
setLabelVisible
in interface GeographyLayer
attributeName
- the specified attribute used as the label.visible
- if true, makes the label is visible, otherwise, hides the label.public void setLabelVisible(java.lang.String attributeName, boolean visible, java.awt.Color fontColor, java.awt.Font font)
GeographyLayer
setLabelVisible
in interface GeographyLayer
attributeName
- the specified attribute used as the label.visible
- if true, makes the label is visible;otherwise, hides the label.fontColor
- a Color object used to render the label.font
- a Font object used to render the label.public void setLayerComplexStyle(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)
GeographyLayer
setLayerComplexStyle
in interface GeographyLayer
strokeColor
- the color of the stroke.fillColor
- the color used to fill the geometric shape.width
- the width of the stroke.alpha
- the alpha value used to fill the geometric shape.needText
- defines if the label should be displayed.font
- the font used by the label.fontColor
- the color of the font.property
- the name of the property, which you want to be displayed as labels.public void setScaleFactor(int scaleFactor)
GeographyLayer
There is a private property named scale factor in layer object. The property is used to determine whether the layer can be visible under the current scale of the map. If the factor is more than current scale of the map, the layer will be visible if it has the visibility permission at the same time. Otherwise the layer will be invisible. For example:
If we set the scale factor as 10000 by invoking the method GeographyLayer.setScaleFactor(int)
, and the current scale of the
map is 1:20000, and the layer has the visibility permission, the layer will be invisible.Otherwise,is the factor
is changed to 30000, the layer will be visible.
setScaleFactor
in interface GeographyLayer
scaleFactor
- the scale factor you want to set.GeographyLayer.isVisible()
,
GeographyLayer.setVisible(boolean)
,
GeographyLayer.setVisibilityPermission(boolean)
,
GeographyLayer.isPermittedVisible()
,
GeographyLayer.getScaleFactor()
,
GeographyLayer.setScaleVisible(boolean)
,
GeographyLayer.isScaleVisible()
public void setScaleVisible(boolean value)
GeographyLayer
By default, a GeographyLayer object monitor the changing of the scale of a map. The layer will be set visible or invisible automatically by comparing current scale of the map and the scale factor of the layer. If you want to monitor the changing of the scale of a map or the changing of the scale factor of a layer, don't forget to artificially invoke setScaleVisible after comparing the scale of the map and the scale factor of the layer.
setScaleVisible
in interface GeographyLayer
value
- the specified scale factor.GeographyLayer.isVisible()
,
GeographyLayer.setVisible(boolean)
,
GeographyLayer.setVisibilityPermission(boolean)
,
GeographyLayer.isPermittedVisible()
,
GeographyLayer.setScaleFactor(int)
,
GeographyLayer.getScaleFactor()
,
GeographyLayer.isScaleVisible()
public void setStrokeColor(java.awt.Color strokeColor)
GeographyLayer
setStrokeColor
in interface GeographyLayer
strokeColor
- the specified stroke color used to paint the layerpublic void setStrokeWidth(double strokeWidth)
GeographyLayer
setStrokeWidth
in interface GeographyLayer
strokeWidth
- the specified width.public void setVisibilityPermission(boolean value)
GeographyLayer
There are two factors influencing the visibility of the layer. One is the visibility permission, and the other is
scale factorGeographyLayer.setScaleFactor(int)
. The following table explains the relationships between the factors and the
layer's visibility. If the layer gets the permission and the scale of the map is smaller than the layer's
scaleFactor, the layer will be visible.
-------------------------------------------------------- | isLayerVisible | isPermittedVisible | isScaleVisible | -------------------------------------------------------- | TRUE | TRUE | TRUE | -------------------------------------------------------- | FALSE | FALSE | TRUE | -------------------------------------------------------- | FALSE | TRUE | FALSE | -------------------------------------------------------- | FALSE | FALSE | FALSE | --------------------------------------------------------
setVisibilityPermission
in interface GeographyLayer
value
- the permission value.GeographyLayer.isVisible()
,
GeographyLayer.setVisible(boolean)
,
GeographyLayer.isPermittedVisible()
,
GeographyLayer.setScaleFactor(int)
,
GeographyLayer.getScaleFactor()
,
GeographyLayer.setScaleVisible(boolean)
,
GeographyLayer.isScaleVisible()
public void setVisible(boolean value)
GeographyLayer
setVisible
in interface GeographyLayer
value
- true if you want to set the layer visible, false otherwise.GeographyLayer.isVisible()
,
GeographyLayer.setVisibilityPermission(boolean)
,
GeographyLayer.isPermittedVisible()
,
GeographyLayer.setScaleFactor(int)
,
GeographyLayer.getScaleFactor()
,
GeographyLayer.setScaleVisible(boolean)
,
GeographyLayer.isScaleVisible()
public void updateDisplay()
GeographyLayer
updateDisplay
in interface GeographyLayer
public void setLayerComplexStyle(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)
GeographyLayer
setLayerComplexStyle
in interface GeographyLayer
strokeColor
- the color of the stroke.fillColor
- the color used to fill the geometric shape.width
- the width of the stroke.alpha
- the alpha value used to fill the geometric shape.needText
- defines if the label should be displayed.font
- the font used by the label.fontColor
- the color of the font.withHalo
- defines if the label has a halohaloColor
- specify the color used to render the label's haloproperty
- the name of the property, which you want to be displayed as labels.public void setLayerBounds(double minLongitude, double minLatitude, double maxLongitude, double maxLatitude)
setLayerBounds
in interface GeographyLayer
|
|||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |