com.supermap.realspace
类 Theme3DLabel
- java.lang.Object
-
- com.supermap.data.InternalHandle
-
- com.supermap.data.InternalHandleDisposable
-
- com.supermap.realspace.Theme3D
-
- com.supermap.realspace.Theme3DLabel
-
- 所有已实现的接口:
- IDisposable
public class Theme3DLabel extends Theme3D
三维标签专题图类。三维标签专题图用文本的形式在三维图层上直接显示属性表中的数据,其实质就是对图层的标注。三维标签专题图的标注可以是数字、字母与文字,例如:河流、湖泊、海洋、山脉、城镇、村庄等地理名称,高程、等值线数值、河流流速、公路段里程、航海线里程等。支持粗体、斜体、加下划线和加删除线的文字扩展。在三维标签专题图中,你可以为所有的标签都设置统一的显示风格来显示。
- 示范代码:
- 以下代码示范了如何制作三维标签专题图,并显示在三维场景中。
public void TestThemeLabel3D(DatasetVector targetDataset, String labelExpression, Scene sceneObject) { // 进行三维场景的设置 sceneObject.getAtmosphere().setVisible(true); // 生成三维标签专题图并显示在三维场景中 Theme3DLabel theme3DLabel = new Theme3DLabel(); theme3DLabel.setLabelExpression(labelExpression); TextStyle textStyle = new TextStyle(); textStyle.setForeColor(Color.PINK); textStyle.setFontScale(0.8); textStyle.setOpaqueRate(70); theme3DLabel.setUniformStyle(textStyle); Layer3DDataset layer3DDatasetLabel = sceneObject.getLayers().add( targetDataset, themeLabel3D, true); layer3DDatasetLabel.updateData(); sceneObject.refresh(); }
-
-
构造器概要
构造器 构造器和说明 Theme3DLabel()
构造一个新的 Theme3DLabel 对象。Theme3DLabel(Theme3DLabel themeLabel3D)
根据给定的 Theme3DLabel 对象构造一个与其完全相同的新对象。
-
方法概要
所有方法 实例方法 具体方法 限定符和类型 方法和说明 void
dispose()
释放该对象所占用的资源。LabelCustomStyle
getCustomStyle()
String
getLabelExpression()
返回标注字段表达式。int
getNumericPrecision()
返回标签的小数值精度。TextStyle
getUniformStyle()
返回统一文本风格。boolean
isCustomStyle()
void
setCustomStyle(LabelCustomStyle labelValue)
void
setIsCustomStyle(boolean bcustom)
void
setLabelExpression(String value)
设置标注字段表达式。void
setNumericPrecision(int value)
设置标签的小数值精度。void
setUniformStyle(TextStyle style)
设置统一文本风格。String
toString()
输出三维专题图格式化字符串。-
从类继承的方法 com.supermap.realspace.Theme3D
fromXML, getMemoryData, getType, setMemoryData, toXML
-
-
-
-
构造器详细资料
-
Theme3DLabel
public Theme3DLabel()
构造一个新的 Theme3DLabel 对象。
-
Theme3DLabel
public Theme3DLabel(Theme3DLabel themeLabel3D)
根据给定的 Theme3DLabel 对象构造一个与其完全相同的新对象。- 参数:
themeLabel3D
- 给定的 Theme3DLabel 对象。
-
-
方法详细资料
-
getLabelExpression
public String getLabelExpression()
返回标注字段表达式。- 返回:
- 标注字段表达式。
- 默认值:
- 默认值为一个空的字符串。
-
setLabelExpression
public void setLabelExpression(String value)
设置标注字段表达式。- 参数:
value
- 指定标注字段表达式。
-
getUniformStyle
public TextStyle getUniformStyle()
返回统一文本风格。目前三维标签专题图中的文本风格只支持颜色(ForeColor),缩放比例(FontScale)和透明度(OpaqueRate),其他的都不支持。
- 返回:
- 统一文本风格。
- 默认值:
- 默认值为 {Alignment=TopLeft,BackColor=Color [A=255, R=0, G=0,B=0],BackOpaque=False,Bold=False,FontHeight=6,FontWidth=0,ForeColor=Color [A=255, R=255, G=255,B=255],IsSizeFixed=False,Italic=False,Outline=False,Rotation=0,Shadow=False,Strikeout=False,Underline=False,Weight=0}。
-
setUniformStyle
public void setUniformStyle(TextStyle style)
设置统一文本风格。目前三维标签专题图中的文本风格只支持颜色(ForeColor),缩放比例(FontScale)和透明度(OpaqueRate),其他的都不支持。
- 参数:
style
- 指定统一文本风格。
-
getNumericPrecision
public int getNumericPrecision()
返回标签的小数值精度。- 返回:
- 返回标签的小数值精度。
-
setNumericPrecision
public void setNumericPrecision(int value)
设置标签的小数值精度。- 参数:
value
- 标签的小数值精度。
-
dispose
public void dispose()
释放该对象所占用的资源。当调用该方法之后,此对象不再可用。
-
setIsCustomStyle
public void setIsCustomStyle(boolean bcustom)
-
isCustomStyle
public boolean isCustomStyle()
-
getCustomStyle
public LabelCustomStyle getCustomStyle()
-
setCustomStyle
public void setCustomStyle(LabelCustomStyle labelValue)
-
-
Copyright © 2021–2024 SuperMap. All rights reserved.