|
|||||||||
上一个类 下一个类 | 框架 无框架 | ||||||||
摘要: 嵌套 | 字段 | 构造方法 | 方法 | 详细信息: 字段 | 构造方法 | 方法 |
java.lang.Object com.supermap.mapping.LayerSetting com.supermap.mapping.LayerSettingGrid
public class LayerSettingGrid
栅格图层设置类。
图层分为普通图层和专题图层,栅格图层设置是针对普通图层而言的。栅格图层采用颜色表来显示其像元,
普通图层的风格通过 Layer.getAdditionalSetting()
和 Layer.setAdditionalSetting()
方法来返回或设置。SuperMap 的颜色表是按照 8 比特的 RGB 彩色坐标系来显示像元的,您可以根据像元的属性值来设置其显示颜色值,从而形象直观地表示栅格数据反映的现象。
假设打开了一个工作空间 workspace
对象,工作空间中存在一个数据源 datasource 对象,该数据源中存在一个名为 DEM 的数据集。地图对象 map 已关联 workspace。
public void layerSettingGridTest() { // 返回名称为 DEM 的栅格数据集 DatasetGrid dataset = (DatasetGrid) datasource.getDatasets().get("DEM"); Layer layer1 = m_mapControl.getMap().getLayers().add(dataset, true); // 构造一个 Colors 对象并将各种颜色值添加到其中 Colors colors = new Colors(); colors.add(java.awt.Color.blue); colors.add(java.awt.Color.black); colors.add(java.awt.Color.gray); colors.add(java.awt.Color.orange); // 构造一个 LayerSettingGrid 对象,并设置颜色表和无值数据的颜色 LayerSettingGrid layerSettingGrid = new LayerSettingGrid(); layerSettingGrid.setColorTable(colors); layerSettingGrid.setSpecialValueColor(java.awt.Color.pink); layerSettingGrid.setOpaqueRate(100); // 得到图层并设置图层的样式风格 layer1.setAdditionalSetting(layerSettingGrid); // 刷新地图 map.refresh(); // 保存地图为 GRID,保存工作空间 workspace.getMaps().add(workspace.getMaps().getAvailableMapName("grid"), map.toXML()); workspace.save(); // 释放资源 map.dispose(); dataset.close(); }
构造方法摘要 | |
---|---|
LayerSettingGrid()
默认构造函数,构造一个新的 LayerSettingGrid 对象。 |
|
LayerSettingGrid(LayerSettingGrid layerSettingGrid)
根据已存在的栅格图层设置类的对象来构造一个新的栅格图层设置类的对象。 |
方法摘要 | |
---|---|
int |
getBrightness()
返回 Grid 图层的亮度,值域范围为 -100 到 100,增加亮度为正,降低亮度为负。 |
ColorDictionary |
getColorDictionary()
返回图层的颜色对照表。 |
Colors |
getColorTable()
返回颜色表。 |
int |
getContrast()
返回 Grid 图层的对比度,值域范围为 -100 到 100,增加对比度为正,降低对比度为负。 |
ImageInterpolationMode |
getImageInterpolationMode()
返回显示图像时使用的插值算法。 |
int |
getOpaqueRate()
返回 Grid 图层显示不透明度。 |
double |
getSpecialValue()
返回图层的特殊值。 |
java.awt.Color |
getSpecialValueColor()
返回栅格数据集特殊值数据的颜色。 |
LayerSettingType |
getType()
返回此图层的类型。 |
boolean |
isSpecialValueTransparent()
返回图层的特殊值(SpecialValue)所处区域是否透明。 |
void |
setBrightness(int value)
设置 Grid 图层的亮度,值域范围为 -100 到 100,增加亮度为正,降低亮度为负。 |
void |
setColorDictionary(ColorDictionary clrDict)
设置图层的颜色对照表。 |
void |
setColorTable(Colors colorTable)
设置颜色表。 |
void |
setContrast(int value)
设置 Grid 图层的对比度,值域范围为 -100 到 100,增加对比度为正,降低对比度为负。 |
void |
setImageInterpolationMode(ImageInterpolationMode value)
设置显示图像时使用的插值算法。 |
void |
setOpaqueRate(int value)
设置 Grid 图层显示的不透明度。 |
void |
setSpecialValue(double value)
设置图层的特殊值。 |
void |
setSpecialValueColor(java.awt.Color value)
设置栅格数据集特殊值数据的颜色。 |
void |
setSpecialValueTransparent(boolean value)
设置图层的特殊值(SpecialValue)所处区域是否透明。 |
从类 java.lang.Object 继承的方法 |
---|
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
构造方法详细信息 |
---|
public LayerSettingGrid()
LayerSettingGrid
对象。
public LayerSettingGrid(LayerSettingGrid layerSettingGrid)
layerSettingGrid
- 指定的栅格图层设置类对象。方法详细信息 |
---|
public LayerSettingType getType()
LayerSetting
中的 getType
public Colors getColorTable()
public void setColorTable(Colors colorTable)
colorTable
- 颜色表。public java.awt.Color getSpecialValueColor()
public void setSpecialValueColor(java.awt.Color value)
value
- 栅格数据集特殊值数据的颜色。public double getSpecialValue()
在新增一个 Grid 图层时,该方法的返回值与数据集的 NoValue 属性值相等。
public void setSpecialValue(double value)
value
- 图层的特殊值。public int getBrightness()
public void setBrightness(int value)
value
- Grid 图层的亮度。public int getContrast()
public void setContrast(int value)
value
- Grid 图层的对比度。public int getOpaqueRate()
public void setOpaqueRate(int value)
value
- Grid 图层显示的不透明度。public boolean isSpecialValueTransparent()
public void setSpecialValueTransparent(boolean value)
value
- 图层的特殊值(SpecialValue)所处区域是否透明。public void setColorDictionary(ColorDictionary clrDict)
clrDict
- 用于指定图层的颜色对照表。public ColorDictionary getColorDictionary()
支持对获取的颜色对照表的颜色值和高程值灵活的编辑。
注意:在图层中如果没有设置颜色对照表,显示前把颜色表转换成颜色对照表,在图层显示时如果颜色表与颜色对照表相同,以颜色表显示,如果不同,以颜色对照表方式显示。
对颜色表的编辑不再影响图层的显示,图层的显示效果由颜色对照表控制。
public void setImageInterpolationMode(ImageInterpolationMode value)
value
- 指定的插值算法。public ImageInterpolationMode getImageInterpolationMode()
|
|||||||||
上一个类 下一个类 | 框架 无框架 | ||||||||
摘要: 嵌套 | 字段 | 构造方法 | 方法 | 详细信息: 字段 | 构造方法 | 方法 |