Skip to main content

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index] [List Home]
[udig-devel] drawPath method in AWTGraphics

Hi, in AWTGraphics the method drawPath is not supported.
I added and tested it. Since it is a mini-change, would it be possible
to add it to the current rc?

I would also like to know if anyone knows a better way to handle this,
I couldn't think of a better one. The points have to get out of the
SWT Path and into the AWT Path, so... advices welcome:

 public void drawPath(Path path) {
        PathData pathData = path.getPathData();
        float[] points = pathData.points;
        GeneralPath p = new GeneralPath();
        p.moveTo(points[0], points[1]);
        for (int i = 2; i < points.length; i = i + 2) {
            p.lineTo(points[i], points[i + 1]);
        }
        g.draw(p);
    }


Ciao
Andrea


Back to the top