com.supermap.data
类 SymbolMarker
- java.lang.Object
-
- com.supermap.data.InternalHandle
-
- com.supermap.data.InternalHandleDisposable
-
- com.supermap.data.Symbol
-
- com.supermap.data.SymbolMarker
-
- 所有已实现的接口:
- IDisposable
public class SymbolMarker extends Symbol
点状符号类。该类继承自符号基类,即
Symbol类。
-
-
构造器概要
构造器 构造器和说明 SymbolMarker()构造一个新的 SymbolMarker 对象。SymbolMarker(SymbolMarker symbolMarker)构造一个新的 SymbolMarker 对象。
-
方法概要
所有方法 静态方法 实例方法 具体方法 已过时的方法 限定符和类型 方法和说明 intadd(SymbolMarkerStroke stroke)添加点符号笔划intcomputeDisplaySize(int symbolSize)计算出传入的符号在显示时的大小。intcomputeSymbolSize(int displaySize)计算出传入的显示大小对应设置的符号大小。static GeometryconvertTextToRegion(GeoText text)已过时。11.2.0版本标记废弃,请使用{GeoText.convertToRegion(int segmentCount)}替换。
voiddispose()释放该对象所占用的资源。booleandraw(BufferedImage image, Geometry geometry)booleandraw(BufferedImage image, Point2Ds points, GeoStyle style)booleandraw(Graphics graphics, Geometry geometry)booleandraw(Graphics graphics, Point2Ds points, GeoStyle style)intfromGeometry(Geometry geometry, Rectangle2D bounds)将指定的几何对象导入成符号,如果为 GeoPicture 类型的则导入为栅格对象, GeoCompound 导入为多笔画的对象,其他的导入为矢量符号。intfromPicturePath(String picturePath)将指定的图片文件导入为点符号。intfromSVG(String svgFile)将指定的svg矢量图形文件导入为SVG矢量图形符号。SymbolMarkerStrokeget(int index)返回指定索引处的画笔。Point2DgetBasePoint()获取原点Rectangle2DgetBounds()获取点符号范围intgetCount()返回点符号对象的画笔总数。PointgetOrigin()返回符号的起始位置。intgetSize()获取点符号的sizeSymbolTypegetType()voidinsert(int index, SymbolMarkerStroke stroke)插入点符号笔划到索引位置booleanremove(int index)移除指定索引的点符号voidsetBasePoint(Point2D point)设置原点voidsetOrigin(Point value)设置返回符号的起始位置。voidsetSize(int value)设置点符号的sizeGeometrytoGeometry(Point2D center, double size)指定中心点和size,将点符号转为geometryGeometrytoGeometry(Rectangle2D rectangle2D)指定范围将点符号转为geometrybooleantoSVG(String svgFile)将矢量符号导出为svg矢量图形文件。-
从类继承的方法 com.supermap.data.Symbol
compare, createInstance, equal, getID, getLibrary, getName, setID, setName, toString
-
-
-
-
构造器详细资料
-
SymbolMarker
public SymbolMarker()
构造一个新的 SymbolMarker 对象。
-
SymbolMarker
public SymbolMarker(SymbolMarker symbolMarker)
构造一个新的 SymbolMarker 对象。- 参数:
symbolMarker- 用于拷贝的SymbolMarker对象
-
-
方法详细资料
-
draw
public boolean draw(BufferedImage image, Geometry geometry)
-
draw
public boolean draw(BufferedImage image, Point2Ds points, GeoStyle style)
-
computeDisplaySize
public int computeDisplaySize(int symbolSize)
计算出传入的符号在显示时的大小。- 参数:
symbolSize- 设置的符号大小。该参数小于等于零时抛异常。- 返回:
- 转换出的显示大小。
-
computeSymbolSize
public int computeSymbolSize(int displaySize)
计算出传入的显示大小对应设置的符号大小。- 参数:
displaySize- 指定的显示大小,该参数小于等于零时抛异常。- 返回:
- 转换出的符号大小。
-
dispose
public void dispose()
释放该对象所占用的资源。当调用该方法之后,此对象不再可用。
-
fromGeometry
public int fromGeometry(Geometry geometry, Rectangle2D bounds)
将指定的几何对象导入成符号,如果为 GeoPicture 类型的则导入为栅格对象, GeoCompound 导入为多笔画的对象,其他的导入为矢量符号。如果设置 symbolBounds 为整个符号所占的范围, 几何对象的 Bounds 控制几何对象在符号中的位置与缩放关系。如果需要设置几何对象填充整个符号,则 symbolBounds 可传入几何对象的 Bounds。
- 参数:
geometry- 要导入的几何对象。bounds- 导入之后生成符号的范围。- 返回:
- 导入的几何对象 ID。
-
getType
public SymbolType getType()
-
getOrigin
public Point getOrigin()
返回符号的起始位置。- 返回:
- 符号的起始位置。
-
setOrigin
public void setOrigin(Point value)
设置返回符号的起始位置。- 参数:
point- 符号的起始位置。
-
get
public SymbolMarkerStroke get(int index)
返回指定索引处的画笔。- 参数:
index- 指定索引。- 返回:
- 指定索引处的画笔。
-
getCount
public int getCount()
返回点符号对象的画笔总数。- 返回:
- 点符号对象的画笔总数。
-
fromSVG
public int fromSVG(String svgFile)
将指定的svg矢量图形文件导入为SVG矢量图形符号。- 参数:
svgFile- 指定导入的svg矢量图形文件的全路径。- 返回:
- 返回符号的ID。
-
toSVG
public boolean toSVG(String svgFile)
将矢量符号导出为svg矢量图形文件。- 参数:
svgFile- 指定导出的svg矢量图形文件的全路径。- 返回:
- 导出成功返回true;否则,返回false。
-
add
public int add(SymbolMarkerStroke stroke)
添加点符号笔划- 参数:
stroke- 点符号笔划- 返回:
- 笔划的索引值
- 抛出:
IllegalStateException- 当前对象已被释放IllegalArgumentException- 参数不合法- 从以下版本开始:
-
fromPicturePath
public int fromPicturePath(String picturePath)
将指定的图片文件导入为点符号。- 参数:
picturePath- 图片文件路径- 返回:
- 生成的点符号id
- 抛出:
IllegalStateException- 当前对象已被释放IllegalArgumentException- 参数不合法- 从以下版本开始:
-
insert
public void insert(int index, SymbolMarkerStroke stroke)插入点符号笔划到索引位置- 参数:
index- 索引值stroke- 点符号笔划- 抛出:
IllegalStateException- 当前对象已被释放IllegalArgumentException- 参数不合法
-
remove
public boolean remove(int index)
移除指定索引的点符号- 参数:
index- 索引值- 返回:
- 是否成功移除
- 抛出:
IllegalStateException- 当前对象已被释放IllegalArgumentException- 参数不合法
-
setBasePoint
public void setBasePoint(Point2D point)
设置原点- 参数:
point- 原点- 抛出:
IllegalStateException- 当前对象已被释放IllegalArgumentException- 参数不合法
-
getBasePoint
public Point2D getBasePoint()
获取原点- 返回:
- 原点
- 抛出:
IllegalStateException- 当前对象已被释放
-
getBounds
public Rectangle2D getBounds()
获取点符号范围- 返回:
- 范围
- 抛出:
IllegalStateException- 当前对象已被释放
-
convertTextToRegion
@Deprecated public static Geometry convertTextToRegion(GeoText text)
已过时。11.2.0版本标记废弃,请使用{GeoText.convertToRegion(int segmentCount)}替换。
将文本对象转换成面对象(已废弃)。- 参数:
text- 文本对象。- 返回:
- 转换后的面对象。
-
toGeometry
public Geometry toGeometry(Rectangle2D rectangle2D)
指定范围将点符号转为geometry- 参数:
rectangle2D- 指定范围- 返回:
- geometry对象
- 抛出:
IllegalStateException- 当前对象已被释放
-
toGeometry
public Geometry toGeometry(Point2D center, double size)
指定中心点和size,将点符号转为geometry- 参数:
center- 中心点size- 点符号的size- 返回:
- geometry对象
- 抛出:
IllegalStateException- 当前对象已被释放
-
getSize
public int getSize()
获取点符号的size- 返回:
- 点符号的size
- 抛出:
IllegalStateException- 当前对象已被释放
-
setSize
public void setSize(int value)
设置点符号的size- 参数:
value- 点符号的size- 抛出:
IllegalStateException- 当前对象已被释放
-
-
Copyright © 2021–2025 SuperMap. All rights reserved.