Package org.jfree.chart.ui
Enum RectangleAnchor
- All Implemented Interfaces:
Serializable
,Comparable<RectangleAnchor>
,java.lang.constant.Constable
Used to indicate an anchor point for a rectangle.
-
Nested Class Summary
Nested classes/interfaces inherited from class java.lang.Enum
Enum.EnumDesc<E extends Enum<E>>
-
Enum Constant Summary
Enum ConstantDescriptionBottom.Bottom-Left.Bottom-Right.Center.Left.Right.Top.Top-Left.Top-Right. -
Method Summary
Modifier and TypeMethodDescriptionstatic 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)
.getAnchorPoint
(Rectangle2D rectangle) Returns the anchor point relative to the specified rectangle.toString()
Returns a string representing the object.static RectangleAnchor
Returns the enum constant of this type with the specified name.static RectangleAnchor[]
values()
Returns an array containing the constants of this enum type, in the order they are declared.
-
Enum Constant Details
-
CENTER
Center. -
TOP
Top. -
TOP_LEFT
Top-Left. -
TOP_RIGHT
Top-Right. -
BOTTOM
Bottom. -
BOTTOM_LEFT
Bottom-Left. -
BOTTOM_RIGHT
Bottom-Right. -
LEFT
Left. -
RIGHT
Right.
-
-
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
-
getAnchorPoint
Returns the anchor point relative to the specified rectangle.- Parameters:
rectangle
- the rectangle (null
not permitted).- Returns:
- The anchor point (never
null
).
-
toString
Returns a string representing the object.- Overrides:
toString
in classEnum<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.
-