- All Implemented Interfaces:
Serializable
,Comparable<TextAnchor>
,Constable
Used to indicate the position of an anchor point for a text string. This is
frequently used to align a string to a fixed point in some coordinate space.
-
Nested Class Summary
Nested classes/interfaces inherited from class java.lang.Enum
Enum.EnumDesc<E extends Enum<E>>
-
Enum Constant Summary
Enum ConstantsEnum ConstantDescriptionBaseline/center.Baseline/left.Baseline/right.Bottom/center.Bottom/left.Bottom/right.Middle/center.Middle/left.Middle/right.Half-ascent/center.Half-ascent/left.Half-ascent/right.Top/center.Top/left.Top/right. -
Method Summary
Modifier and TypeMethodDescriptionboolean
Returnstrue
if this anchor is at the baseline level of the text bounds, andfalse
otherwise.boolean
isBottom()
Returnstrue
if this anchor is at the bottom of the text bounds, andfalse
otherwise.boolean
Returnstrue
if this anchor is at the half-ascent level of the text bounds, andfalse
otherwise.boolean
Returnstrue
if this anchor is at the half-height level of the text bounds, andfalse
otherwise.boolean
Returnstrue
if this anchor is horizontally at the center of the text bounds, andfalse
otherwise.boolean
isLeft()
Returnstrue
if this anchor is at the left side of the text bounds, andfalse
otherwise.boolean
isRight()
Returnstrue
if this anchor is at the right side of the text bounds, andfalse
otherwise.boolean
isTop()
Returnstrue
if this anchor is at the top of the text bounds, andfalse
otherwise.toString()
Returns a string representing the object.static TextAnchor
Returns the enum constant of this class with the specified name.static TextAnchor[]
values()
Returns an array containing the constants of this enum class, in the order they are declared.
-
Enum Constant Details
-
TOP_LEFT
Top/left. -
TOP_CENTER
Top/center. -
TOP_RIGHT
Top/right. -
HALF_ASCENT_LEFT
Half-ascent/left. -
HALF_ASCENT_CENTER
Half-ascent/center. -
HALF_ASCENT_RIGHT
Half-ascent/right. -
CENTER_LEFT
Middle/left. -
CENTER
Middle/center. -
CENTER_RIGHT
Middle/right. -
BASELINE_LEFT
Baseline/left. -
BASELINE_CENTER
Baseline/center. -
BASELINE_RIGHT
Baseline/right. -
BOTTOM_LEFT
Bottom/left. -
BOTTOM_CENTER
Bottom/center. -
BOTTOM_RIGHT
Bottom/right.
-
-
Method Details
-
values
Returns an array containing the constants of this enum class, in the order they are declared.- Returns:
- an array containing the constants of this enum class, in the order they are declared
-
valueOf
Returns the enum constant of this class with the specified name. The string must match exactly an identifier used to declare an enum constant in this class. (Extraneous whitespace characters are not permitted.)- Parameters:
name
- the name of the enum constant to be returned.- Returns:
- the enum constant with the specified name
- Throws:
IllegalArgumentException
- if this enum class has no constant with the specified nameNullPointerException
- if the argument is null
-
isLeft
Returnstrue
if this anchor is at the left side of the text bounds, andfalse
otherwise.- Returns:
- A boolean.
-
isHorizontalCenter
Returnstrue
if this anchor is horizontally at the center of the text bounds, andfalse
otherwise.- Returns:
- A boolean.
-
isRight
Returnstrue
if this anchor is at the right side of the text bounds, andfalse
otherwise.- Returns:
- A boolean.
-
isTop
Returnstrue
if this anchor is at the top of the text bounds, andfalse
otherwise.- Returns:
- A boolean.
-
isHalfAscent
Returnstrue
if this anchor is at the half-ascent level of the text bounds, andfalse
otherwise.- Returns:
- A boolean.
-
isHalfHeight
Returnstrue
if this anchor is at the half-height level of the text bounds, andfalse
otherwise.- Returns:
- A boolean.
-
isBaseline
Returnstrue
if this anchor is at the baseline level of the text bounds, andfalse
otherwise.- Returns:
- A boolean.
-
isBottom
Returnstrue
if this anchor is at the bottom of the text bounds, andfalse
otherwise.- Returns:
- A boolean.
-
toString
Returns a string representing the object.- Overrides:
toString
in classEnum<TextAnchor>
- Returns:
- The string.
-