Top Description Fields Constructors Methods
impl.org.controlsfx.tools.rectangle.change

pack-priv abstract Class AbstractFixedPointChangeStrategy

extends AbstractRatioRespectingChangeStrategy
Class Inheritance
Known Direct Subclasses
impl.org.controlsfx.tools.rectangle.change.NewChangeStrategy, impl.org.controlsfx.tools.rectangle.change.ToNortheastChangeStrategy, impl.org.controlsfx.tools.rectangle.change.ToNorthwestChangeStrategy, impl.org.controlsfx.tools.rectangle.change.ToSoutheastChangeStrategy, impl.org.controlsfx.tools.rectangle.change.ToSouthwestChangeStrategy
Imports
impl.org.controlsfx.tools.rectangle.Rectangles2D, java.util.Objects, javafx.geometry.Point2D, .Rectangle2D

Abstract superclass to those implementations of Rectangle2DChangeStrategy which compute their rectangle by spanning it from a fixed point to the point given to continueChange.
The point is fixed during the change but can be changed in between changes. Implemented such that a ratio is respected if specified.

Field Summary

Modifier and TypeField and Description
private final Rectangle2D
bounds

A rectangle which defines the bounds within which the new rectangle must be contained.

private Point2D
fixedCorner

The point which is fixed during the change.

Constructor Summary

AccessConstructor and Description
protected
AbstractFixedPointChangeStrategy(boolean
indicates whether the ratio will be fixed
ratioFixed
,
double
defines the fixed ratio
ratio
,
Rectangle2D
the bounds within which the new rectangle must be contained
bounds
)

Creates a fixed corner change strategy.

Method Summary

Modifier and TypeMethod and Description
private final Rectangle2D

Returns:

the rectangle defined the two corners
createFromCorners
(Point2D
the second corner
point
)

Creates a new rectangle from the two corners defined by getFixedCorner() and the specified point.

protected final Rectangle2D
doBegin(Point2D point)

Implements abstract impl.org.controlsfx.tools.rectangle.change.AbstractBeginEndCheckingChangeStrategy.doBegin.

Begins the change at the specified point.

protected Rectangle2D
doContinue(Point2D point)

Implements abstract impl.org.controlsfx.tools.rectangle.change.AbstractBeginEndCheckingChangeStrategy.doContinue.

Continues the change to the specified point.

protected final Rectangle2D
doEnd(Point2D point)

Implements abstract impl.org.controlsfx.tools.rectangle.change.AbstractBeginEndCheckingChangeStrategy.doEnd.

Ends the change at the specified point.

protected abstract Point2D

Returns:

the corner which is fixed during the change
getFixedCorner
()

Returns the corner which is fixed during the change.

Inherited from impl.org.controlsfx.tools.rectangle.change.AbstractRatioRespectingChangeStrategy:
getRatioisRatioFixed

Field Detail

boundsback to summary
private final Rectangle2D bounds

A rectangle which defines the bounds within which the new rectangle must be contained.

fixedCornerback to summary
private Point2D fixedCorner

The point which is fixed during the change. In doBegin(Point2D) it is set to getFixedCorner(); in doEnd(Point2D) it is set to null.

Constructor Detail

AbstractFixedPointChangeStrategyback to summary
protected AbstractFixedPointChangeStrategy(boolean ratioFixed, double ratio, Rectangle2D bounds)

Creates a fixed corner change strategy. It respects the specified ratio if ratioFixed is true.

Parameters
ratioFixed:boolean

indicates whether the ratio will be fixed

ratio:double

defines the fixed ratio

bounds:Rectangle2D

the bounds within which the new rectangle must be contained

Method Detail

createFromCornersback to summary
private final Rectangle2D createFromCorners(Point2D point)

Creates a new rectangle from the two corners defined by getFixedCorner() and the specified point.

Parameters
point:Point2D

the second corner

Returns:Rectangle2D

the rectangle defined the two corners

doBeginback to summary
protected final Rectangle2D doBegin(Point2D point)

Implements abstract impl.org.controlsfx.tools.rectangle.change.AbstractBeginEndCheckingChangeStrategy.doBegin.

Doc from impl.org.controlsfx.tools.rectangle.change.AbstractBeginEndCheckingChangeStrategy.doBegin.

Begins the change at the specified point.

Annotations
@Override
doContinueback to summary
protected Rectangle2D doContinue(Point2D point)

Implements abstract impl.org.controlsfx.tools.rectangle.change.AbstractBeginEndCheckingChangeStrategy.doContinue.

Doc from impl.org.controlsfx.tools.rectangle.change.AbstractBeginEndCheckingChangeStrategy.doContinue.

Continues the change to the specified point. Must not be called before a call to beginChange.

Annotations
@Override
doEndback to summary
protected final Rectangle2D doEnd(Point2D point)

Implements abstract impl.org.controlsfx.tools.rectangle.change.AbstractBeginEndCheckingChangeStrategy.doEnd.

Doc from impl.org.controlsfx.tools.rectangle.change.AbstractBeginEndCheckingChangeStrategy.doEnd.

Ends the change at the specified point. Must not be called before a call to beginChange.

Annotations
@Override
getFixedCornerback to summary
protected abstract Point2D getFixedCorner()

Returns the corner which is fixed during the change. Called once when the change begins.

Returns:Point2D

the corner which is fixed during the change