Java Code Examples for java.awt.geom.GeneralPath#append()

The following examples show how to use java.awt.geom.GeneralPath#append() . You can vote up the ones you like or vote down the ones you don't like, and go to the original project or source file by following the links above each example. You may check out the related API usage on the sidebar.
Example 1
Source File: Flag.java    From freecol with GNU General Public License v2.0 6 votes vote down vote up
/**
 * Returns either a single star, or a circle of stars with the
 * given radius, centered at the origin.
 *
 * @param radius The radius of the circle.
 * @return The circle of stars.
 */
private GeneralPath getCircleOfStars(double radius) {
    double phi = Math.PI * 2 / stars;
    GeneralPath unionPath = new GeneralPath();
    if (stars == 0) {
        // nothing to do
    } else if (stars == 1) {
        // one double sized star
        unionPath = getStar(2, 0, 0);
    } else if (stars == 2) {
        // two larger stars, on the x axis
        unionPath.append(getStar(1.5, -radius, 0), false);
        unionPath.append(getStar(1.5, radius, 0), false);
    } else {
        // a general circle of stars
        for (int i = 0; i < stars; i++) {
            double x = -radius - radius * Math.sin(i * phi);
            double y = -radius * Math.cos(i * phi);
            unionPath.append(getStar(x, y), false);
        }
    }
    return unionPath;
}
 
Example 2
Source File: Cursor.java    From Freerouting with GNU General Public License v3.0 6 votes vote down vote up
public void draw(Graphics p_graphics)
{
    
    if (!location_initialized)
    {
        return;
    }
    Graphics2D g2 = (Graphics2D)p_graphics;
    init_graphics(g2);
    GeneralPath draw_path = new GeneralPath(GeneralPath.WIND_EVEN_ODD);
    draw_path.append(VERTICAL_LINE, false);
    draw_path.append(HORIZONTAL_LINE, false);
    draw_path.append(RIGHT_DIAGONAL_LINE, false);
    draw_path.append(LEFT_DIAGONAL_LINE, false);
    g2.translate(this.x_coor, this.y_coor);
    g2.draw(draw_path);
}
 
Example 3
Source File: LayoutPathImpl.java    From openjdk-jdk9 with GNU General Public License v2.0 6 votes vote down vote up
public Shape mapShape(Shape s) {
    if (LOGMAP) LOG.format("mapshape on path: %s\n", LayoutPathImpl.SegmentPath.this);
    PathIterator pi = s.getPathIterator(null, 1); // cheap way to handle curves.

    if (LOGMAP) LOG.format("start\n");
    init();

    final double[] coords = new double[2];
    while (!pi.isDone()) {
        switch (pi.currentSegment(coords)) {
        case SEG_CLOSE: close(); break;
        case SEG_MOVETO: moveTo(coords[0], coords[1]); break;
        case SEG_LINETO: lineTo(coords[0], coords[1]); break;
        default: break;
        }

        pi.next();
    }
    if (LOGMAP) LOG.format("finish\n\n");

    GeneralPath gp = new GeneralPath();
    for (Segment seg: segments) {
        gp.append(seg.gp, false);
    }
    return gp;
}
 
Example 4
Source File: Underline.java    From jdk8u-jdk with GNU General Public License v2.0 6 votes vote down vote up
Shape getUnderlineShape(float thickness,
                        float x1,
                        float x2,
                        float y) {

    GeneralPath gp = new GeneralPath();

    Line2D.Float line = new Line2D.Float(x1, y, x2, y);
    gp.append(stroke.createStrokedShape(line), false);

    line.y1 += DEFAULT_THICKNESS;
    line.y2 += DEFAULT_THICKNESS;
    line.x1 += DEFAULT_THICKNESS;

    gp.append(stroke.createStrokedShape(line), false);

    return gp;
}
 
