/** * Delegates to the enclosed <code>GeneralPath</code>. */ public void quadTo(double x1, double y1, double x2, double y2) { checkMoveTo(); // check if prev command was moveto path.quadTo(x1, y1, x2, y2); makeRoom(4); types[numSeg++] = PathIterator.SEG_QUADTO; values[numVals++] = x1; values[numVals++] = y1; cx = values[numVals++] = x2; cy = values[numVals++] = y2; }
private GeneralPath makeDocumentPath(Diagram diagram) { if(points.size() != 4) return null; Rectangle bounds = makeIntoPath().getBounds(); ShapePoint point1 = new ShapePoint((float)bounds.getMinX(), (float)bounds.getMinY()); ShapePoint point2 = new ShapePoint((float)bounds.getMaxX(), (float)bounds.getMinY()); ShapePoint point3 = new ShapePoint((float)bounds.getMaxX(), (float)bounds.getMaxY()); ShapePoint point4 = new ShapePoint((float)bounds.getMinX(), (float)bounds.getMaxY()); ShapePoint pointMid = new ShapePoint((float)bounds.getCenterX(), (float)bounds.getMaxY()); GeneralPath path = new GeneralPath(); path.moveTo(point1.x, point1.y); path.lineTo(point2.x, point2.y); path.lineTo(point3.x, point3.y); //int controlDX = diagram.getCellWidth(); //int controlDY = diagram.getCellHeight() / 2; int controlDX = bounds.width / 6; int controlDY = bounds.height / 8; path.quadTo(pointMid.x + controlDX, pointMid.y - controlDY, pointMid.x, pointMid.y); path.quadTo(pointMid.x - controlDX, pointMid.y + controlDY, point4.x, point4.y); path.closePath(); return path; }
private void quadTo(GeneralPath path, Point ctrlPoint, Point point) { path.quadTo(ctrlPoint.x, ctrlPoint.y, point.x, point.y); if (LOG.isDebugEnabled()) { LOG.trace("quadTo: " + String.format(Locale.US, "%d,%d %d,%d", ctrlPoint.x, ctrlPoint.y, point.x, point.y)); } }
GeneralPath bodyPath = new GeneralPath(); bodyPath.moveTo(p2x + (ey - ex) * adjSize, p2y - (ex + ey) * adjSize); bodyPath.quadTo(cx, cy, p1x, p1y - bodyWidth / 2); bodyPath.lineTo(p1x, p1y + bodyWidth / 2); bodyPath.quadTo(cx, cy, p2x - (ey + ex) * adjSize, p2y + (ex - ey) * adjSize); bodyPath.closePath();
if (ctrlPoint != null) { assert ctrl == ctrlPoint; path.quadTo(ctrl.x, ctrl.y, (float) px, (float) py); } else { path.lineTo((float) px, (float) py);
/** * */ public void quadTo(double x1, double y1, double x2, double y2) { if (currentPath != null) { currentPath.quadTo((float) ((state.dx + x1) * state.scale), (float) ((state.dy + y1) * state.scale), (float) ((state.dx + x2) * state.scale), (float) ((state.dy + y2) * state.scale)); } }
@Override public void quadTo( final double x1, final double y1, final double x, final double y ) { path.quadTo( x1, y1, x, y ); }
/** * */ public void quadTo(double x1, double y1, double x2, double y2) { if (currentPath != null) { currentPath.quadTo((float) ((state.dx + x1) * state.scale), (float) ((state.dy + y1) * state.scale), (float) ((state.dx + x2) * state.scale), (float) ((state.dy + y2) * state.scale)); } }
@Override public void quadTo(float cx, float cy, float x, float y) { p.quadTo(cx, cy, x, y); if(debug) System.out.println("quadTo( "+cx+", "+cy+", "+x+", "+y+")"); lastX = x; lastY = y; dataWritten = true; }
private void quadTo(GeneralPath path, Point ctrlPoint, Point point) { path.quadTo(ctrlPoint.x, ctrlPoint.y, point.x, point.y); if (LOG.isDebugEnabled()) { LOG.trace("quadTo: " + String.format(Locale.US, "%d,%d %d,%d", ctrlPoint.x, ctrlPoint.y, point.x, point.y)); } }
private void quadTo(GeneralPath path, Point ctrlPoint, Point point) { path.quadTo(ctrlPoint.x, ctrlPoint.y, point.x, point.y); if (LOG.isDebugEnabled()) { LOG.trace("quadTo: " + String.format(Locale.US, "%d,%d %d,%d", ctrlPoint.x, ctrlPoint.y, point.x, point.y)); } }
public void appendPath(GeneralPath path, BuildHistory hist) { float offx = isRelative ? hist.history[0].x : 0f; float offy = isRelative ? hist.history[0].y : 0f; path.quadTo(kx + offx, ky + offy, x + offx, y + offy); hist.setPointAndKnot(x + offx, y + offy, kx + offx, ky + offy); }
@Override public void appendPath(GeneralPath path, BuildHistory hist) { float offx = isRelative ? hist.lastPoint.x : 0f; float offy = isRelative ? hist.lastPoint.y : 0f; path.quadTo(kx + offx, ky + offy, x + offx, y + offy); hist.setLastPoint(x + offx, y + offy); hist.setLastKnot(kx + offx, ky + offy); }
public void appendPath(GeneralPath path, BuildHistory hist) { float offx = isRelative ? hist.lastPoint.x : 0f; float offy = isRelative ? hist.lastPoint.y : 0f; path.quadTo(kx + offx, ky + offy, x + offx, y + offy); hist.setLastPoint(x + offx, y + offy); hist.setLastKnot(kx + offx, ky + offy); }
@Override public void appendPath(GeneralPath path, BuildHistory hist) { float offx = isRelative ? hist.lastPoint.x : 0f; float offy = isRelative ? hist.lastPoint.y : 0f; path.quadTo(kx + offx, ky + offy, x + offx, y + offy); hist.setLastPoint(x + offx, y + offy); hist.setLastKnot(kx + offx, ky + offy); }
public void execute(GeneralPath 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((float)x1, (float)y1, (float)x2, (float)y2); } }