Module org.controlsfx.controls
Class MoveChangeStrategy
- java.lang.Object
- 
- impl.org.controlsfx.tools.rectangle.change.MoveChangeStrategy
 
- 
- All Implemented Interfaces:
- Rectangle2DChangeStrategy
 
 public class MoveChangeStrategy extends Object Moves the rectangle around.
- 
- 
Constructor SummaryConstructors Constructor Description 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).MoveChangeStrategy(Rectangle2D previous, Rectangle2D bounds)Creates a new change strategy which moves the specified rectangle within the specified bounds.
 - 
Method SummaryAll Methods Instance Methods Concrete Methods Modifier and Type Method Description protected 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.Rectangle2DbeginChange(Point2D point)Begins the change at the specified point.Rectangle2DcontinueChange(Point2D point)Continues the change to the specified point.protected Rectangle2DdoBegin(Point2D point)Begins the change at the specified point.protected Rectangle2DdoContinue(Point2D point)Continues the change to the specified point.protected Rectangle2DdoEnd(Point2D point)Ends the change at the specified point.Rectangle2DendChange(Point2D point)Ends the change at the specified point.protected Rectangle2DgetPrevious()The previous rectangle this change is based on.protected doublegetRatio()The current ratio.protected booleanisRatioFixed()Indicates whether the ratio is fixed.
 
- 
- 
- 
Constructor Detail- 
MoveChangeStrategypublic MoveChangeStrategy(Rectangle2D previous, Rectangle2D bounds) Creates a new change strategy which moves the specified rectangle within the specified bounds.- Parameters:
- previous- the previous rectangle this move is based on
- bounds- the bounds within which the rectangle can be moved
 
 - 
MoveChangeStrategypublic 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- the previous rectangle this move is based on
- maxX- 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- 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- 
doBeginprotected Rectangle2D doBegin(Point2D point) Begins the change at the specified point.- Parameters:
- point- a point
- Returns:
- the new rectangle
 
 - 
doContinueprotected Rectangle2D doContinue(Point2D point) 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
 
 - 
doEndprotected Rectangle2D doEnd(Point2D point) 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
 
 - 
getPreviousprotected final Rectangle2D getPrevious() The previous rectangle this change is based on.- Returns:
- the previous rectangle
 
 - 
isRatioFixedprotected 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
 
 - 
getRatioprotected final double getRatio() The current ratio. Can only be called without exception whenisRatioFixed()returns true.- Returns:
- the current ratio
 
 - 
beginChangepublic final Rectangle2D beginChange(Point2D point) Begins the change at the specified point.- Specified by:
- beginChangein interface- Rectangle2DChangeStrategy
- Parameters:
- point- a point
- Returns:
- the new rectangle
 
 - 
continueChangepublic final Rectangle2D continueChange(Point2D point) Continues the change to the specified point. Must not be called before a call toRectangle2DChangeStrategy.beginChange(javafx.geometry.Point2D).- Specified by:
- continueChangein interface- Rectangle2DChangeStrategy
- Parameters:
- point- a point
- Returns:
- the new rectangle
 
 - 
endChangepublic final Rectangle2D endChange(Point2D point) Ends the change at the specified point. Must not be called before a call toRectangle2DChangeStrategy.beginChange(javafx.geometry.Point2D).- Specified by:
- endChangein interface- Rectangle2DChangeStrategy
- Parameters:
- point- a point
- Returns:
- the new rectangle
 
 - 
beforeBeginHookprotected void beforeBeginHook(Point2D point) Called before the change begins at the specified point.- Parameters:
- point- a point
 
 - 
afterEndHookprotected void afterEndHook(Point2D point) Called after the change ends at the specified point.- Parameters:
- point- a point
 
 
- 
 
-