Ejemplo n.º 1
0
  private Path createPath(Rectangle outerBoundss, Graphics graphics) {
    // instead of just zooming the translated-points (see
    // getTranslatedPoints()),
    // better do the calculation again by first zooming and then translating
    // to avoid rounding errors.
    final int lineWidth = 1;
    final double zoom = 1.0;
    PointList points = FigureUtil.getAdjustedPointList(getPoints(), zoom, lineWidth);

    List<BezierPoint> bezierPoints = getBezierPoints(points, zoom);
    boolean isClosed = bezierPoints.get(0).equals(bezierPoints.get(bezierPoints.size() - 1));

    Path path = FigureUtil.getBezierPath(bezierPoints, isClosed);
    return path;
  }