Class GeoGraphicObject
- java.lang.Object
-
- com.supermap.data.Geometry
-
- com.supermap.plot.GeoGraphicObject
-
public class GeoGraphicObject extends Geometry
The GeoGraphicObject derived from the
Geometry
class.The GeoGraphicObject class is used to represent drawn graphic object, which stores the control points, position, and shapes while a user draws a graphic object. While drawing graphic objects, you can add controls points by gestures. Meanwhile, the styles of drawn graphic objects can be changed just as basic geographic objects.
GeoStyle
The symbol information of the drawn graphic objects is stored in a symbol library, such as .plot used now. Each symbol library file has a symbol library id. Each symbol has a symbol code. Through the two parameters, you can find the corresponding symbol in the library ans display it on the map.The drawn graphic objects can be classified into two categories: marker symbols and line symbols (algorithm symbols).
Marker symbols contains only one control point used to determine the position. The control point is under the symbol and employ the align bottom alignment method.
Line symbols can also be called algorithm symbols, which contain more than one control points. The shape of the symbol will change when the positions of the control points are different. While editing, the shape of the symbols are controlled by the positions of the control points. Shapes of almost all line symbols are determined by specific algorithms, such as the arrow symbols.
Note: About application of geographic drawing, please refer to
GeometryType.GEOGRAPHICOBJECT
,MapControl.addPlotLibrary(String)
,MapControl.setPlotSymbol(long, long)
.
-
-
Constructor Summary
Constructors Constructor and Description GeoGraphicObject()
Default constructor, without parameters, initializes a new instance of GeoGraphicObject.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method and Description GeoGraphicObject
clone()
Copies an object.void
dispose()
Recycle this objectboolean
fromGeoJSON(java.lang.String geoJSON)
Get Geometry from GeoJSON style stringMarkPos
getAnnotationPosition()
Get annotation positionlong
getCode()
Gets code corresponding to the symbol.long
getLibraryID()
Gets ID of symbol library where the symbol is.boolean
getLimitWidthHeight()
Gets 2D point symbol whether lock aspect ratiojava.lang.String
getName()
Gets the name of the symbol in the symbol library.boolean
getNegativeImage()
Get point symbol nagative imagePoint2Ds
getPositionPoints()
Get 2D position point arrayPoint2D
getRotate2D()
Get 2D symbol rotation angle of vector modeboolean
getScaleByMap()
Gets point symbol whether zoomed with mapSubSymbol[]
getSubSymbols()
Get subsymbol arrayColor
getSurroundLineColor()
Gets 2D surround line colorboolean
getSurroundLineFlag()
Get whether is surround line flagSurroundLineType
getSurroundLineType()
Get surround line typedouble
getSurroundLineWidth2D()
Gets 2D surround line widthint
getSymbolRank()
Get symbol levelint[]
getSymbolRanks()
Gets symbol including list of levelSize2D
getSymbolSize()
Get symbol sizeGraphicObjectType
getSymbolType()
Get symbol typejava.lang.String
getTextContent()
Get text contentTextStyle
getTextStyle2D()
Get 2D text stylevoid
setAnnotationPosition(MarkPos annotationPosition)
Set annotation positionvoid
setGeometryShape(long libID, long symbolCode, Point2Ds pts)
Set the type and coordinates of the plot object, to create specific plot objectvoid
setLimitWidthHeight(boolean limitWidthHeight)
Sets 2D point symbol whether lock aspect ratiovoid
setNegativeImage(boolean negativeImage)
Set symbol negative imagevoid
setPositionPoints(Point2Ds positionPoints)
Set 2D position point arrayvoid
setRotate2D(Point2D rotate2D)
Set 2D symbol rotation angle of vector modevoid
setScaleByMap(boolean scaleByMap)
Sets point symbol whether zoomed with mapvoid
setSubSymbols(int index, SubSymbol symbol)
Set subsymbol arrayvoid
setSurroundLineColor(Color surroundLineColor)
Sets surround line colorvoid
setSurroundLineFlag(boolean surroundLineFlag)
Set whether is surround line flagvoid
setSurroundLineType(SurroundLineType surroundLineType)
Set surround line typevoid
setSurroundLineWidth2D(double surroundLineWidth2D)
Set surround line widthvoid
setSymbolRank(int symbolRank)
Set symbol levelvoid
setSymbolSize(Size2D value)
Set symbol sizevoid
setTextContent(java.lang.String textContent)
Set text contentvoid
setTextStyle2D(TextStyle textStyle2D)
Set 2D text stylejava.lang.String
toGeoJSON()
change Geometry to string in GeoJSON style
-
-
-
Constructor Detail
-
GeoGraphicObject
public GeoGraphicObject()
Default constructor, without parameters, initializes a new instance of GeoGraphicObject.
-
-
Method Detail
-
clone
public GeoGraphicObject clone()
Copies an object.
-
getCode
public long getCode()
Gets code corresponding to the symbol.- Returns:
- Symbol Code.
-
getLibraryID
public long getLibraryID()
Gets ID of symbol library where the symbol is.- Returns:
- The symbol library ID.
-
getName
public java.lang.String getName()
Gets the name of the symbol in the symbol library.- Returns:
- The name of the symbol.
-
setGeometryShape
public void setGeometryShape(long libID, long symbolCode, Point2Ds pts)
Set the type and coordinates of the plot object, to create specific plot object- Parameters:
libID
- lib IDsymbolCode
- symbol Codepts
- plot symbol coordinate string. Point plotting symbol has only one coordinate point
-
toGeoJSON
public java.lang.String toGeoJSON()
change Geometry to string in GeoJSON style
-
fromGeoJSON
public boolean fromGeoJSON(java.lang.String geoJSON)
Get Geometry from GeoJSON style string- Overrides:
fromGeoJSON
in classGeometry
- Parameters:
geoJSON
- GeoJSON string- Returns:
- return whether change successfully
-
getTextStyle2D
public TextStyle getTextStyle2D()
Get 2D text style- Parameters:
- -
- Returns:
- Get 2D text style
-
setTextStyle2D
public void setTextStyle2D(TextStyle textStyle2D)
Set 2D text style- Parameters:
textStyle2D
- Set 2D text style
-
getSymbolType
public GraphicObjectType getSymbolType()
Get symbol type- Returns:
- symbol type
-
getNegativeImage
public boolean getNegativeImage()
Get point symbol nagative image- Returns:
- whether display symbol negative image
-
setNegativeImage
public void setNegativeImage(boolean negativeImage)
Set symbol negative image- Parameters:
negativeImage
- whether display symbol negative image
-
getSymbolRank
public int getSymbolRank()
Get symbol level- Returns:
- symbol level
-
setSymbolRank
public void setSymbolRank(int symbolRank)
Set symbol level- Parameters:
symbolRank
- symbol level
-
getScaleByMap
public boolean getScaleByMap()
Gets point symbol whether zoomed with map- Returns:
- whether zoomed with map
-
setScaleByMap
public void setScaleByMap(boolean scaleByMap)
Sets point symbol whether zoomed with map- Parameters:
scaleByMap
- whether zoomed with map
-
getLimitWidthHeight
public boolean getLimitWidthHeight()
Gets 2D point symbol whether lock aspect ratio- Returns:
- whether lock aspect ratio
-
setLimitWidthHeight
public void setLimitWidthHeight(boolean limitWidthHeight)
Sets 2D point symbol whether lock aspect ratio- Parameters:
limitWidthHeight
- whether lock aspect ratio
-
getSurroundLineType
public SurroundLineType getSurroundLineType()
Get surround line type- Returns:
- surround line type
-
setSurroundLineType
public void setSurroundLineType(SurroundLineType surroundLineType)
Set surround line type- Parameters:
surroundLineType
- surround line type
-
getSurroundLineWidth2D
public double getSurroundLineWidth2D()
Gets 2D surround line width- Returns:
- surround line width
-
setSurroundLineWidth2D
public void setSurroundLineWidth2D(double surroundLineWidth2D)
Set surround line width- Parameters:
surroundLineWidth2D
- surround line width
-
getSurroundLineColor
public Color getSurroundLineColor()
Gets 2D surround line color- Returns:
- surround line color
-
setSurroundLineColor
public void setSurroundLineColor(Color surroundLineColor)
Sets surround line color- Parameters:
surroundLineColor
- surround line color
-
getTextContent
public java.lang.String getTextContent()
Get text content- Returns:
- text content
-
setTextContent
public void setTextContent(java.lang.String textContent)
Set text content- Parameters:
textContent
- text content
-
getAnnotationPosition
public MarkPos getAnnotationPosition()
Get annotation position- Returns:
- annotation position
-
setAnnotationPosition
public void setAnnotationPosition(MarkPos annotationPosition)
Set annotation position- Parameters:
annotationPosition
- annotation position
-
getSurroundLineFlag
public boolean getSurroundLineFlag()
Get whether is surround line flag- Returns:
- whether is surround line flag
-
setSurroundLineFlag
public void setSurroundLineFlag(boolean surroundLineFlag)
Set whether is surround line flag- Parameters:
surroundLineFlag
- whether is surround line flag
-
getPositionPoints
public Point2Ds getPositionPoints()
Get 2D position point array- Returns:
- 2D position point array
-
setPositionPoints
public void setPositionPoints(Point2Ds positionPoints)
Set 2D position point array- Parameters:
positionPoints
- 2D position point array
-
getSubSymbols
public SubSymbol[] getSubSymbols()
Get subsymbol array- Returns:
- subsymbol array
-
setSubSymbols
public void setSubSymbols(int index, SubSymbol symbol)
Set subsymbol array- Parameters:
index
- subsymbol indexsymbol
- subsymbol
-
getSymbolRanks
public int[] getSymbolRanks()
Gets symbol including list of level- Returns:
- list of level
-
getSymbolSize
public Size2D getSymbolSize()
Get symbol size- Returns:
- symbol size
-
setSymbolSize
public void setSymbolSize(Size2D value)
Set symbol size- Parameters:
value
- symbol size
-
getRotate2D
public Point2D getRotate2D()
Get 2D symbol rotation angle of vector mode- Returns:
- rotation angle
-
setRotate2D
public void setRotate2D(Point2D rotate2D)
Set 2D symbol rotation angle of vector mode- Parameters:
rotate2D
- rotation angle
-
-