@Override protected void drawStroke(Graphics2D g) { for (final BezierFigure figure : figures) { g.draw(figure.getBezierPath()); } }
@Override protected void drawStroke(Graphics2D g) { for (final BezierFigure figure : figures) { g.draw(figure.getBezierPath()); } }
@Override public Shape toShape(final BezierFigure figure) { return figure.getBezierPath().toGeneralPath(); }
public synchronized GeneralPath getGeneralPath() { if (path == null) { path = new GeneralPath(Path2D.WIND_EVEN_ODD); for (final BezierFigure figure : figures) { path.append(figure.getBezierPath(), false); } } return path; }
/** * Gets the segment of the polyline that is hit by * the given Point2D.Double. * * @param find a Point on the bezier path * @param tolerance a tolerance, tolerance should take into account * the line width, plus 2 divided by the zoom factor. * @return the index of the segment or -1 if no segment was hit. */ public int findSegment(Point2D.Double find, double tolerance) { return getBezierPath().findSegment(find, tolerance); }
public synchronized GeneralPath getGeneralPath() { if (path == null) { path = new GeneralPath(Path2D.WIND_EVEN_ODD); for (final BezierFigure figure : figures) { path.append(figure.getBezierPath(), false); } } return path; }
@Override public Shape toShape(final BezierFigure figure) { return figure.getBezierPath().toGeneralPath(); }
@Override public void transform(AffineTransform tx) { for (final BezierFigure figure : figures) { figure.getBezierPath().transform(tx); } invalidate(); }
@Override public void transform(AffineTransform tx) { for (final BezierFigure figure : figures) { figure.getBezierPath().transform(tx); } invalidate(); }
protected void writePolygonElement(IXMLElement parent, SVGPathFigure f) throws IOException { LinkedList<Point2D.Double> points = new LinkedList<Point2D.Double>(); for (int i = 0, n = f.getChildCount(); i < n; i++) { BezierPath bezier = ((BezierFigure) f.getChild(i)).getBezierPath(); for (BezierPath.Node node : bezier) { points.add(new Point2D.Double(node.x[0], node.y[0])); } } parent.addChild(createPolygon( document, points.toArray(new Point2D.Double[points.size()]), f.getAttributes())); }
protected void writePolylineElement(IXMLElement parent, SVGPathFigure f) throws IOException { LinkedList<Point2D.Double> points = new LinkedList<Point2D.Double>(); for (int i = 0, n = f.getChildCount(); i < n; i++) { BezierPath bezier = ((BezierFigure) f.getChild(i)).getBezierPath(); for (BezierPath.Node node : bezier) { points.add(new Point2D.Double(node.x[0], node.y[0])); } } parent.addChild(createPolyline( document, points.toArray(new Point2D.Double[points.size()]), f.getAttributes())); }
protected void writePathElement(IXMLElement parent, SVGPathFigure f) throws IOException { BezierPath[] beziers = new BezierPath[f.getChildCount()]; for (int i = 0; i < beziers.length; i++) { beziers[i] = ((BezierFigure) f.getChild(i)).getBezierPath(); } parent.addChild(createPath( document, beziers, f.getAttributes())); }
if (createdFigure.getNodeCount() > nodeCountBeforeDrag + 1) { createdFigure.willChange(); BezierPath figurePath = createdFigure.getBezierPath(); BezierPath digitizedPath = new BezierPath(); for (int i = nodeCountBeforeDrag - 1, n = figurePath.size(); i < n; i++) {
@Override public void draw(Graphics2D g) { BezierFigure owner = getOwner(); Shape bounds = owner.getBezierPath(); if (owner.get(TRANSFORM) != null) { bounds = owner.get(TRANSFORM).createTransformedShape(bounds);