Package org.jfree.chart.ui
Class TextAnchor
- java.lang.Object
-
- org.jfree.chart.ui.TextAnchor
-
- All Implemented Interfaces:
java.io.Serializable
public final class TextAnchor extends java.lang.Object implements java.io.SerializableUsed 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.- See Also:
- Serialized Form
-
-
Field Summary
Fields Modifier and Type Field Description static TextAnchorBASELINE_CENTERBaseline/center.static TextAnchorBASELINE_LEFTBaseline/left.static TextAnchorBASELINE_RIGHTBaseline/right.static TextAnchorBOTTOM_CENTERBottom/center.static TextAnchorBOTTOM_LEFTBottom/left.static TextAnchorBOTTOM_RIGHTBottom/right.static TextAnchorCENTERMiddle/center.static TextAnchorCENTER_LEFTMiddle/left.static TextAnchorCENTER_RIGHTMiddle/right.static TextAnchorHALF_ASCENT_CENTERHalf-ascent/center.static TextAnchorHALF_ASCENT_LEFTHalf-ascent/left.static TextAnchorHALF_ASCENT_RIGHTHalf-ascent/right.private java.lang.StringnameThe name.private static longserialVersionUIDFor serialization.static TextAnchorTOP_CENTERTop/center.static TextAnchorTOP_LEFTTop/left.static TextAnchorTOP_RIGHTTop/right.
-
Constructor Summary
Constructors Modifier Constructor Description privateTextAnchor(java.lang.String name)Private constructor.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description booleanequals(java.lang.Object o)Returnstrueif this object is equal to the specified object, andfalseotherwise.inthashCode()Returns a hash code value for the object.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.private java.lang.ObjectreadResolve()Ensures that serialization returns the unique instances.java.lang.StringtoString()Returns a string representing the object.
-
-
-
Field Detail
-
serialVersionUID
private static final long serialVersionUID
For serialization.- See Also:
- Constant Field Values
-
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.
-
name
private java.lang.String name
The name.
-
-
Method Detail
-
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.
-
toString
public java.lang.String toString()
Returns a string representing the object.- Overrides:
toStringin classjava.lang.Object- Returns:
- The string.
-
equals
public boolean equals(java.lang.Object o)
Returnstrueif this object is equal to the specified object, andfalseotherwise.- Overrides:
equalsin classjava.lang.Object- Parameters:
o- the other object.- Returns:
- A boolean.
-
hashCode
public int hashCode()
Returns a hash code value for the object.- Overrides:
hashCodein classjava.lang.Object- Returns:
- The hashcode
-
readResolve
private java.lang.Object readResolve() throws java.io.ObjectStreamExceptionEnsures that serialization returns the unique instances.- Returns:
- The object.
- Throws:
java.io.ObjectStreamException- if there is a problem.
-
-