Answers inline...

[EMAIL PROTECTED] wrote:
Sorry, fixed now.

And several questions about the code.

1. Save/Restore of transformation in Graphics2D. Is this way:

AffineTransform saved = g2d.getTransform();
...
g2d.setTransform(saved);

efficient???

It works well for 1 or 2 attributes, but if you are going to save more than that then this way is simpler and still fast:

        Graphics2D g2 = g.create();
        g2.set<Attribute[s]>(...);
        g2.drawandfillstuff(...);
        g2.dispose();

Some people may find that model simpler even for one attribute. A lot of work went into making Graphics2D.create() very fast since Swing uses that method a lot.

2. Fill/Draw functions. I often use fill and draw functions for the same path. 
Can this somehow be optimized? In Qt there is only one call to 
QPainter::drawPath and it simultaneously uses current pen for outline and 
current brush for filling.

We don't have any fill and draw convenience functions or separate fill and draw paint attributes. I don't think I've seen any feature requests for these before either.

3. I didn't find Path2D.arcTo and used Path2D.append(new Arc2D.Double(...), 
true). Is this intended way to add arc to path?
[Message sent by forum member 'kamre' (kamre)]

Yes, that is the only way to add an arc to a path currently. There was a suggestion to add that method to GeneralPath (now just a subclass of Path2D), but it never received any votes in the bug parade in over a decade:

        http://bugs.sun.com/bugdatabase/view_bug.do?bug_id=4080460

                        ...jim

===========================================================================
To unsubscribe, send email to [EMAIL PROTECTED] and include in the body
of the message "signoff JAVA2D-INTEREST".  For general help, send email to
[EMAIL PROTECTED] and include in the body of the message "help".

Reply via email to