Class NullConstrainer

All Implemented Interfaces:
javafx.beans.Observable, Constrainer, ObservableMixin

public class NullConstrainer extends AbstractConstrainer
NullConstrainer does not constrain anything.
Author:
Werner Randelshofer
  • Constructor Details

    • NullConstrainer

      public NullConstrainer()
  • Method Details

    • translatePoint

      public @NonNull CssPoint2D translatePoint(Figure f, @NonNull CssPoint2D cssp, @NonNull CssPoint2D cssdir)
      Description copied from interface: Constrainer
      Snaps 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

      public @NonNull CssRectangle2D translateRectangle(Figure f, @NonNull CssRectangle2D cssr, @NonNull CssPoint2D cssdir)
      Description copied from interface: Constrainer
      Snaps 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

      public double translateAngle(Figure f, double angle, double dir)
      Description copied from interface: Constrainer
      Snaps 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 @NonNull javafx.scene.Node getNode()
      Description copied from interface: Constrainer
      Returns a node that renders the grid in view coordinates.
      Returns:
      the node
    • updateNode

      public void updateNode(DrawingView drawingView)
      Description copied from interface: Constrainer
      Updates the node.
      Parameters:
      drawingView - the drawing view