Package com.orsonpdf.util
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 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. -
Field Summary
Fields -
Constructor Summary
Constructors -
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 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
Private constructor.- Parameters:
name
- the name.
-
-
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()Returnstrue
if this anchor is at the left side of the text bounds, andfalse
otherwise.- Returns:
- A boolean.
-
isHorizontalCenter
public boolean isHorizontalCenter()Returnstrue
if this anchor is horizontally at the center of the text bounds, andfalse
otherwise.- Returns:
- A boolean.
-
isRight
public boolean isRight()Returnstrue
if this anchor is at the right side of the text bounds, andfalse
otherwise.- Returns:
- A boolean.
-
isTop
public boolean isTop()Returnstrue
if this anchor is at the top of the text bounds, andfalse
otherwise.- Returns:
- A boolean.
-
isHalfAscent
public boolean isHalfAscent()Returnstrue
if this anchor is at the half-ascent level of the text bounds, andfalse
otherwise.- Returns:
- A boolean.
-
isHalfHeight
public boolean isHalfHeight()Returnstrue
if this anchor is at the half-height level of the text bounds, andfalse
otherwise.- Returns:
- A boolean.
-
isBaseline
public boolean isBaseline()Returnstrue
if this anchor is at the baseline level of the text bounds, andfalse
otherwise.- Returns:
- A boolean.
-
isBottom
public 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.
-