java.lang.Object
org.jhotdraw8.fxbase.beans.SimpleObservable
org.jhotdraw8.draw.constrain.AbstractConstrainer
org.jhotdraw8.draw.constrain.NullConstrainer
- All Implemented Interfaces:
javafx.beans.Observable,Constrainer,ObservableMixin
NullConstrainer does not constrain anything.
- Author:
- Werner Randelshofer
-
Field Summary
Fields inherited from interface org.jhotdraw8.draw.constrain.Constrainer
DIRECTION_NEAREST, STYLECLASS_CONSTRAINER_MAJOR_GRID, STYLECLASS_CONSTRAINER_MINOR_GRID -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionjavafx.scene.NodegetNode()Returns a node that renders the grid in view coordinates.doubletranslateAngle(Figure f, double angle, double dir) Snaps an angle (in degrees) to the closest constrained orientation in the specified direction.translatePoint(Figure f, CssPoint2D cssp, CssPoint2D cssdir) Snaps a point to the next constrained location in the specified direction.translateRectangle(Figure f, CssRectangle2D cssr, CssPoint2D cssdir) Snaps a rectangle into the the closest constraint position in the given direction.voidupdateNode(DrawingView drawingView) Updates the node.Methods inherited from class org.jhotdraw8.fxbase.beans.SimpleObservable
getInvalidationListenersMethods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitMethods inherited from interface org.jhotdraw8.draw.constrain.Constrainer
constrainAngle, constrainPoint, constrainRectangleMethods inherited from interface javafx.beans.Observable
subscribeMethods inherited from interface org.jhotdraw8.fxbase.beans.ObservableMixin
addListener, fireInvalidated, fireInvalidated, invalidated, removeListener
-
Constructor Details
-
NullConstrainer
public NullConstrainer()
-
-
Method Details
-
translatePoint
Description copied from interface:ConstrainerSnaps a point to the next constrained location in the specified direction.This method changes the point which is passed as a parameter.
- Parameters:
f- The figure for which the point is to be constrained.cssp- A point on the drawing.cssdir- A direction vector. If the vector length is zero, then the nearest constrained location is used.- Returns:
- Returns the constrained point.
-
translateRectangle
Description copied from interface:ConstrainerSnaps a rectangle into the the closest constraint position in the given direction.This method changes the location of the rectangle which is passed as a parameter. This method does not change the size of the rectangle.
- Parameters:
f- The figure for which points are to be constrained.cssr- A rectangle on the drawing.cssdir- A direction vector. If the vector length is zero, then the nearest constrained location is used.- Returns:
- Returns the constrained rectangle.
-
translateAngle
Description copied from interface:ConstrainerSnaps an angle (in degrees) to the closest constrained orientation in the specified direction.- Parameters:
f- The figure for which the angle is to be constrained.angle- The angle (in degrees).dir- A direction. If the direction is zero, then the nearest constrained location is used.- Returns:
- The closest constrained angle (in radians) in the specified direction.
-
getNode
public javafx.scene.Node getNode()Description copied from interface:ConstrainerReturns a node that renders the grid in view coordinates.- Returns:
- the node
-
updateNode
Description copied from interface:ConstrainerUpdates the node.- Parameters:
drawingView- the drawing view
-