public final class RectangleAnchor
extends java.lang.Object
implements java.io.Serializable
| Modifier and Type | Field and Description |
|---|---|
static RectangleAnchor |
BOTTOM
Bottom.
|
static RectangleAnchor |
BOTTOM_LEFT
Bottom-Left.
|
static RectangleAnchor |
BOTTOM_RIGHT
Bottom-Right.
|
static RectangleAnchor |
CENTER
Center.
|
static RectangleAnchor |
LEFT
Left.
|
private java.lang.String |
name
The name.
|
static RectangleAnchor |
RIGHT
Right.
|
private static long |
serialVersionUID
For serialization.
|
static RectangleAnchor |
TOP
Top.
|
static RectangleAnchor |
TOP_LEFT
Top-Left.
|
static RectangleAnchor |
TOP_RIGHT
Top-Right.
|
| Modifier | Constructor and Description |
|---|---|
private |
RectangleAnchor(java.lang.String name)
Private constructor.
|
| Modifier and Type | Method and Description |
|---|---|
static java.awt.geom.Point2D |
coordinates(java.awt.geom.Rectangle2D rectangle,
RectangleAnchor anchor)
Returns the (x, y) coordinates of the specified anchor.
|
static java.awt.geom.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 |
equals(java.lang.Object obj)
Returns
true if this object is equal to the specified
object, and false otherwise. |
int |
hashCode()
Returns a hash code value for the object.
|
private java.lang.Object |
readResolve()
Ensures that serialization returns the unique instances.
|
java.lang.String |
toString()
Returns a string representing the object.
|
private static final long serialVersionUID
public static final RectangleAnchor CENTER
public static final RectangleAnchor TOP
public static final RectangleAnchor TOP_LEFT
public static final RectangleAnchor TOP_RIGHT
public static final RectangleAnchor BOTTOM
public static final RectangleAnchor BOTTOM_LEFT
public static final RectangleAnchor BOTTOM_RIGHT
public static final RectangleAnchor LEFT
public static final RectangleAnchor RIGHT
private java.lang.String name
private RectangleAnchor(java.lang.String name)
name - the name.public java.lang.String toString()
toString in class java.lang.Objectpublic boolean equals(java.lang.Object obj)
true if this object is equal to the specified
object, and false otherwise.equals in class java.lang.Objectobj - the other object (null permitted).public int hashCode()
hashCode in class java.lang.Objectpublic static java.awt.geom.Point2D coordinates(java.awt.geom.Rectangle2D rectangle,
RectangleAnchor anchor)
rectangle - the rectangle.anchor - the anchor.public static java.awt.geom.Rectangle2D createRectangle(Size2D dimensions, double anchorX, double anchorY, RectangleAnchor anchor)
(anchorX, anchorY).dimensions - the dimensions (null not permitted).anchorX - the x-anchor.anchorY - the y-anchor.anchor - the anchor (null not permitted).private java.lang.Object readResolve()
throws java.io.ObjectStreamException
java.io.ObjectStreamException - if there is a problem.