Class LayerSettingGrid
- java.lang.Object
-
- com.supermap.mapping.LayerSetting
-
- com.supermap.mapping.LayerSettingGrid
-
public class LayerSettingGrid extends LayerSetting
Rhithers. Decision Rhitherges Rhithers. Rhitherite Rhithers. Rhitherite Rhitherd Rhithers. Rhither Rh.This class is used to set the display style of the raster layer, to get and set the special values of the raster layer, the color of the special value, and whether the special value is transparent. Grid layer corresponds to normal layer. It is style setting instance can be acquired from
Layer.getAdditionalSetting()
. You can also create a new object and set through theLayer.setAdditionalSetting(LayerSetting)
method. After modifying the layer display, you need to call the methodMap.refresh()
to refresh the map.Raster data structure, also known as the grid structure, is a two-dimensional matrix to express spatial data or the distribution of data organization. Raster data is actually a cell array, Each cell represents specific geometric bounds and property of each cell represents the value of a specific geographic feature, such as elevation, aspect, etc. The color of the cell in the map represents the value of it. Display colors of cells will be the same if they have the same values. In addition, in SuperMap, usually with -9999 denote the meaningless data of the pixel, that is, no value.
-
-
Constructor Summary
Constructors Constructor and Description LayerSettingGrid()
Initializes a new instance of this LayerSettingGrid class.LayerSettingGrid(LayerSettingGrid layerSettingGrid)
Constructor.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method and Description int
getBrightness()
Returns the brightness of the raster layer which ranges from -100 to 100.int
getContrast()
Gets the brightness of the raster layer which ranges from -100 to 100.int
getOpaqueRate()
Gets the opacity of the Grid layer which ranges from 0 to 100, and 0 means the layer is transparent, while 100 means the layer is opaque.double
getSpecialValue()
Gst the special value of the grid layer.Color
getSpecialValueColor()
Gets color corresponding to the special value of the grid layer.LayerSettingType
getType()
Gets the type of the layer, inherited and overwritten based onLayerSetting.getType()
method.boolean
isSpecialValueTransparent()
Gets whether the special value for the grid layer will display in transparent.void
setBrightness(int brightness)
Sets the brightness of the raster layer which ranges from -100 to 100.void
setContrast(int contrast)
Gets the brightness of the raster layer which ranges from -100 to 100.void
setOpaqueRate(int opaqueRate)
Sets the opacity of the Grid layer which ranges from 0 to 100, and 0 means the layer is transparent, while 100 means the layer is opaque.void
setSpecialValue(double value)
Sets the special value of the grid layer.void
setSpecialValueColor(Color color)
Sets color corresponding to the special value of the grid layer.void
setSpecialValueTransparent(boolean specialValueTransparent)
Sets whether cells corresponding to the specified special value will display in transparent or not.
-
-
-
Constructor Detail
-
LayerSettingGrid
public LayerSettingGrid()
Initializes a new instance of this LayerSettingGrid class.
-
LayerSettingGrid
public LayerSettingGrid(LayerSettingGrid layerSettingGrid)
Constructor. Constructs a new instance according to the specified LayerSettingGrid object.- Parameters:
layerSettingGrid
- Specifies the LayerSettingGrid object
-
-
Method Detail
-
getType
public LayerSettingType getType()
Gets the type of the layer, inherited and overwritten based onLayerSetting.getType()
method.- Specified by:
getType
in classLayerSetting
- Returns:
- Returns the layer type
LayerSettingType
. If there is no associated layer, returns null.
-
getSpecialValueColor
public Color getSpecialValueColor()
Gets color corresponding to the special value of the grid layer.- Returns:
Color
Class, returns the corresponding color of the raster layer special value If the object is a new one, returns null.
-
setSpecialValueColor
public void setSpecialValueColor(Color color)
Sets color corresponding to the special value of the grid layer.When the specified special value is within the range displayed by the layer through
setSpecialValue(double)
, and the value is opaque, the value will display the specified color.setSpecialValueTransparent(boolean)
can be used to set whether the special value is to be displayed transparently.- Parameters:
color
- Need to set the color
-
getSpecialValue
public double getSpecialValue()
Gst the special value of the grid layer.- Returns:
- double type, returns the special value currently specified by the raster layer; the default value is -9999 (no value)
-
setSpecialValue
public void setSpecialValue(double value)
Sets the special value of the grid layer. The special value is actually the attribute value of the cell, you can specify cells with attributes.- Parameters:
value
- double type, need to set the special value
-
isSpecialValueTransparent
public boolean isSpecialValueTransparent()
Gets whether the special value for the grid layer will display in transparent.- Returns:
- boolean type, return to the current transparent display; default opaque, that is, return false
-
setSpecialValueTransparent
public void setSpecialValueTransparent(boolean specialValueTransparent)
Sets whether cells corresponding to the specified special value will display in transparent or not.- Parameters:
specialValueTransparent
- boolean type, indicating whether the transparent display. When set to true, the cells corresponding to the special value will transparently display and the color set bysetSpecialValueColor(Color)
will not take effect.
-
getBrightness
public int getBrightness()
Returns the brightness of the raster layer which ranges from -100 to 100. A positive value means to increase the brightness while a negative value means to decrease the brightness.- Returns:
- Returns the brightness of the raster layer
-
setBrightness
public void setBrightness(int brightness)
Sets the brightness of the raster layer which ranges from -100 to 100. A positive value means to increase the brightness while a negative value means to decrease the brightness.- Parameters:
brightness
- denotes the brightness
-
getContrast
public int getContrast()
Gets the brightness of the raster layer which ranges from -100 to 100. A positive value means to increase the brightness while a negative value means to decrease the brightness.- Returns:
- Gets the brightness of the raster layer
-
setContrast
public void setContrast(int contrast)
Gets the brightness of the raster layer which ranges from -100 to 100. A positive value means to increase the brightness while a negative value means to decrease the brightness.- Parameters:
contrast
- denotes the contrast
-
getOpaqueRate
public int getOpaqueRate()
Gets the opacity of the Grid layer which ranges from 0 to 100, and 0 means the layer is transparent, while 100 means the layer is opaque. It works on a raster layer only- Returns:
- Gets the opacity of the Grid layer
-
setOpaqueRate
public void setOpaqueRate(int opaqueRate)
Sets the opacity of the Grid layer which ranges from 0 to 100, and 0 means the layer is transparent, while 100 means the layer is opaque. It works on a raster layer only- Parameters:
opaqueRate
- the opacity value
-
-