Enum RectangleAnchor

java.lang.Object
java.lang.Enum<RectangleAnchor>
org.jfree.chart.ui.RectangleAnchor
All Implemented Interfaces:
Serializable, Comparable<RectangleAnchor>, java.lang.constant.Constable

public enum RectangleAnchor extends Enum<RectangleAnchor>
Used to indicate an anchor point for a rectangle.
  • Enum Constant Details

  • Method Details

    • values

      public static RectangleAnchor[] 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

      public static RectangleAnchor 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 name
      NullPointerException - if the argument is null
    • getAnchorPoint

      public Point2D getAnchorPoint(Rectangle2D rectangle)
      Returns the anchor point relative to the specified rectangle.
      Parameters:
      rectangle - the rectangle (null not permitted).
      Returns:
      The anchor point (never null).
    • toString

      public String toString()
      Returns a string representing the object.
      Overrides:
      toString in class Enum<RectangleAnchor>
      Returns:
      The string.
    • createRectangle

      public static Rectangle2D createRectangle(Size2D dimensions, double anchorX, double anchorY, RectangleAnchor anchor)
      Creates a new rectangle with the specified dimensions that is aligned to the given anchor point (anchorX, anchorY).
      Parameters:
      dimensions - the dimensions (null not permitted).
      anchorX - the x-anchor.
      anchorY - the y-anchor.
      anchor - the anchor (null not permitted).
      Returns:
      A rectangle.