Module org.controlsfx.controls
Class MoveChangeStrategy
java.lang.Object
impl.org.controlsfx.tools.rectangle.change.MoveChangeStrategy
- All Implemented Interfaces:
Rectangle2DChangeStrategy
Moves the rectangle around.
-
Constructor Summary
ConstructorsConstructorDescriptionMoveChangeStrategy(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).MoveChangeStrategy(Rectangle2D previous, Rectangle2D bounds) Creates a new change strategy which moves the specified rectangle within the specified bounds. -
Method Summary
Modifier and TypeMethodDescriptionprotected voidafterEndHook(Point2D point) Called after the change ends at the specified point.protected voidbeforeBeginHook(Point2D point) Called before the change begins at the specified point.final Rectangle2DbeginChange(Point2D point) Begins the change at the specified point.final Rectangle2DcontinueChange(Point2D point) Continues the change to the specified point.protected Rectangle2DBegins the change at the specified point.protected Rectangle2DdoContinue(Point2D point) Continues the change to the specified point.protected Rectangle2DEnds the change at the specified point.final Rectangle2DEnds the change at the specified point.protected final Rectangle2DThe previous rectangle this change is based on.protected final doublegetRatio()The current ratio.protected final booleanIndicates whether the ratio is fixed.
-
Constructor Details
-
MoveChangeStrategy
Creates a new change strategy which moves the specified rectangle within the specified bounds.- Parameters:
previous- the previous rectangle this move is based onbounds- the bounds within which the rectangle can be moved
-
MoveChangeStrategy
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- the previous rectangle this move is based onmaxX- the maximal x-coordinate of the right edge of the created rectangles; must be greater than or equal to the previous rectangle's widthmaxY- 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 Details
-
doBegin
Begins the change at the specified point.- Parameters:
point- a point- Returns:
- the new rectangle
-
doContinue
Continues the change to the specified point. Must not be called before a call toRectangle2DChangeStrategy.beginChange(javafx.geometry.Point2D).- Parameters:
point- a point- Returns:
- the new rectangle
-
doEnd
Ends the change at the specified point. Must not be called before a call toRectangle2DChangeStrategy.beginChange(javafx.geometry.Point2D).- Parameters:
point- a point- Returns:
- the new rectangle
-
getPrevious
The previous rectangle this change is based on.- Returns:
- the previous rectangle
-
isRatioFixed
protected final boolean isRatioFixed()Indicates whether the ratio is fixed. If so, the ratio can be accessed withgetRatio().- Returns:
- true if the ratio is fixed; false otherwise
-
getRatio
protected final double getRatio()The current ratio. Can only be called without exception whenisRatioFixed()returns true.- Returns:
- the current ratio
-
beginChange
Begins the change at the specified point.- Specified by:
beginChangein interfaceRectangle2DChangeStrategy- Parameters:
point- a point- Returns:
- the new rectangle
-
continueChange
Continues the change to the specified point. Must not be called before a call toRectangle2DChangeStrategy.beginChange(javafx.geometry.Point2D).- Specified by:
continueChangein interfaceRectangle2DChangeStrategy- Parameters:
point- a point- Returns:
- the new rectangle
-
endChange
Ends the change at the specified point. Must not be called before a call toRectangle2DChangeStrategy.beginChange(javafx.geometry.Point2D).- Specified by:
endChangein interfaceRectangle2DChangeStrategy- Parameters:
point- a point- Returns:
- the new rectangle
-
beforeBeginHook
Called before the change begins at the specified point.- Parameters:
point- a point
-
afterEndHook
Called after the change ends at the specified point.- Parameters:
point- a point
-