com.supermap.data
Class GeoText3D
- java.lang.Object
-
- com.supermap.data.Geometry
-
- com.supermap.data.Geometry3D
-
- com.supermap.data.GeoText3D
-
public class GeoText3D extends Geometry3D
The GeoText class derives from the
Geometry3D
class. This class is mainly used to label the geographical features and make necessary descriptions for them. A GeoText object is composed of one or more parts, each part is called a subobject of the GeoText object, each subobject is a instance ofTextPart3D
. All the parts of a GeoText object apply the same style, namely they are all displayed with the text style of this GeoText.
-
-
Constructor Summary
Constructors Constructor and Description GeoText3D()
Constructs a new GeoText3D object.GeoText3D(GeoText3D geoText3D)
Initializes a new instance according to the specified GeoText3D object.GeoText3D(TextPart3D part)
Creates a new GeoText object according to the specified arguments.GeoText3D(TextPart3D part, TextStyle textStyle)
Creates a new GeoText3D object according to the specified arguments.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method and Description int
addPart(TextPart3D part)
Deletes the parts of GeoText with the specified index.GeoText3D
clone()
Returns a copy of the current GeoText3D object.void
dispose()
Release the resource occupy by this object.TextPart3D
getPart(int index)
Deletes the parts of GeoText with the specified index.int
getPartCount()
Returns the count of parts of the GeoText object.java.lang.String
getText()
Returns the content of the GeoText object.TextStyle
getTextStyle()
Returns the text style of the GeoText3D object.int
indexOf(TextPart3D part)
Returns the index of the specified child object in the text object.boolean
insertPart(int index, TextPart3D part)
Inserts a TextPart object in the GeoText object at the specified index.boolean
isEmpty()
Determines whether the GeoText3D object is empty, that is it has on subobjects.boolean
removePart(int index)
Removes the parts of GeoText with the specified index.void
setEmpty()
Set the content of the current GeoText3D object to be null.boolean
setPart(int index, TextPart3D part)
Modify the part of the GeoText object with the specified index, that is replace the original part with new part.void
setTextStyle(TextStyle textStyle)
Sets the text style of the GeoText object.-
Methods inherited from class com.supermap.data.Geometry3D
getGeoModel, getInnerPoint3D, getPosition, getRotationX, getRotationY, getRotationZ, getScaleX, getScaleY, getScaleZ, getStyle3D, getVolume, offset, setPosition, setRotationX, setRotationY, setRotationZ, setScaleX, setScaleY, setScaleZ, setStyle3D
-
-
-
-
Constructor Detail
-
GeoText3D
public GeoText3D()
Constructs a new GeoText3D object.
-
GeoText3D
public GeoText3D(GeoText3D geoText3D)
Initializes a new instance according to the specified GeoText3D object.- Parameters:
geoText3D
- The specified GeoText3D object.
-
GeoText3D
public GeoText3D(TextPart3D part)
Creates a new GeoText object according to the specified arguments.- Parameters:
part
- TextPart3D- See Also:
Subobject
-
GeoText3D
public GeoText3D(TextPart3D part, TextStyle textStyle)
Creates a new GeoText3D object according to the specified arguments.- Parameters:
part
- The specified GeoText3D.textStyle
- The textStyle object specified.
-
-
Method Detail
-
getText
public java.lang.String getText()
Returns the content of the GeoText object. If the GeoText has multiple parts, its value will be the sum of the strings of all the parts.- Returns:
- The content of the text object.
- Default:
- The default is a null string.
-
getPartCount
public int getPartCount()
Returns the count of parts of the GeoText object. After being cleared, the count of the parts is 0.- Returns:
- The count of parts contained in the GeoText object.
- Default:
- The default value is 0.
-
getTextStyle
public TextStyle getTextStyle()
Returns the text style of the GeoText3D object. The TextStyle is used to specify the font, width, height and color of displaying the GeoText3D object.
-
setTextStyle
public void setTextStyle(TextStyle textStyle)
Sets the text style of the GeoText object. The TextStyle is used to specify the font, width, height and color of displaying the GeoText object.- Parameters:
textStyle
- The text style of the text object.- See Also:
TextStyle
-
isEmpty
public boolean isEmpty()
Determines whether the GeoText3D object is empty, that is it has on subobjects. The determine precision used is equal-zero precision by default. SeeEnvironment
.
-
addPart
public int addPart(TextPart3D part)
Deletes the parts of GeoText with the specified index.- Parameters:
part
- The subobject index.- Returns:
- The subobject with the specified index.
- Throws:
java.lang.IndexOutOfBoundsException
- If index is less than 0 or larger then the count of parts of the GeoText object.
-
getPart
public TextPart3D getPart(int index)
Deletes the parts of GeoText with the specified index.- Parameters:
index
- The subobject index.- Returns:
- The subobject with the specified index.
- Throws:
java.lang.IndexOutOfBoundsException
- If index is less than 0 or larger then the count of parts of the GeoText object.
-
insertPart
public boolean insertPart(int index, TextPart3D part)
Inserts a TextPart object in the GeoText object at the specified index.- Parameters:
index
- The index where the TextPart is to be inserted,specially, the index value is greater than zero and is less than the number of the parts of the GeoText objects.part
- The TextPart object to insert.- Returns:
- Returns true If successful; otherwise false.
- Throws:
java.lang.IndexOutOfBoundsException
- If index is less than 0 or larger then the count of parts of the GeoText object.- See Also:
addPart(TextPart3D)
,removePart(int)
-
indexOf
public int indexOf(TextPart3D part)
Returns the index of the specified child object in the text object.- Parameters:
part
- The specified subobject.- Returns:
- The index of the part.
-
removePart
public boolean removePart(int index)
Removes the parts of GeoText with the specified index.- Parameters:
index
- the parts of GeoText with the specified index.- Returns:
- returns true If successful; otherwise false.
- Throws:
java.lang.IndexOutOfBoundsException
- If index is less than 0 or larger then the count of parts of the GeoText object.
-
setPart
public boolean setPart(int index, TextPart3D part)
Modify the part of the GeoText object with the specified index, that is replace the original part with new part.- Parameters:
index
- the parts of GeoText with the specified index.part
- the parts of GeoText- Returns:
- true if the setting is successful, or false otherwise.
- Throws:
java.lang.IndexOutOfBoundsException
- If index is less than 0 or larger then the count of parts of the GeoText object.
-
clone
public GeoText3D clone()
Returns a copy of the current GeoText3D object.
-
setEmpty
public void setEmpty()
Set the content of the current GeoText3D object to be null.
-
-