- java.lang.Object
-
- java.lang.Enum<TextAnchor>
-
- org.jfree.chart.text.TextAnchor
-
- All Implemented Interfaces:
Serializable,Comparable<TextAnchor>
public enum TextAnchor extends Enum<TextAnchor>
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.
-
-
Enum Constant Summary
Enum Constants Enum Constant Description BASELINE_CENTERBaseline/center.BASELINE_LEFTBaseline/left.BASELINE_RIGHTBaseline/right.BOTTOM_CENTERBottom/center.BOTTOM_LEFTBottom/left.BOTTOM_RIGHTBottom/right.CENTERMiddle/center.CENTER_LEFTMiddle/left.CENTER_RIGHTMiddle/right.HALF_ASCENT_CENTERHalf-ascent/center.HALF_ASCENT_LEFTHalf-ascent/left.HALF_ASCENT_RIGHTHalf-ascent/right.TOP_CENTERTop/center.TOP_LEFTTop/left.TOP_RIGHTTop/right.
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description booleanisBaseline()Returnstrueif the anchor is a baseline anchor, andfalseotherwise.booleanisBottom()Returnstrueif the anchor is a bottom anchor, andfalseotherwise.booleanisHalfAscent()Returnstrueif the anchor is a half-ascent anchor, andfalseotherwise.booleanisHorizontalCenter()Returnstrueif the anchor is a center anchor, andfalseotherwise.booleanisLeft()Returnstrueif the anchor is a left-side anchor, andfalseotherwise.booleanisRight()Returnstrueif the anchor is a right-side anchor, andfalseotherwise.booleanisTop()Returnstrueif the anchor is a top anchor, andfalseotherwise.booleanisVerticalCenter()Returnstrueif the anchor is a half-ascent anchor, andfalseotherwise.static TextAnchorvalueOf(String name)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 Detail
-
TOP_LEFT
public static final TextAnchor TOP_LEFT
Top/left.
-
TOP_CENTER
public static final TextAnchor TOP_CENTER
Top/center.
-
TOP_RIGHT
public static final TextAnchor TOP_RIGHT
Top/right.
-
HALF_ASCENT_LEFT
public static final TextAnchor HALF_ASCENT_LEFT
Half-ascent/left.
-
HALF_ASCENT_CENTER
public static final TextAnchor HALF_ASCENT_CENTER
Half-ascent/center.
-
HALF_ASCENT_RIGHT
public static final TextAnchor HALF_ASCENT_RIGHT
Half-ascent/right.
-
CENTER_LEFT
public static final TextAnchor CENTER_LEFT
Middle/left.
-
CENTER
public static final TextAnchor CENTER
Middle/center.
-
CENTER_RIGHT
public static final TextAnchor CENTER_RIGHT
Middle/right.
-
BASELINE_LEFT
public static final TextAnchor BASELINE_LEFT
Baseline/left.
-
BASELINE_CENTER
public static final TextAnchor BASELINE_CENTER
Baseline/center.
-
BASELINE_RIGHT
public static final TextAnchor BASELINE_RIGHT
Baseline/right.
-
BOTTOM_LEFT
public static final TextAnchor BOTTOM_LEFT
Bottom/left.
-
BOTTOM_CENTER
public static final TextAnchor BOTTOM_CENTER
Bottom/center.
-
BOTTOM_RIGHT
public static final TextAnchor BOTTOM_RIGHT
Bottom/right.
-
-
Method Detail
-
values
public static TextAnchor[] values()
Returns an array containing the constants of this enum type, in the order they are declared. This method may be used to iterate over the constants as follows:for (TextAnchor c : TextAnchor.values()) System.out.println(c);
- Returns:
- an array containing the constants of this enum type, in the order they are declared
-
valueOf
public static TextAnchor valueOf(String name)
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 the anchor is a left-side anchor, andfalseotherwise.- Returns:
- A boolean.
-
isRight
public boolean isRight()
Returnstrueif the anchor is a right-side anchor, andfalseotherwise.- Returns:
- A boolean.
-
isHorizontalCenter
public boolean isHorizontalCenter()
Returnstrueif the anchor is a center anchor, andfalseotherwise.- Returns:
- A boolean.
-
isTop
public boolean isTop()
Returnstrueif the anchor is a top anchor, andfalseotherwise.- Returns:
- A boolean.
-
isBottom
public boolean isBottom()
Returnstrueif the anchor is a bottom anchor, andfalseotherwise.- Returns:
- A boolean.
-
isBaseline
public boolean isBaseline()
Returnstrueif the anchor is a baseline anchor, andfalseotherwise.- Returns:
- A boolean.
-
isHalfAscent
public boolean isHalfAscent()
Returnstrueif the anchor is a half-ascent anchor, andfalseotherwise.- Returns:
- A boolean.
-
isVerticalCenter
public boolean isVerticalCenter()
Returnstrueif the anchor is a half-ascent anchor, andfalseotherwise.- Returns:
- A boolean.
-
-