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.
- 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.private String
The name.static final RectangleAnchor
Right.private static final long
For serialization.static final RectangleAnchor
Top.static final RectangleAnchor
Top-Left.static final RectangleAnchor
Top-Right. -
Constructor Summary
Constructors -
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.private Object
Ensures that serialization returns the unique instances.toString()
Returns a string representing the object.
-
Field Details
-
serialVersionUID
private static final long serialVersionUIDFor serialization.- See Also:
-
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. -
name
The name.
-
-
Constructor Details
-
RectangleAnchor
Private constructor.- Parameters:
name
- the name.
-
-
Method Details
-
toString
Returns a string representing the object. -
equals
Returnstrue
if this object is equal to the specified object, andfalse
otherwise. -
hashCode
public int 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.
-
readResolve
Ensures that serialization returns the unique instances.- Returns:
- The object.
- Throws:
ObjectStreamException
- if there is a problem.
-