java.lang.Object
org.jhotdraw8.geom.AbstractPathBuilder<T>
org.jhotdraw8.geom.NineRegionsScalingBuilder<T>
- Type Parameters:
T- the product type
- All Implemented Interfaces:
PathBuilder<T>
This builder slices the input path into 9 regions, and scales them by the
specified scale factor and pivot.
The builder takes a four values minx, miny, maxx, maxy as input, or a rectangle and insets from which these four values are computed.
The coordinate space is split along minx, miny, maxx, maxy into 9 pieces: top-left, top-right, bottom-right, bottom-left, top, right, bottom, left, center.
- the top left piece is translated by the scaled distance from the left and the top inset to the pivot.
- similar translations are applied to the top right, bottom right and bottom left pieces.
- the top piece is translated by the scaled distance from the top inset to the pivot,and scaled by the sx-factor of the scaling.
- similar transformations are applied to the right, bottom and left pieces.
- the piece in the center is scaled by the scale factor around the pivot
- Author:
- Werner Randelshofer
-
Constructor Summary
ConstructorsConstructorDescriptionNineRegionsScalingBuilder(@NonNull PathBuilder<T> dest, @NonNull javafx.geometry.Bounds srcBounds, @NonNull javafx.geometry.Insets srcInsets, @NonNull javafx.geometry.Bounds destBounds) Creates a new instance. -
Method Summary
Modifier and TypeMethodDescriptionbuild()Builds something.protected voiddoClosePath(double lastX, double lastY, double lastMoveToX, double lastMoveToY) protected voiddoCurveTo(double lastX, double lastY, double x1, double y1, double x2, double y2, double x3, double y3) protected voiddoLineTo(double lastX, double lastY, double x, double y) protected voiddoMoveTo(double x, double y) protected voidprotected voiddoQuadTo(double lastX, double lastY, double x1, double y1, double x2, double y2) Methods inherited from class org.jhotdraw8.geom.AbstractPathBuilder
arcTo, closePath, curveTo, doArcTo, doSmoothCurveTo, doSmoothQuadTo, getLastCX, getLastCY, getLastMoveToX, getLastMoveToY, getLastPoint, getLastX, getLastY, lineTo, moveTo, needsMoveTo, pathDone, quadTo, setLastCX, setLastCY, setLastX, setLastY, smoothCurveTo, smoothQuadToMethods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitMethods inherited from interface org.jhotdraw8.geom.PathBuilder
circle, counterClockwiseCircle, curveTo, lineTo, moveTo, quadTo, smoothCurveTo, smoothQuadTo
-
Constructor Details
-
NineRegionsScalingBuilder
public NineRegionsScalingBuilder(@NonNull PathBuilder<T> dest, @NonNull javafx.geometry.Bounds srcBounds, @NonNull javafx.geometry.Insets srcInsets, @NonNull javafx.geometry.Bounds destBounds) Creates a new instance.- Parameters:
dest- The destination (target) of the builder.srcBounds- The bounds of the source image.srcInsets- The nine regions in the bounds of the source image.destBounds- The bounds of the destination image.
-
-
Method Details
-
doClosePath
protected void doClosePath(double lastX, double lastY, double lastMoveToX, double lastMoveToY) - Specified by:
doClosePathin classAbstractPathBuilder<T>
-
doCurveTo
protected void doCurveTo(double lastX, double lastY, double x1, double y1, double x2, double y2, double x3, double y3) - Specified by:
doCurveToin classAbstractPathBuilder<T>
-
doLineTo
protected void doLineTo(double lastX, double lastY, double x, double y) - Specified by:
doLineToin classAbstractPathBuilder<T>
-
doMoveTo
protected void doMoveTo(double x, double y) - Specified by:
doMoveToin classAbstractPathBuilder<T>
-
doQuadTo
protected void doQuadTo(double lastX, double lastY, double x1, double y1, double x2, double y2) - Specified by:
doQuadToin classAbstractPathBuilder<T>
-
doPathDone
protected void doPathDone()- Specified by:
doPathDonein classAbstractPathBuilder<T>
-
build
Description copied from interface:PathBuilderBuilds something.Some implementations may guarantee a non-null return value.
-