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

public Class MoveChangeStrategy

extends AbstractPreviousRectangleChangeStrategy
Class Inheritance
Imports
impl.org.controlsfx.tools.MathTools, java.util.Objects, javafx.geometry.Point2D, .Rectangle2D

Moves the rectangle around.

Field Summary

Modifier and TypeField and Description
private final Rectangle2D
bounds

A rectangle which defines the bounds within which the previous rectangle can be moved.

private Point2D
startingPoint

The starting point of the selection change.

Constructor Summary

AccessConstructor and Description
public
MoveChangeStrategy(Rectangle2D
the previous rectangle this move is based on
previous
,
Rectangle2D
the bounds within which the rectangle can be moved
bounds
)

Creates a new change strategy which moves the specified rectangle within the specified bounds.

public
MoveChangeStrategy(Rectangle2D
the previous rectangle this move is based on
previous
,
double
the maximal x-coordinate of the right edge of the created rectangles; must be greater than or equal to the previous rectangle's width
maxX
,
double
the maximal y-coordinate of the lower edge of the created rectangles; must be greater than or equal to the previous rectangle's height
maxY
)

Creates a new change strategy which moves the specified rectangle within the specified bounds defined by the rectangle from (0, 0) to (maxX, maxY).

Method Summary

Modifier and TypeMethod and Description
protected 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 Rectangle2D
doEnd(Point2D point)

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

Ends the change at the specified point.

private final Rectangle2D

Returns:

the moved rectangle
moveRectangleToPoint
(Point2D
the vector from the startingPoint to this point defines the movement
point
)

Moves the previous rectangle to the specified point relative to the startingPoint.

Inherited from impl.org.controlsfx.tools.rectangle.change.AbstractPreviousRectangleChangeStrategy:
getPrevious

Field Detail

boundsback to summary
private final Rectangle2D bounds

A rectangle which defines the bounds within which the previous rectangle can be moved.

startingPointback to summary
private Point2D startingPoint

The starting point of the selection change. The move will be computed relative to this point.

Constructor Detail

MoveChangeStrategyback to summary
public MoveChangeStrategy(Rectangle2D previous, Rectangle2D bounds)

Creates a new change strategy which moves the specified rectangle within the specified bounds.

Parameters
previous:Rectangle2D

the previous rectangle this move is based on

bounds:Rectangle2D

the bounds within which the rectangle can be moved

MoveChangeStrategyback to summary
public MoveChangeStrategy(Rectangle2D previous, double maxX, double maxY)

Creates a new change strategy which moves the specified rectangle within the specified bounds defined by the rectangle from (0, 0) to (maxX, maxY).

Parameters
previous:Rectangle2D

the previous rectangle this move is based on

maxX:double

the maximal x-coordinate of the right edge of the created rectangles; must be greater than or equal to the previous rectangle's width

maxY:double

the maximal y-coordinate of the lower edge of the created rectangles; must be greater than or equal to the previous rectangle's height

Method Detail

doBeginback to summary
protected 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 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
moveRectangleToPointback to summary
private final Rectangle2D moveRectangleToPoint(Point2D point)

Moves the previous rectangle to the specified point relative to the startingPoint.

Parameters
point:Point2D

the vector from the startingPoint to this point defines the movement

Returns:Rectangle2D

the moved rectangle