Enum TextAnchor
- All Implemented Interfaces:
Serializable, Comparable<TextAnchor>, java.lang.constant.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 Enum
Enum.EnumDesc<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. -
Field Summary
Fields -
Constructor Summary
Constructors -
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 type with the specified name.static TextAnchor[]values()Returns an array containing the constants of this enum type, 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.
-
-
Field Details
-
name
The name.
-
-
Constructor Details
-
TextAnchor
-
-
Method Details
-
values
Returns an array containing the constants of this enum type, in the order they are declared.- Returns:
- an array containing the constants of this enum type, in the order they are declared
-
valueOf
Returns the enum constant of this type with the specified name. The string must match exactly an identifier used to declare an enum constant in this type. (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 type has no constant with the specified nameNullPointerException- if the argument is null
-
isLeft
public boolean isLeft()Returnstrueif this anchor is at the left side of the text bounds, andfalseotherwise.- Returns:
- A boolean.
-
isHorizontalCenter
public boolean isHorizontalCenter()Returnstrueif this anchor is horizontally at the center of the text bounds, andfalseotherwise.- Returns:
- A boolean.
-
isRight
public boolean isRight()Returnstrueif this anchor is at the right side of the text bounds, andfalseotherwise.- Returns:
- A boolean.
-
isTop
public boolean isTop()Returnstrueif this anchor is at the top of the text bounds, andfalseotherwise.- Returns:
- A boolean.
-
isHalfAscent
public boolean isHalfAscent()Returnstrueif this anchor is at the half-ascent level of the text bounds, andfalseotherwise.- Returns:
- A boolean.
-
isHalfHeight
public boolean isHalfHeight()Returnstrueif this anchor is at the half-height level of the text bounds, andfalseotherwise.- Returns:
- A boolean.
-
isBaseline
public boolean isBaseline()Returnstrueif this anchor is at the baseline level of the text bounds, andfalseotherwise.- Returns:
- A boolean.
-
isBottom
public 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.
-