public final class Anchor2D extends java.lang.Object implements java.io.Serializable
TitleAnchor and LegendAnchor classes.
| Modifier and Type | Field and Description |
|---|---|
static Anchor2D |
BOTTOM_CENTER
An anchor point at the bottom center with zero offset from the target
rectangle bounds.
|
static Anchor2D |
BOTTOM_LEFT
An anchor point at the bottom left with zero offset from the target
rectangle bounds.
|
static Anchor2D |
BOTTOM_RIGHT
An anchor point at the bottom right with zero offset from the target
rectangle bounds.
|
static Anchor2D |
CENTER
An anchor point at the center of the target rectangle.
|
static Anchor2D |
CENTER_LEFT
An anchor point at the center left with zero offset from the target
rectangle bounds.
|
static Anchor2D |
CENTER_RIGHT
An anchor point at the center right with zero offset from the target
rectangle bounds.
|
static Anchor2D |
TOP_CENTER
An anchor point at the top center with zero offset from the target
rectangle bounds.
|
static Anchor2D |
TOP_LEFT
An anchor point at the top left with zero offset from the target
rectangle bounds.
|
static Anchor2D |
TOP_RIGHT
An anchor point at the top right with zero offset from the target
rectangle bounds.
|
| Constructor and Description |
|---|
Anchor2D()
Creates a default instance.
|
Anchor2D(RefPt2D refPt)
Creates a new
Anchor2D instance with the specified
reference point and offsets of (4.0, 4.0). |
Anchor2D(RefPt2D refPt,
Offset2D offset)
Creates a new anchor.
|
| Modifier and Type | Method and Description |
|---|---|
boolean |
equals(java.lang.Object obj)
Tests this instance for equality with an arbitrary object.
|
java.awt.geom.Point2D |
getAnchorPoint(java.awt.geom.Rectangle2D rect)
Returns the anchor point for the given rectangle.
|
Offset2D |
getOffset()
Returns the offsets.
|
RefPt2D |
getRefPt()
Returns the reference point.
|
java.awt.geom.Point2D |
resolveAnchorWithPercentOffset(double startX,
double startY,
double endX,
double endY)
Resolves the anchor to a specific point relative to a rectangle defined
by the points (startX, startY) and (endX, endY).
|
public static final Anchor2D TOP_LEFT
public static final Anchor2D TOP_CENTER
public static final Anchor2D TOP_RIGHT
public static final Anchor2D CENTER_LEFT
public static final Anchor2D CENTER
public static final Anchor2D CENTER_RIGHT
public static final Anchor2D BOTTOM_LEFT
public static final Anchor2D BOTTOM_CENTER
public static final Anchor2D BOTTOM_RIGHT
public Anchor2D()
public Anchor2D(RefPt2D refPt)
Anchor2D instance with the specified
reference point and offsets of (4.0, 4.0).refPt - the reference point (null not permitted).public RefPt2D getRefPt()
null).public java.awt.geom.Point2D getAnchorPoint(java.awt.geom.Rectangle2D rect)
rect - the reference rectangle (null not permitted).public java.awt.geom.Point2D resolveAnchorWithPercentOffset(double startX, double startY, double endX, double endY)
startX - the x-coordinate for the bottom left corner of the target
rect.startY - the y-coordinate for the bottom left corner of the target
rect.endX - the x-coordinate for the top right corner of the target
rect.endY - the y-coordinate for the top right corner of the target
rect.public boolean equals(java.lang.Object obj)
equals in class java.lang.Objectobj - the object (null not permitted).