Module org.controlsfx.controls
Class NewChangeStrategy
java.lang.Object
impl.org.controlsfx.tools.rectangle.change.NewChangeStrategy
- All Implemented Interfaces:
Rectangle2DChangeStrategy
A strategy which creates a new rectangle.
-
Constructor Summary
ConstructorsConstructorDescriptionNewChangeStrategy(boolean ratioFixed, double ratio, Rectangle2D bounds) Creates a change strategy which creates a new rectangle. -
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 final Rectangle2DBegins the change at the specified point.protected Rectangle2DdoContinue(Point2D point) Continues the change to the specified point.protected final Rectangle2DEnds the change at the specified point.final Rectangle2DEnds the change at the specified point.protected Point2DReturns the corner which is fixed during the change.protected final doublegetRatio()The current ratio.protected final booleanIndicates whether the ratio is fixed.
-
Constructor Details
-
NewChangeStrategy
Creates a change strategy which creates a new rectangle. It respects the specifiedratioifratioFixedistrue.- Parameters:
ratioFixed- indicates whether the ratio will be fixedratio- defines the fixed ratiobounds- the bounds within which the new rectangle must be contained
-
-
Method Details
-
beforeBeginHook
Called before the change begins at the specified point.- Parameters:
point- a point
-
getFixedCorner
Returns the corner which is fixed during the change. Called once when the change begins.- Returns:
- the corner which is fixed during the change
-
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
-
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
-
afterEndHook
Called after the change ends at the specified point.- Parameters:
point- a point
-