p = new Path(false, true); Path2D.Double arrow = new Path2D.Double(); arrow.moveTo((-lineWidth * scaleX), (-lineWidth * scaleY / 2)); arrow.lineTo(0, 0); arrow.lineTo((-lineWidth * scaleX), (lineWidth * scaleY / 2)); p = new Path(); Path2D.Double triangle = new Path2D.Double(); triangle.moveTo((-lineWidth * scaleX), (-lineWidth * scaleY / 2)); triangle.lineTo(0, 0); triangle.lineTo((-lineWidth * scaleX), (lineWidth * scaleY / 2));
p = new Path(false, true); Path2D.Double arrow = new Path2D.Double(); arrow.moveTo((lineWidth * scaleX), (-lineWidth * scaleY / 2)); arrow.lineTo(0, 0); arrow.lineTo((lineWidth * scaleX), (lineWidth * scaleY / 2)); p = new Path(); Path2D.Double triangle = new Path2D.Double(); triangle.moveTo((lineWidth * scaleX), (-lineWidth * scaleY / 2)); triangle.lineTo(0, 0); triangle.lineTo((lineWidth * scaleX), (lineWidth * scaleY / 2));
final double coord[] = seg.getCoord(); if (type == USegmentType.SEG_MOVETO) { p.moveTo(x + coord[0], y + coord[1]); minMax.manage(x + coord[0], y + coord[1]); } else if (type == USegmentType.SEG_LINETO) {
outlinePath.moveTo(startx + lineOffset, starty + lineOffset); outlinePath.lineTo(startx + lineOffset, starty + BOX_SIZE - lineOffset); outlinePath.lineTo(startx + BOX_SIZE - lineOffset, starty + BOX_SIZE - lineOffset);
curve.moveTo(0, 0); curve.lineTo(0, bot_ey); curve.append(arc, true);
int type = pathIterator.currentSegment(coords); if (type == 0) { tmp.moveTo(coords[0], coords[1]); } else if (type == 4) { tmp.closePath();
private void drawStepBar( Graphics2D g, S series, ArrayList<Point2D.Double> path, ArrayList<Point2D.Double> returnPath) { Collections.reverse(returnPath); // The last point will be a duplicate of the first. // Pop it before adding all to the main path returnPath.remove(returnPath.size() - 1); path.addAll(returnPath); Path2D.Double drawPath = new Path2D.Double(); // Start draw path from first point, which can then be discarded Point2D.Double startPoint = path.remove(0); drawPath.moveTo(startPoint.getX(), startPoint.getY()); // Prepare complete fill path for (Point2D.Double currentPoint : path) { drawPath.lineTo(currentPoint.getX(), currentPoint.getY()); } drawStepBarFill(g, series, drawPath); // Remove the bottom portion and draw only the upper outline drawPath.reset(); drawPath.moveTo(startPoint.getX(), startPoint.getY()); List<Point2D.Double> linePath = path.subList(0, path.size() - returnPath.size() + 1); for (Point2D.Double currentPoint : linePath) { drawPath.lineTo(currentPoint.getX(), currentPoint.getY()); } drawStepBarLine(g, series, drawPath); }
@Override public void paint(Graphics2D g, double xOffset, double yOffset, int markerSize) { g.setStroke(stroke); // Make a diamond double diamondHalfSize = (double) markerSize / 2 * 1.3; Path2D.Double path = new Path2D.Double(); path.moveTo(xOffset - diamondHalfSize, yOffset); path.lineTo(xOffset, yOffset - diamondHalfSize); path.lineTo(xOffset + diamondHalfSize, yOffset); path.lineTo(xOffset, yOffset + diamondHalfSize); path.closePath(); g.fill(path); } }
@Override public void paint(Graphics2D g, double xOffset, double yOffset, int markerSize) { g.setStroke(stroke); // Make a cross double halfSize = (double) markerSize / 2; Path2D.Double path = new Path2D.Double(); path.moveTo(xOffset - halfSize, yOffset - halfSize); path.lineTo(xOffset + halfSize, yOffset + halfSize); path.moveTo(xOffset - halfSize, yOffset + halfSize); path.lineTo(xOffset + halfSize, yOffset - halfSize); g.draw(path); } }
@Override public void paint(Graphics2D g, double xOffset, double yOffset, int markerSize) { g.setStroke(stroke); double halfSize = (double) markerSize / 2; // Make a triangle Path2D.Double path = new Path2D.Double(); path.moveTo(xOffset - halfSize, yOffset - halfSize + markerSize - 1); path.lineTo(xOffset - halfSize + markerSize, yOffset - halfSize + markerSize - 1); path.lineTo(xOffset, yOffset - halfSize - 1); path.closePath(); g.fill(path); } }
@Override public void paint(Graphics2D g, double xOffset, double yOffset, int markerSize) { g.setStroke(stroke); double halfSize = (double) markerSize / 2; // Make a triangle Path2D.Double path = new Path2D.Double(); path.moveTo(xOffset - halfSize, 1 + yOffset - halfSize); path.lineTo(xOffset, 1 + yOffset - halfSize + markerSize); path.lineTo(xOffset - halfSize + markerSize, 1 + yOffset - halfSize); path.closePath(); g.fill(path); } }
@Override public void paint(Graphics2D g, double xOffset, double yOffset, int markerSize) { g.setStroke(stroke); // Make a cross double halfSize = (double) markerSize / 2; Path2D.Double path = new Path2D.Double(); path.moveTo(xOffset + halfSize, yOffset); path.lineTo(xOffset - halfSize, yOffset); path.moveTo(xOffset, yOffset + halfSize); path.lineTo(xOffset, yOffset - halfSize); g.draw(path); } }
rhombus.moveTo(graphicInfo.getX(), graphicInfo.getY() + graphicInfo.getHeight() / 2); rhombus.lineTo(graphicInfo.getX() + graphicInfo.getWidth() / 2,
/** * @return returns bounds as a path in local coordinates, which is * userful if you need to transform to global coordinates * * Warning: Don't use this for 1d objects, and will fail for * infinite line objects */ public Path2D.Double getBoundsAsPath() { Double w = getWidth(); Double h = getHeight(); Path2D.Double bounds = new Path2D.Double(); bounds.moveTo(0, 0); bounds.lineTo(w, 0); bounds.lineTo(w, h); bounds.lineTo(0, h); bounds.lineTo(0, 0); return bounds; }
/** * @return Text bounds as a path in local coordinates, which is useful * if you need to transform to global coordinates */ public Path2D.Double getBoundsAsPath() { Rectangle2D.Double rect = getTextBounds(); double w = rect.getWidth(); double h = rect.getHeight(); Path2D.Double bounds = new Path2D.Double(); bounds.moveTo(0, 0); bounds.lineTo(w, 0); bounds.lineTo(w, h); bounds.lineTo(0, h); bounds.lineTo(0, 0); return bounds; }
@Override public void addToPath(java.awt.geom.Path2D.Double path, XDGFShape parent) { if (getDel()) return; path.moveTo(getX(), getY()); } }
@Override public void addToPath(java.awt.geom.Path2D.Double path, XDGFShape parent) { if (getDel()) return; path.moveTo(getX() * parent.getWidth(), getY() * parent.getHeight()); } }
@Override public void execute(Path2D.Double path, Context ctx){ double x = ctx.getValue(arg1); double y = ctx.getValue(arg2); path.moveTo(x, y); } }