Example 5
Source File: FocusedBorder.java    From pumpernickel with MIT License 6 votes vote down vote up
public void paintBorder(Component c, Graphics g, int x, int y, int width,
		int height) {
	Insets insets = getBorderInsets(c);
	if (c.hasFocus()) {
		Rectangle rect = new Rectangle(x + insets.left, y + insets.top,
				width - insets.left - insets.right - 1, height - insets.top
						- insets.bottom - 1);
		Graphics2D g2 = (Graphics2D) g.create();
		GeneralPath focusOnly = new GeneralPath(Path2D.WIND_EVEN_ODD);
		focusOnly.append(new Rectangle(x, y, width, height), false);
		focusOnly.append(new Rectangle(x + insets.left, y + insets.top,
				width - insets.left - insets.right, height - insets.top
						- insets.bottom), false);
		g2.clip(focusOnly);
		PlafPaintUtils.paintFocus(g2, rect, 3);
	} else if (unfocusedBorder != null) {
		Insets borderInsets = unfocusedBorder.getBorderInsets(c);
		unfocusedBorder.paintBorder(c, g, x + insets.left
				- borderInsets.left, y + insets.top - borderInsets.top,
				width - insets.left - insets.right + borderInsets.left
						+ borderInsets.right, height - insets.top
						- insets.bottom + borderInsets.top
						+ borderInsets.bottom);
	}

}
 
Example 6
Source File: Flag.java    From freecol with GNU General Public License v2.0 6 votes vote down vote up
private GeneralPath getCross(Decoration decoration) {
    double quarterWidth = (WIDTH - DECORATION_SIZE) / 2;
    double quarterHeight = (HEIGHT - DECORATION_SIZE) / 2;
    double offset = 0;
    double width = WIDTH;
    double height = HEIGHT;
    switch(decoration) {
    case SCANDINAVIAN_CROSS:
        offset = CROSS_OFFSET;
        break;
    case GREEK_CROSS:
        width = height = Math.min(WIDTH, HEIGHT) - 2 * DECORATION_SIZE;
        break;
    default:
        break;
    }
    GeneralPath cross = new GeneralPath();
    cross.append(new Rectangle2D.Double((WIDTH - width) / 2, quarterHeight,
                                        width, DECORATION_SIZE), false);
    cross.append(new Rectangle2D.Double(quarterWidth - offset, (HEIGHT - height) / 2,
                                        DECORATION_SIZE, height), false);
    return cross;
}
 
Example 7
Source File: LayoutPathImpl.java    From jdk8u60 with GNU General Public License v2.0 6 votes vote down vote up
public Shape mapShape(Shape s) {
    if (LOGMAP) LOG.format("mapshape on path: %s\n", LayoutPathImpl.SegmentPath.this);
    PathIterator pi = s.getPathIterator(null, 1); // cheap way to handle curves.

    if (LOGMAP) LOG.format("start\n");
    init();

    final double[] coords = new double[2];
    while (!pi.isDone()) {
        switch (pi.currentSegment(coords)) {
        case SEG_CLOSE: close(); break;
        case SEG_MOVETO: moveTo(coords[0], coords[1]); break;
        case SEG_LINETO: lineTo(coords[0], coords[1]); break;
        default: break;
        }

        pi.next();
    }
    if (LOGMAP) LOG.format("finish\n\n");

    GeneralPath gp = new GeneralPath();
    for (Segment seg: segments) {
        gp.append(seg.gp, false);
    }
    return gp;
}
 
Example 8
Source File: LayoutPathImpl.java    From jdk8u-jdk with GNU General Public License v2.0 6 votes vote down vote up
public Shape mapShape(Shape s) {
    if (LOGMAP) LOG.format("mapshape on path: %s\n", LayoutPathImpl.SegmentPath.this);
    PathIterator pi = s.getPathIterator(null, 1); // cheap way to handle curves.

    if (LOGMAP) LOG.format("start\n");
    init();

    final double[] coords = new double[2];
    while (!pi.isDone()) {
        switch (pi.currentSegment(coords)) {
        case SEG_CLOSE: close(); break;
        case SEG_MOVETO: moveTo(coords[0], coords[1]); break;
        case SEG_LINETO: lineTo(coords[0], coords[1]); break;
        default: break;
        }

        pi.next();
    }
    if (LOGMAP) LOG.format("finish\n\n");

    GeneralPath gp = new GeneralPath();
    for (Segment seg: segments) {
        gp.append(seg.gp, false);
    }
    return gp;
}
 
Example 9
Source File: ArcDialFrame.java    From ECG-Viewer with GNU General Public License v2.0 6 votes vote down vote up
/**
 * Returns the shape for the window for this dial.  Some dial layers will
 * request that their drawing be clipped within this window.
 *
 * @param frame  the reference frame (<code>null</code> not permitted).
 *
 * @return The shape of the dial's window.
 */
