Class GeomFactory2d

    • Field Detail

      • SINGLETON

        public static final GeomFactory2d SINGLETON
        The singleton of the factory.
    • Constructor Detail

      • GeomFactory2d

        public GeomFactory2d()
    • Method Detail

      • newPoint

        public Point2d newPoint​(double x,
                                double y)
        Description copied from interface: GeomFactory2D
        Create a point.
        Specified by:
        newPoint in interface GeomFactory2D<Vector2d,​Point2d>
        Parameters:
        x - x coordinate of the point.
        y - y coordinate of the point.
        Returns:
        the point.
      • newPoint

        public Point2d newPoint​(int x,
                                int y)
        Description copied from interface: GeomFactory2D
        Create a point.
        Specified by:
        newPoint in interface GeomFactory2D<Vector2d,​Point2d>
        Parameters:
        x - x coordinate of the point.
        y - y coordinate of the point.
        Returns:
        the point.
      • newVector

        public Vector2d newVector​(double x,
                                  double y)
        Description copied from interface: GeomFactory2D
        Create a vector.
        Specified by:
        newVector in interface GeomFactory2D<Vector2d,​Point2d>
        Parameters:
        x - x coordinate of the vector.
        y - y coordinate of the vector.
        Returns:
        the vector.
      • newVector

        public Vector2d newVector​(int x,
                                  int y)
        Description copied from interface: GeomFactory2D
        Create a vector.
        Specified by:
        newVector in interface GeomFactory2D<Vector2d,​Point2d>
        Parameters:
        x - x coordinate of the vector.
        y - y coordinate of the vector.
        Returns:
        the vector.
      • newBox

        public Rectangle2d newBox​(double x,
                                  double y,
                                  double width,
                                  double height)
        Description copied from interface: GeomFactory2afp
        Create a bounding box.
        Specified by:
        newBox in interface GeomFactory2afp<PathElement2d,​Point2d,​Vector2d,​Rectangle2d>
        Parameters:
        x - the x coordinate of the lower corner.
        y - the y coordinate of the lower corner.
        width - the width of the box.
        height - the height of the box.
        Returns:
        the box.
      • newLinePathElement

        public PathElement2d newLinePathElement​(double startX,
                                                double startY,
                                                double targetX,
                                                double targetY)
        Description copied from interface: GeomFactory2afp
        Create a line-to path element to the given point.
        Specified by:
        newLinePathElement in interface GeomFactory2afp<PathElement2d,​Point2d,​Vector2d,​Rectangle2d>
        Parameters:
        startX - x coordinate of the start point.
        startY - y coordinate of the start point.
        targetX - x coordinate of the target point.
        targetY - y coordinate of the target point.
        Returns:
        the path element.
      • newClosePathElement

        public PathElement2d newClosePathElement​(double lastPointX,
                                                 double lastPointy,
                                                 double firstPointX,
                                                 double firstPointY)
        Description copied from interface: GeomFactory2afp
        Create a close path element.
        Specified by:
        newClosePathElement in interface GeomFactory2afp<PathElement2d,​Point2d,​Vector2d,​Rectangle2d>
        Parameters:
        lastPointX - x coordinate of the last point on the path
        lastPointy - y coordinate of the last point on the path
        firstPointX - x coordinate of the first point on the path.
        firstPointY - y coordinate of the first point on the path.
        Returns:
        the path element.
      • newCurvePathElement

        public PathElement2d newCurvePathElement​(double startX,
                                                 double startY,
                                                 double controlX,
                                                 double controlY,
                                                 double targetX,
                                                 double targetY)
        Description copied from interface: GeomFactory2afp
        Create a quadratic curve path element to the given point through the given control point.
        Specified by:
        newCurvePathElement in interface GeomFactory2afp<PathElement2d,​Point2d,​Vector2d,​Rectangle2d>
        Parameters:
        startX - x coordinate of the start point.
        startY - y coordinate of the start point.
        controlX - x coordinate of the control point.
        controlY - y coordinate of the control point.
        targetX - x coordinate of the target point.
        targetY - y coordinate of the target point.
        Returns:
        the path element.
      • newCurvePathElement

        public PathElement2d newCurvePathElement​(double startX,
                                                 double startY,
                                                 double controlX1,
                                                 double controlY1,
                                                 double controlX2,
                                                 double controlY2,
                                                 double targetX,
                                                 double targetY)
        Description copied from interface: GeomFactory2afp
        Create a curve path element to the given point through the two given control points.
        Specified by:
        newCurvePathElement in interface GeomFactory2afp<PathElement2d,​Point2d,​Vector2d,​Rectangle2d>
        Parameters:
        startX - x coordinate of the start point.
        startY - y coordinate of the start point.
        controlX1 - x coordinate of the control point.
        controlY1 - y coordinate of the control point.
        controlX2 - x coordinate of the control point.
        controlY2 - y coordinate of the control point.
        targetX - x coordinate of the target point.
        targetY - y coordinate of the target point.
        Returns:
        the path element.
      • newArcPathElement

        public PathElement2d newArcPathElement​(double startX,
                                               double startY,
                                               double targetX,
                                               double targetY,
                                               double radiusX,
                                               double radiusY,
                                               double xAxisRotation,
                                               boolean largeArcFlag,
                                               boolean sweepFlag)
        Description copied from interface: GeomFactory2afp
        Create an arc-to path element to the given point by following an ellipse arc.
        Specified by:
        newArcPathElement in interface GeomFactory2afp<PathElement2d,​Point2d,​Vector2d,​Rectangle2d>
        Parameters:
        startX - x coordinate of the start point.
        startY - y coordinate of the start point.
        targetX - x coordinate of the target point.
        targetY - y coordinate of the target point.
        radiusX - the X radius of the tilted ellipse.
        radiusY - the Y radius of the tilted ellipse.
        xAxisRotation - the angle of tilt of the ellipse.
        largeArcFlag - true iff the path will sweep the long way around the ellipse.
        sweepFlag - true iff the path will sweep clockwise around the ellipse.
        Returns:
        the path element.
      • newTriangle

        public Triangle2d newTriangle​(double x1,
                                      double y1,
                                      double x2,
                                      double y2,
                                      double x3,
                                      double y3)
        Description copied from interface: GeomFactory2afp
        Create a triangle.
        Specified by:
        newTriangle in interface GeomFactory2afp<PathElement2d,​Point2d,​Vector2d,​Rectangle2d>
        Parameters:
        x1 - the x coordinate of the first point of the triangle.
        y1 - the y coordinate of the first point of the triangle.
        x2 - the x coordinate of the second point of the triangle.
        y2 - the y coordinate of the second point of the triangle.
        x3 - the x coordinate of the third point of the triangle.
        y3 - the y coordinate of the third point of the triangle.
        Returns:
        the new triangle.
      • newSegment

        public Segment2d newSegment​(double x1,
                                    double y1,
                                    double x2,
                                    double y2)
        Description copied from interface: GeomFactory2afp
        Create a segment.
        Specified by:
        newSegment in interface GeomFactory2afp<PathElement2d,​Point2d,​Vector2d,​Rectangle2d>
        Parameters:
        x1 - the x coordinate of the first point of the segment.
        y1 - the y coordinate of the first point of the segment.
        x2 - the x coordinate of the second point of the segment.
        y2 - the y coordinate of the second point of the segment.
        Returns:
        the new segment.