Package org.jfree.ui
Class RectangleAnchor
java.lang.Object
org.jfree.ui.RectangleAnchor
- All Implemented Interfaces:
Serializable
Used to indicate an anchor point for a rectangle.
- Author:
- David Gilbert
- See Also:
-
Field Summary
FieldsModifier and TypeFieldDescriptionstatic final RectangleAnchor
Bottom.static final RectangleAnchor
Bottom-Left.static final RectangleAnchor
Bottom-Right.static final RectangleAnchor
Center.static final RectangleAnchor
Left.static final RectangleAnchor
Right.static final RectangleAnchor
Top.static final RectangleAnchor
Top-Left.static final RectangleAnchor
Top-Right. -
Method Summary
Modifier and TypeMethodDescriptionstatic Point2D
coordinates
(Rectangle2D rectangle, RectangleAnchor anchor) Returns the (x, y) coordinates of the specified anchor.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)
.boolean
Returnstrue
if this object is equal to the specified object, andfalse
otherwise.int
hashCode()
Returns a hash code value for the object.toString()
Returns a string representing the object.
-
Field 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
-
toString
Returns a string representing the object. -
equals
Returnstrue
if this object is equal to the specified object, andfalse
otherwise. -
hashCode
Returns a hash code value for the object. -
coordinates
Returns the (x, y) coordinates of the specified anchor.- Parameters:
rectangle
- the rectangle.anchor
- the anchor.- Returns:
- The (x, y) coordinates.
-
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.
-