java.lang.Object
org.jfree.chart3d.graphics2d.Fit2D
- All Implemented Interfaces:
Serializable
A specification for the alignment and fitting of one rectangle (the source
rectangle) with reference to another (the target rectangle). Instances of
this class are immutable.
One application for this is to specify how the background image for a chart should be aligned and scaled.
NOTE: This class is serializable, but the serialization format is subject to change in future releases and should not be relied upon for persisting instances of this class.
One application for this is to specify how the background image for a chart should be aligned and scaled.
NOTE: This class is serializable, but the serialization format is subject to change in future releases and should not be relied upon for persisting instances of this class.
- See Also:
-
Field Summary
FieldsModifier and TypeFieldDescriptionstatic final Fit2D
Fits a source rectangle to the bottom center of a target rectangle, without resizing it.static final Fit2D
Fits a source rectangle to the bottom left of a target rectangle, without resizing it.static final Fit2D
Fits a source rectangle to the bottom right of a target rectangle, without resizing it.static final Fit2D
Fits a source rectangle to the center left of a target rectangle, without resizing it.static final Fit2D
Aligns a source rectangle to the center of a target rectangle, without resizing it.static final Fit2D
Fits a source rectangle to the center right of a target rectangle, without resizing it.static final Fit2D
Scale the source rectangle to fit the target rectangle.static final Fit2D
Fits a source rectangle to the top center of a target rectangle, without resizing it.static final Fit2D
Fits a source rectangle to the top left of a target rectangle, without resizing it.static final Fit2D
Fits a source rectangle to the top right of a target rectangle, without resizing it. -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionboolean
Tests this instance for equality with an arbitrary object.fit
(Dimension2D srcDim, Rectangle2D target) Fits a rectangle of the specified dimension to the target rectangle, aligning and scaling according to the attributes of this instance.Returns the anchor.static Fit2D
getNoScalingFitter
(RefPt2D refPt) Returns a fitter for the specified reference point.getScale()
Returns the scaling.
-
Field Details
-
CENTER_NO_SCALING
Aligns a source rectangle to the center of a target rectangle, without resizing it.- Since:
- 1.1
-
TOP_LEFT_NO_SCALING
Fits a source rectangle to the top left of a target rectangle, without resizing it.- Since:
- 1.1
-
TOP_CENTER_NO_SCALING
Fits a source rectangle to the top center of a target rectangle, without resizing it.- Since:
- 1.1
-
TOP_RIGHT_NO_SCALING
Fits a source rectangle to the top right of a target rectangle, without resizing it.- Since:
- 1.1
-
CENTER_LEFT_NO_SCALING
Fits a source rectangle to the center left of a target rectangle, without resizing it.- Since:
- 1.1
-
CENTER_RIGHT_NO_SCALING
Fits a source rectangle to the center right of a target rectangle, without resizing it.- Since:
- 1.1
-
BOTTOM_LEFT_NO_SCALING
Fits a source rectangle to the bottom left of a target rectangle, without resizing it.- Since:
- 1.1
-
BOTTOM_CENTER_NO_SCALING
Fits a source rectangle to the bottom center of a target rectangle, without resizing it.- Since:
- 1.1
-
BOTTOM_RIGHT_NO_SCALING
Fits a source rectangle to the bottom right of a target rectangle, without resizing it.- Since:
- 1.1
-
SCALE_TO_FIT_TARGET
Scale the source rectangle to fit the target rectangle.- Since:
- 1.1
-
-
Constructor Details
-
Fit2D
Creates a new instance.- Parameters:
anchor
- the anchor point (null
not permitted).scale
- the scaling (null
not permitted).
-
-
Method Details
-
getNoScalingFitter
Returns a fitter for the specified reference point.- Parameters:
refPt
- the reference point (null
not permitted).- Returns:
- A fitter.
- Since:
- 1.1
-
getAnchor
Returns the anchor.- Returns:
- The anchor (never
null
). - Since:
- 1.1
-
getScale
Returns the scaling.- Returns:
- The scaling (never
null
). - Since:
- 1.1
-
fit
Fits a rectangle of the specified dimension to the target rectangle, aligning and scaling according to the attributes of this instance.- Parameters:
srcDim
- the dimensions of the source rectangle (null
not permitted).target
- the target rectangle (null
not permitted).- Returns:
- The bounds of the fitted rectangle (never
null
).
-
equals
Tests this instance for equality with an arbitrary object.
-