Package org.jfree.ui

Class TextAnchor

  • All Implemented Interfaces:
    Serializable

    public final class TextAnchor
    extends Object
    implements Serializable
    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.
    Author:
    David Gilbert
    See Also:
    Serialized Form
    • Field 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

      • isLeft

        public boolean isLeft()
        Returns true if the anchor is a left-side anchor, and false otherwise.
        Returns:
        A boolean.
        Since:
        1.0.20
      • isRight

        public boolean isRight()
        Returns true if the anchor is a right-side anchor, and false otherwise.
        Returns:
        A boolean.
        Since:
        1.0.20
      • isHorizontalCenter

        public boolean isHorizontalCenter()
        Returns true if the anchor is a center anchor, and false otherwise.
        Returns:
        A boolean.
        Since:
        1.0.20
      • isTop

        public boolean isTop()
        Returns true if the anchor is a top anchor, and false otherwise.
        Returns:
        A boolean.
        Since:
        1.0.20
      • isBottom

        public boolean isBottom()
        Returns true if the anchor is a bottom anchor, and false otherwise.
        Returns:
        A boolean.
        Since:
        1.0.20
      • isBaseline

        public boolean isBaseline()
        Returns true if the anchor is a baseline anchor, and false otherwise.
        Returns:
        A boolean.
        Since:
        1.0.20
      • isHalfAscent

        public boolean isHalfAscent()
        Returns true if the anchor is a half-ascent anchor, and false otherwise.
        Returns:
        A boolean.
        Since:
        1.0.20
      • isVerticalCenter

        public boolean isVerticalCenter()
        Returns true if the anchor is a half-ascent anchor, and false otherwise.
        Returns:
        A boolean.
        Since:
        1.0.20
      • toString

        public String toString()
        Returns a string representing the object.
        Overrides:
        toString in class Object
        Returns:
        The string.
      • equals

        public boolean equals​(Object o)
        Returns true if this object is equal to the specified object, and false otherwise.
        Overrides:
        equals in class Object
        Parameters:
        o - the other object.
        Returns:
        A boolean.
      • hashCode

        public int hashCode()
        Returns a hash code value for the object.
        Overrides:
        hashCode in class Object
        Returns:
        The hashcode