@Override
public Shape getWindow(Rectangle2D frame) {

    Rectangle2D innerFrame = DialPlot.rectangleByRadius(frame,
            this.innerRadius, this.innerRadius);
    Rectangle2D outerFrame = DialPlot.rectangleByRadius(frame,
            this.outerRadius, this.outerRadius);
    Arc2D inner = new Arc2D.Double(innerFrame, this.startAngle,
            this.extent, Arc2D.OPEN);
    Arc2D outer = new Arc2D.Double(outerFrame, this.startAngle
            + this.extent, -this.extent, Arc2D.OPEN);
    GeneralPath p = new GeneralPath();
    Point2D point1 = inner.getStartPoint();
    p.moveTo((float) point1.getX(), (float) point1.getY());
    p.append(inner, true);
    p.append(outer, true);
    p.closePath();
    return p;

}
 
Example 10
Source File: ArrowedStroke.java    From ramus with GNU General Public License v3.0 5 votes vote down vote up
public Shape createStrokedShape(Shape shape) {
    // We are flattening the path iterator to only get line segments.
    PathIterator path = shape.getPathIterator(null, 1);
    float points[] = new float[6];
    GeneralPath strokepath = new GeneralPath();
    float ix = 0, iy = 0;
    float px = 0, py = 0;

    while (!path.isDone()) {
        int type = path.currentSegment(points);
        switch (type) {
            case PathIterator.SEG_MOVETO:
                ix = px = points[0];
                iy = py = points[1];
                strokepath.moveTo(ix, iy);
                break;
            case PathIterator.SEG_LINETO:
                strokepath.append(createArrow(px, py, points[0], points[1]),
                        false);
                px = points[0];
                py = points[1];
                break;
            case PathIterator.SEG_CLOSE:
                if (px != ix && py != ix)
                    strokepath.append(createArrow(px, py, ix, iy), false);
                break;
            default:
                strokepath.append(createArrow(px, py, points[0], points[1]),
                        false);
                px = points[0];
                py = points[1];
                // never appear.
        }
        path.next();
    }
    return strokepath;
}
 
Example 11
Source File: StandardGlyphVector.java    From jdk8u60 with GNU General Public License v2.0 5 votes vote down vote up
void appendGlyphOutline(int glyphID, GeneralPath result, float x, float y) {
    // !!! fontStrike needs a method for this.  For that matter, GeneralPath does.
    GeneralPath gp = null;
    if (sgv.invdtx == null) {
        gp = strike.getGlyphOutline(glyphID, x + dx, y + dy);
    } else {
        gp = strike.getGlyphOutline(glyphID, 0, 0);
        gp.transform(sgv.invdtx);
        gp.transform(AffineTransform.getTranslateInstance(x + dx, y + dy));
    }
    PathIterator iterator = gp.getPathIterator(null);
    result.append(iterator, false);
}
 
Example 12
Source File: LivreBase.java    From brModelo with GNU General Public License v3.0 5 votes vote down vote up
public Shape getRegiaoNota() {
    if (Regiao == null) {
        final int v1 = getHeight() / 3;
        final int h1 = getWidth() / 2;
        final int repo = v1 / 3;
        final int L = getLeft();
        final int T = getTop();
        final int TH = T + getHeight() - repo;
        final int LW = L + getWidth();
        CubicCurve2D c = new CubicCurve2D.Double();
        c.setCurve(LW, TH, LW - h1, TH - v1, L + h1, TH + v1, L, TH);
        CubicCurve2D c2 = new CubicCurve2D.Double();
        int v2 = v1 / 3;
        c2.setCurve(L, T + v2, L + h1, T + v1 + v2, LW - h1, T - v1 + v2, LW, T + v2);

        GeneralPath pa = new GeneralPath();
        pa.setWindingRule(GeneralPath.WIND_EVEN_ODD);
        pa.append(c2, true);
        pa.lineTo(LW, TH);
        pa.append(c, true);
        pa.lineTo(L,  T + v2);
        pa.closePath();

        Regiao = pa;
        int ptToMove = 3;
        this.reposicionePonto[ptToMove] = new Point(0, -repo);
        ptsToMove[ptToMove] = 1;
        ptToMove = 1;
        this.reposicionePonto[ptToMove] = new Point(0, repo);
        ptsToMove[ptToMove] = 1;
    }
    return Regiao;
}
 
