/**
  * Creates a new instance of ArcTo.
  *
  * @param radiusX horizontal radius of the arc
  * @param radiusY vertical radius of the arc
  * @param xAxisRotation the x-axis rotation in degrees
  * @param x horizontal position of the arc end point
  * @param y vertical position of the arc end point
  * @param largeArcFlag large arg flag: determines which arc to use (large/small)
  * @param sweepFlag sweep flag: determines which arc to use (direction)
  */
 public ArcTo(
     double radiusX,
     double radiusY,
     double xAxisRotation,
     double x,
     double y,
     boolean largeArcFlag,
     boolean sweepFlag) {
   setRadiusX(radiusX);
   setRadiusY(radiusY);
   setXAxisRotation(xAxisRotation);
   setX(x);
   setY(y);
   setLargeArcFlag(largeArcFlag);
   setSweepFlag(sweepFlag);
 }
Esempio n. 2
0
  private Path createEllipsePath(
      double centerX, double centerY, double radiusX, double radiusY, double rotate) {
    ArcTo arcTo = new ArcTo();
    arcTo.setX(centerX - radiusX + 1); // to simulate a full 360 degree celcius circle.
    arcTo.setY(centerY - radiusY);
    arcTo.setSweepFlag(false);
    arcTo.setLargeArcFlag(true);
    arcTo.setRadiusX(radiusX);
    arcTo.setRadiusY(radiusY);
    arcTo.setXAxisRotation(rotate);

    Path path =
        PathBuilder.create()
            .elements(
                new MoveTo(centerX - radiusX, centerY - radiusY),
                arcTo,
                new ClosePath()) // close 1 px gap.
            .build();
    path.setStroke(Color.DODGERBLUE);
    path.getStrokeDashArray().setAll(5d, 5d);
    return path;
  }