public enum RectangleAnchor extends Enum<RectangleAnchor>
Enum Constant and Description |
---|
BOTTOM
Bottom.
|
BOTTOM_LEFT
Bottom-Left.
|
BOTTOM_RIGHT
Bottom-Right.
|
CENTER
Center.
|
LEFT
Left.
|
RIGHT
Right.
|
TOP
Top.
|
TOP_LEFT
Top-Left.
|
TOP_RIGHT
Top-Right.
|
Modifier and Type | Method and Description |
---|---|
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) . |
Point2D |
getAnchorPoint(Rectangle2D rectangle)
Returns the anchor point relative to the specified rectangle.
|
String |
toString()
Returns a string representing the object.
|
static RectangleAnchor |
valueOf(String name)
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.
|
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
public static RectangleAnchor[] values()
for (RectangleAnchor c : RectangleAnchor.values()) System.out.println(c);
public static RectangleAnchor valueOf(String name)
name
- the name of the enum constant to be returned.IllegalArgumentException
- if this enum type has no constant with the specified nameNullPointerException
- if the argument is nullpublic Point2D getAnchorPoint(Rectangle2D rectangle)
rectangle
- the rectangle (null
not permitted).null
).public String toString()
toString
in class Enum<RectangleAnchor>
public static 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).Copyright © 2001–2017 JFree.org. All rights reserved.