Example 13
Source File: CompositeStrike.java    From openjdk-8-source with GNU General Public License v2.0 5 votes vote down vote up
GeneralPath getGlyphVectorOutline(int[] glyphs, float x, float y) {
    GeneralPath path = null;
    GeneralPath gp;
    int glyphIndex = 0;
    int[] tmpGlyphs;

    while (glyphIndex < glyphs.length) {
        int start = glyphIndex;
        int slot = glyphs[glyphIndex] >>> 24;
        while (glyphIndex < glyphs.length &&
               (glyphs[glyphIndex+1] >>> 24) == slot) {
            glyphIndex++;
        }
        int tmpLen = glyphIndex-start+1;
        tmpGlyphs = new int[tmpLen];
        for (int i=0;i<tmpLen;i++) {
            tmpGlyphs[i] = glyphs[i] & SLOTMASK;
        }
        gp = getStrikeForSlot(slot).getGlyphVectorOutline(tmpGlyphs, x, y);
        if (path == null) {
            path = gp;
        } else if (gp != null) {
            path.append(gp, false);
        }
    }
    if (path == null) {
        return new GeneralPath();
    } else {
        return path;
    }
}
 
Example 14
Source File: BorderRenderer.java    From pentaho-reporting with GNU Lesser General Public License v2.1 5 votes vote down vote up
public Shape getBorderLeftShape() {
  if ( borderShapeLeft != null ) {
    return borderShapeLeft;
  }

  final StaticBoxLayoutProperties sblp = this.staticBoxLayoutProperties;
  final long halfBorderWidth = sblp.getBorderLeft() / 2;
  final long x = this.x;
  final long y = this.y;
  final long h = this.height;

  final Border border = boxDefinition.getBorder();
  final long topLeftWidth = border.getTopLeft().getWidth();
  final long topLeftHeight = border.getTopLeft().getHeight();
  final long bottomLeftWidth = border.getBottomLeft().getWidth();
  final long bottomLeftHeight = border.getBottomLeft().getHeight();

  if ( bottomLeftWidth == 0 && topLeftWidth == 0 && bottomLeftHeight == 0 && topLeftHeight == 0 ) {
    // Make a square corner
    final double lineX = StrictGeomUtility.toExternalValue( x + halfBorderWidth );
    final double lineY1 = StrictGeomUtility.toExternalValue( y );
    final double lineY2 = StrictGeomUtility.toExternalValue( y + h );
    borderShapeLeft = new Line2D.Double( lineX, lineY1, lineX, lineY2 );
    return borderShapeLeft;
  }

  // Make a rounded corner
  final GeneralPath generalPath = new GeneralPath( GeneralPath.WIND_NON_ZERO, 20 );
  generalPath.append( configureArc( x, y + h - 2 * bottomLeftHeight, 2 * bottomLeftWidth, 2 * bottomLeftHeight, -135,
      -45, Arc2D.OPEN ), true );
  generalPath.lineTo( (float) x, (float) ( y + topLeftHeight ) ); // 8
  generalPath.append( configureArc( x, y, 2 * topLeftWidth, 2 * topLeftHeight, -180, -45, Arc2D.OPEN ), true );
  generalPath.transform( BorderRenderer.scaleInstance );
  borderShapeLeft = generalPath;
  return generalPath;
}
 
Example 15
Source File: CompositeStrike.java    From hottub with GNU General Public License v2.0 5 votes vote down vote up
GeneralPath getGlyphVectorOutline(int[] glyphs, float x, float y) {
    GeneralPath path = null;
    GeneralPath gp;
    int glyphIndex = 0;
    int[] tmpGlyphs;

    while (glyphIndex < glyphs.length) {
        int start = glyphIndex;
        int slot = glyphs[glyphIndex] >>> 24;
        while (glyphIndex < glyphs.length &&
               (glyphs[glyphIndex+1] >>> 24) == slot) {
            glyphIndex++;
        }
        int tmpLen = glyphIndex-start+1;
        tmpGlyphs = new int[tmpLen];
        for (int i=0;i<tmpLen;i++) {
            tmpGlyphs[i] = glyphs[i] & SLOTMASK;
        }
        gp = getStrikeForSlot(slot).getGlyphVectorOutline(tmpGlyphs, x, y);
        if (path == null) {
            path = gp;
        } else if (gp != null) {
            path.append(gp, false);
        }
    }
    if (path == null) {
        return new GeneralPath();
    } else {
        return path;
    }
}
 
