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 RectangleAnchorBottom.static final RectangleAnchorBottom-Left.static final RectangleAnchorBottom-Right.static final RectangleAnchorCenter.static final RectangleAnchorLeft.private StringThe name.static final RectangleAnchorRight.private static final longFor serialization.static final RectangleAnchorTop.static final RectangleAnchorTop-Left.static final RectangleAnchorTop-Right. -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionstatic Point2Dcoordinates(Rectangle2D rectangle, RectangleAnchor anchor) Returns the (x, y) coordinates of the specified anchor.static Rectangle2DcreateRectangle(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).booleanReturnstrueif this object is equal to the specified object, andfalseotherwise.inthashCode()Returns a hash code value for the object.private ObjectEnsures 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
Returnstrueif this object is equal to the specified object, andfalseotherwise. -
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 (nullnot permitted).anchorX- the x-anchor.anchorY- the y-anchor.anchor- the anchor (nullnot permitted).- Returns:
- A rectangle.
-
readResolve
Ensures that serialization returns the unique instances.- Returns:
- The object.
- Throws:
ObjectStreamException- if there is a problem.
-