- 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 TypeMethodDescriptionbooleanReturnstrueif this anchor is at the baseline level of the text bounds, andfalseotherwise.booleanisBottom()Returnstrueif this anchor is at the bottom of the text bounds, andfalseotherwise.booleanReturnstrueif this anchor is at the half-ascent level of the text bounds, andfalseotherwise.booleanReturnstrueif this anchor is at the half-height level of the text bounds, andfalseotherwise.booleanReturnstrueif this anchor is horizontally at the center of the text bounds, andfalseotherwise.booleanisLeft()Returnstrueif this anchor is at the left side of the text bounds, andfalseotherwise.booleanisRight()Returnstrueif this anchor is at the right side of the text bounds, andfalseotherwise.booleanisTop()Returnstrueif this anchor is at the top of the text bounds, andfalseotherwise.toString()Returns a string representing the object.static TextAnchorReturns 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
Returnstrueif this anchor is at the left side of the text bounds, andfalseotherwise.- Returns:
- A boolean.
-
isHorizontalCenter
Returnstrueif this anchor is horizontally at the center of the text bounds, andfalseotherwise.- Returns:
- A boolean.
-
isRight
Returnstrueif this anchor is at the right side of the text bounds, andfalseotherwise.- Returns:
- A boolean.
-
isTop
Returnstrueif this anchor is at the top of the text bounds, andfalseotherwise.- Returns:
- A boolean.
-
isHalfAscent
Returnstrueif this anchor is at the half-ascent level of the text bounds, andfalseotherwise.- Returns:
- A boolean.
-
isHalfHeight
Returnstrueif this anchor is at the half-height level of the text bounds, andfalseotherwise.- Returns:
- A boolean.
-
isBaseline
Returnstrueif this anchor is at the baseline level of the text bounds, andfalseotherwise.- Returns:
- A boolean.
-
isBottom
Returnstrueif this anchor is at the bottom of the text bounds, andfalseotherwise.- Returns:
- A boolean.
-
toString
Returns a string representing the object.- Overrides:
toStringin classEnum<TextAnchor>- Returns:
- The string.
-