Example 16
Source File: TextLine.java    From jdk1.8-source-analysis with Apache License 2.0 5 votes vote down vote up
public Shape getOutline(AffineTransform tx) {

        GeneralPath dstShape = new GeneralPath(GeneralPath.WIND_NON_ZERO);

        for (int i=0, n = 0; i < fComponents.length; i++, n += 2) {
            TextLineComponent tlc = fComponents[getComponentLogicalIndex(i)];

            dstShape.append(tlc.getOutline(locs[n], locs[n+1]), false);
        }

        if (tx != null) {
            dstShape.transform(tx);
        }
        return dstShape;
    }
 
Example 17
Source File: CompositeStrike.java    From openjdk-jdk9 with GNU General Public License v2.0 5 votes vote down vote up
GeneralPath getGlyphVectorOutline(int[] glyphs, float x, float y) {
    GeneralPath path = null;
    GeneralPath gp;
    int glyphIndex = 0;
    int[] tmpGlyphs;

    while (glyphIndex < glyphs.length) {
        int start = glyphIndex;
        int slot = glyphs[glyphIndex] >>> 24;
        while (glyphIndex < glyphs.length &&
               (glyphs[glyphIndex+1] >>> 24) == slot) {
            glyphIndex++;
        }
        int tmpLen = glyphIndex-start+1;
        tmpGlyphs = new int[tmpLen];
        for (int i=0;i<tmpLen;i++) {
            tmpGlyphs[i] = glyphs[i] & SLOTMASK;
        }
        gp = getStrikeForSlot(slot).getGlyphVectorOutline(tmpGlyphs, x, y);
        if (path == null) {
            path = gp;
        } else if (gp != null) {
            path.append(gp, false);
        }
    }
    if (path == null) {
        return new GeneralPath();
    } else {
        return path;
    }
}
 
Example 18
Source File: BorderRenderer.java    From pentaho-reporting with GNU Lesser General Public License v2.1 4 votes vote down vote up
public Shape getBorderShape() {
  if ( borderShape != null ) {
    return borderShape;
  }

  final StaticBoxLayoutProperties sblp = this.staticBoxLayoutProperties;
  final long x = this.x + ( sblp.getBorderLeft() / 2 );
  final long y = this.y + ( sblp.getBorderTop() / 2 );
  final long w = this.width - ( ( sblp.getBorderLeft() + sblp.getBorderRight() ) / 2 );
  final long h = this.height - ( ( sblp.getBorderTop() + sblp.getBorderBottom() ) / 2 );

  final Border border = boxDefinition.getBorder();
  final long topLeftWidth = border.getTopLeft().getWidth();
  final long topLeftHeight = border.getTopLeft().getHeight();
  final long topRightWidth;
  final long topRightHeight;
  final long bottomLeftWidth;
  final long bottomLeftHeight;
  final long bottomRightWidth;
  final long bottomRightHeight;
  if ( isSameForAllSides() ) {
    topRightWidth = topLeftWidth;
    topRightHeight = topLeftHeight;
    bottomLeftWidth = topLeftWidth;
    bottomLeftHeight = topLeftHeight;
    bottomRightWidth = topLeftWidth;
    bottomRightHeight = topLeftHeight;
  } else {
    topRightWidth = border.getTopRight().getWidth();
    topRightHeight = border.getTopRight().getHeight();
    bottomLeftWidth = border.getBottomLeft().getWidth();
    bottomLeftHeight = border.getBottomLeft().getHeight();
    bottomRightWidth = border.getBottomRight().getWidth();
    bottomRightHeight = border.getBottomRight().getHeight();
  }

  if ( topLeftHeight == 0 && topRightHeight == 0 && topLeftWidth == 0 && topRightWidth == 0 && bottomLeftHeight == 0
      && bottomRightHeight == 0 && bottomLeftWidth == 0 && bottomRightWidth == 0 ) {
    borderShape =
        new Rectangle2D.Double( StrictGeomUtility.toExternalValue( x ), StrictGeomUtility.toExternalValue( y ),
            StrictGeomUtility.toExternalValue( w ), StrictGeomUtility.toExternalValue( h ) );
    return borderShape;
  }

  final GeneralPath generalPath = new GeneralPath( GeneralPath.WIND_NON_ZERO, 200 );
  generalPath.append( configureArc( x, y, 2 * topLeftWidth, 2 * topLeftHeight, -225, -45, Arc2D.OPEN ), true );
  generalPath.lineTo( (float) ( x + w - topRightWidth ), (float) y ); // 2
  generalPath.append( configureArc( x + w - 2 * topRightWidth, y, 2 * topRightWidth, 2 * topRightHeight, 90, -45,
      Arc2D.OPEN ), true );

  generalPath.append( configureArc( x + w - 2 * topRightWidth, y, 2 * topRightWidth, 2 * topRightHeight, 45, -45,
      Arc2D.OPEN ), true );
  generalPath.lineTo( (float) ( x + w ), (float) ( y + h - bottomRightHeight ) ); // 4
  generalPath.append( configureArc( x + w - 2 * bottomRightWidth, y + h - 2 * bottomRightHeight,
      2 * bottomRightWidth, 2 * bottomRightHeight, 0, -45, Arc2D.OPEN ), true );

  generalPath.append( configureArc( x + w - 2 * bottomRightWidth, y + h - 2 * bottomRightHeight,
      2 * bottomRightWidth, 2 * bottomRightHeight, -45, -45, Arc2D.OPEN ), true );
  generalPath.lineTo( (float) ( x + bottomLeftWidth ), (float) ( y + h ) ); // 6
  generalPath.append( configureArc( x, y + h - 2 * bottomLeftHeight, 2 * bottomLeftWidth, 2 * bottomLeftHeight, -90,
      -45, Arc2D.OPEN ), true );

  generalPath.append( configureArc( x, y + h - 2 * bottomLeftHeight, 2 * bottomLeftWidth, 2 * bottomLeftHeight, -135,
      -45, Arc2D.OPEN ), true );
  generalPath.lineTo( (float) x, (float) ( y + topLeftHeight ) ); // 8
  generalPath.append( configureArc( x, y, 2 * topLeftWidth, 2 * topLeftHeight, -180, -45, Arc2D.OPEN ), true );

  generalPath.closePath();
  generalPath.transform( BorderRenderer.scaleInstance );
  borderShape = generalPath;
  return generalPath;
}
 
