curve.quadTo(x, y + endydelta / 2, x, y + endydelta); curve.lineTo(x, y2); curve.lineTo(x2, y2); curve.lineTo(x2, y + endydelta); curve.quadTo(x2, y + endydelta / 2, x2 - topxdelta, y); curve.lineTo(x + topxdelta, y); innercurve.quadTo(x + 1, y + endydelta / 2, x + 1, y + endydelta); innercurve.lineTo(x + 1, y2 - 1); innercurve.lineTo(x2 - 1, y2 - 1); innercurve.lineTo(x2 - 1, y + endydelta); innercurve.quadTo(x2 - 1, y + endydelta / 2, x2 - topxdelta, y + 1); innercurve.lineTo(x + topxdelta, y + 1);
n1 = calcIntersection( pair.second[0], pair.second[1], n1, n2 ); n2 = calcIntersection( pair.second[2], pair.second[3], n2, normals.peek() ); path.quadTo( n1[0], n1[1], n2[0], n2[1] ); break;
py = buffer[3]; if (ctrlPoint != null) { path.quadTo(ctrlPoint.getX(), ctrlPoint.getY(), px, py); } else { path.lineTo(px, py);
py = buffer[3]; if (ctrlPoint != null) { path.quadTo(ctrlPoint.getX(), ctrlPoint.getY(), px, py); } else { path.lineTo(px, py);
current.x[0], current.y[0]); } else { gp.quadTo( current.x[1], current.y[1], current.x[0], current.y[0]); gp.quadTo( previous.x[2], previous.y[2], current.x[0], current.y[0]); current.x[0], current.y[0]); } else { gp.quadTo( current.x[1], current.y[1], current.x[0], current.y[0]); gp.quadTo( previous.x[2], previous.y[2], current.x[0], current.y[0]);
path.quadTo( midp[0], midp[1], p2[0], p2[1] ); return; case Standard:
for (int i = 0; i < numberOfSegments - 1; ++i) { centerLinePoint.scaleAdd(gap / 2.0, (Tuple2d) line, (Tuple2d) centerLinePoint); path.quadTo(tipPoint.x, tipPoint.y, centerLinePoint.x, centerLinePoint.y); centerLinePoint.scaleAdd(gap / 2.0, (Tuple2d) line, (Tuple2d) centerLinePoint); tipPoint = new Point2d(centerLinePoint);
private void handleClose( double[] last, double[] firstNormal, double firstx, double firsty, java.awt.geom.Path2D.Double path ) { switch ( type.type ) { case Edged: double[] n = new double[] { last[0] + firstNormal[0], last[1] + firstNormal[1] }; double len = sqrt( n[0] * n[0] + n[1] * n[1] ); n[0] /= len; n[1] /= len; double[] n1 = calcIntersection( firstx, firsty, last, n ); maybeLineTo( path, n1[0], n1[1] ); n1 = calcIntersection( firstx, firsty, n, firstNormal ); maybeLineTo( path, n1[0], n1[1] ); path.closePath(); break; case Round: double[] p1 = new double[] { firstx + last[0] * offset, firsty + last[1] * offset }; maybeLineTo( path, p1[0], p1[1] ); double[] p2 = new double[] { firstx + firstNormal[0] * offset, firsty + firstNormal[1] * offset }; double[] midp = new double[] { p1[0] + firstNormal[0] * offset, p1[1] + firstNormal[1] * offset }; path.quadTo( midp[0], midp[1], p2[0], p2[1] ); path.closePath(); break; case Standard: double[] pt = calcIntersection( firstx, firsty, last, firstNormal ); maybeLineTo( path, pt[0], pt[1] ); path.closePath(); break; } }
@Override public void execute(Path2D.Double path, Context ctx){ double x1 = ctx.getValue(arg1); double y1 = ctx.getValue(arg2); double x2 = ctx.getValue(arg3); double y2 = ctx.getValue(arg4); path.quadTo(x1, y1, x2, y2); } }
@Override public void addToPath(java.awt.geom.Path2D.Double path, XDGFShape parent) { if (getDel()) return; double w = parent.getWidth(); double h = parent.getHeight(); path.quadTo(getA() * w, getB() * h, getX() * w, getY() * h); } }
@Override public void addToPath(java.awt.geom.Path2D.Double path, XDGFShape parent) { if (getDel()) return; double w = parent.getWidth(); double h = parent.getHeight(); path.quadTo(getA() * w, getB() * h, getX() * w, getY() * h); } }
@Override public void execute(Path2D.Double path, Context ctx){ double x1 = ctx.getValue(arg1); double y1 = ctx.getValue(arg2); double x2 = ctx.getValue(arg3); double y2 = ctx.getValue(arg4); path.quadTo(x1, y1, x2, y2); } }