Package com.luciad.shape
Interface ILcdText
- All Superinterfaces:
Cloneable
,ILcdBounded
,ILcdCloneable
,ILcdShape
,Serializable
- All Known Subinterfaces:
ILcd2DEditableText
- All Known Implementing Classes:
TLcdCGMText
,TLcdDGNDisplayableTag
,TLcdDGNText2D
,TLcdDWGText
,TLcdXYText
An
The text size is expressed in model units, for example 500 meters wide. As such, the text automatically scales with the map scale. For text that uses screen dimensions (for example, using a font size of 10pt), refer to the labeling API.
ILcdShape
representing a text string at a given position and with the given dimensions.The text size is expressed in model units, for example 500 meters wide. As such, the text automatically scales with the map scale. For text that uses screen dimensions (for example, using a font size of 10pt), refer to the labeling API.
Properties
A text object has the following characteristics:- a
text string
- a
location
- character
width
andheight
, in model units - a
rotation
, horizontal
andvertical
alignment (for multi-line text)
Alignment, location and rotation
The image below illustrates how to rotation, horizontal and vertical alignment is related to the text location. The dot represents thelocation
of your text, while the rectangle represents the bounds
or your text object.
-
Field Summary
Modifier and TypeFieldDescriptionstatic final int
Constant for bottom text alignment.static final int
Constant for center text alignment.static final int
Constant for left text alignment.static final int
Constant for right text alignment.static final int
Constant for top text alignment. -
Method Summary
Modifier and TypeMethodDescriptiondouble
Returns the height of the individual text characters.double
Returns the width of the individual text characters.int
Returns the horizontal alignment of the text.Returns the location of the text.double
Returns the angle over which this text is rotated.Returns the text string of the text.double
Returns the width of the entire text string.int
Returns the vertical alignment of the text.Methods inherited from interface com.luciad.shape.ILcdBounded
getBounds
Methods inherited from interface com.luciad.util.ILcdCloneable
clone
Methods inherited from interface com.luciad.shape.ILcdShape
contains2D, contains2D, contains3D, contains3D, getFocusPoint
-
Field Details
-
ALIGNMENT_LEFT
static final int ALIGNMENT_LEFTConstant for left text alignment. Seeclass javadoc
for an illustration.- See Also:
-
ALIGNMENT_CENTER
static final int ALIGNMENT_CENTERConstant for center text alignment. Seeclass javadoc
for an illustration.- See Also:
-
ALIGNMENT_RIGHT
static final int ALIGNMENT_RIGHTConstant for right text alignment. Seeclass javadoc
for an illustration.- See Also:
-
ALIGNMENT_TOP
static final int ALIGNMENT_TOPConstant for top text alignment. Seeclass javadoc
for an illustration.- See Also:
-
ALIGNMENT_BOTTOM
static final int ALIGNMENT_BOTTOMConstant for bottom text alignment. Seeclass javadoc
for an illustration.- See Also:
-
-
Method Details
-
getTextString
String getTextString()Returns the text string of the text.- Returns:
- the text string of the text.
-
getLocation
ILcdPoint getLocation()Returns the location of the text. Seeclass javadoc
for an illustration how this related to alignment.- Returns:
- the location of the text.
-
getTextWidth
double getTextWidth()Returns the width of the entire text string.- Returns:
- the width of the entire text string.
-
getCharacterWidth
double getCharacterWidth()Returns the width of the individual text characters.- Returns:
- the width of the individual text characters.
-
getCharacterHeight
double getCharacterHeight()Returns the height of the individual text characters.- Returns:
- the height of the individual text characters.
-
getHorizontalAlignment
int getHorizontalAlignment()Returns the horizontal alignment of the text. Seeclass javadoc
for an illustration.- Returns:
- the horizontal alignment of the text:
ALIGNMENT_LEFT
,ALIGNMENT_CENTER
, orALIGNMENT_RIGHT
.
-
getVerticalAlignment
int getVerticalAlignment()Returns the vertical alignment of the text. Seeclass javadoc
for an illustration.- Returns:
- the vertical alignment of the text:
ALIGNMENT_TOP
,ALIGNMENT_CENTER
, orALIGNMENT_BOTTOM
.
-
getRotAngle
double getRotAngle()Returns the angle over which this text is rotated. The angle is in degrees, positive counter-clockwise, starting a 3 o'clock. Seeclass javadoc
for an illustration how this relates to the textlocation
and alignment.- Returns:
- the rotation angle of the text.
-