Example 19
Source File: DesktopCanvas2DImpl.java    From consulo with Apache License 2.0 4 votes vote down vote up
@Override
public void rect(double x, double y, double w, double h) {
  currentPath = new GeneralPath();
  currentPath.append(new Rectangle2D.Double((state.dx + x) * state.scale, (state.dy + y) * state.scale, w * state.scale, h * state.scale), false);
}
 
Example 20
Source File: Arc.java    From gama with GNU General Public License v3.0 4 votes vote down vote up
/**
 * Adds an elliptical arc, defined by two radii, an angle from the x-axis, a flag to choose the large arc or not, a
 * flag to indicate if we increase or decrease the angles and the final point of the arc.
 *
 * @param rx
 *            the x radius of the ellipse
 * @param ry
 *            the y radius of the ellipse
 *
 * @param angle
 *            the angle from the x-axis of the current coordinate system to the x-axis of the ellipse in degrees.
 *
 * @param largeArcFlag
 *            the large arc flag. If true the arc spanning less than or equal to 180 degrees is chosen, otherwise
 *            the arc spanning greater than 180 degrees is chosen
 *
 * @param sweepFlag
 *            the sweep flag. If true the line joining center to arc sweeps through decreasing angles otherwise it
 *            sweeps through increasing angles
 *
 * @param x
 *            the absolute x coordinate of the final point of the arc.
 * @param y
 *            the absolute y coordinate of the final point of the arc.
 * @param x0
 *            - The absolute x coordinate of the initial point of the arc.
 * @param y0
 *            - The absolute y coordinate of the initial point of the arc.
 */
public void arcTo(final GeneralPath path, final float rx, final float ry, final float angle,
		final boolean largeArcFlag, final boolean sweepFlag, final float x, final float y, final float x0,
		final float y0) {

	// Ensure radii are valid
	if (rx == 0 || ry == 0) {
		path.lineTo(x, y);
		return;
	}

	if (x0 == x && y0 == y) {
		// If the endpoints (x, y) and (x0, y0) are identical, then this
		// is equivalent to omitting the elliptical arc segment entirely.
		return;
	}

	final Arc2D arc = computeArc(x0, y0, rx, ry, angle, largeArcFlag, sweepFlag, x, y);

	final AffineTransform t =
			AffineTransform.getRotateInstance(Math.toRadians(angle), arc.getCenterX(), arc.getCenterY());
	final Shape s = t.createTransformedShape(arc);
	path.append(s, true);
}