public class Fit2D extends java.lang.Object implements java.io.Serializable
| Modifier and Type | Field and Description |
|---|---|
static Fit2D |
BOTTOM_CENTER_NO_SCALING
Fits a source rectangle to the bottom center of a target rectangle,
without resizing it.
|
static Fit2D |
BOTTOM_LEFT_NO_SCALING
Fits a source rectangle to the bottom left of a target rectangle,
without resizing it.
|
static Fit2D |
BOTTOM_RIGHT_NO_SCALING
Fits a source rectangle to the bottom right of a target rectangle,
without resizing it.
|
static Fit2D |
CENTER_LEFT_NO_SCALING
Fits a source rectangle to the center left of a target rectangle,
without resizing it.
|
static Fit2D |
CENTER_NO_SCALING
Aligns a source rectangle to the center of a target rectangle, without
resizing it.
|
static Fit2D |
CENTER_RIGHT_NO_SCALING
Fits a source rectangle to the center right of a target rectangle,
without resizing it.
|
static Fit2D |
SCALE_TO_FIT_TARGET
Scale the source rectangle to fit the target rectangle.
|
static Fit2D |
TOP_CENTER_NO_SCALING
Fits a source rectangle to the top center of a target rectangle, without
resizing it.
|
static Fit2D |
TOP_LEFT_NO_SCALING
Fits a source rectangle to the top left of a target rectangle, without
resizing it.
|
static Fit2D |
TOP_RIGHT_NO_SCALING
Fits a source rectangle to the top right of a target rectangle, without
resizing it.
|
| Constructor and Description |
|---|
Fit2D(Anchor2D anchor,
Scale2D scale)
Creates a new instance.
|
| Modifier and Type | Method and Description |
|---|---|
boolean |
equals(java.lang.Object obj)
Tests this instance for equality with an arbitrary object.
|
java.awt.geom.Rectangle2D |
fit(java.awt.geom.Dimension2D srcDim,
java.awt.geom.Rectangle2D target)
Fits a rectangle of the specified dimension to the target rectangle,
aligning and scaling according to the attributes of this instance.
|
Anchor2D |
getAnchor()
Returns the anchor.
|
static Fit2D |
getNoScalingFitter(RefPt2D refPt)
Returns a fitter for the specified reference point.
|
Scale2D |
getScale()
Returns the scaling.
|
public static final Fit2D CENTER_NO_SCALING
public static final Fit2D TOP_LEFT_NO_SCALING
public static final Fit2D TOP_CENTER_NO_SCALING
public static final Fit2D TOP_RIGHT_NO_SCALING
public static final Fit2D CENTER_LEFT_NO_SCALING
public static final Fit2D CENTER_RIGHT_NO_SCALING
public static final Fit2D BOTTOM_LEFT_NO_SCALING
public static final Fit2D BOTTOM_CENTER_NO_SCALING
public static final Fit2D BOTTOM_RIGHT_NO_SCALING
public static final Fit2D SCALE_TO_FIT_TARGET
public static Fit2D getNoScalingFitter(RefPt2D refPt)
refPt - the reference point (null not permitted).public Anchor2D getAnchor()
null).public Scale2D getScale()
null).public java.awt.geom.Rectangle2D fit(java.awt.geom.Dimension2D srcDim, java.awt.geom.Rectangle2D target)
srcDim - the dimensions of the source rectangle (null
not permitted).target - the target rectangle (null not permitted).null).public boolean equals(java.lang.Object obj)
equals in class java.lang.Objectobj - the object (null permitted).