Dear list,

I've finally gotten around to overhauling all of my 1.1 graphics to take
advantage of 2D, but I'm finding that the elegant and/or obvious routes
blocked.

Java2D is missing a lot of the Postscript features that I use to build my
models, and, for instance, I would add context stacks to Graphics2D to
implement 'gsave,' grestore,' etc.  Similarly, GeneralPath doesn't have a
moveRel or a lineRel, or, amazingly, building methods with 'double'
parameters.

To get work done, I've written wrapper (has-a) classes for Graphics2D and
GeneralPath, adding new functionality and using the old classes for old
functionality.  Not only are these classes ugly, kludgey, and possibly slow,
I find that the blight spreads to other classes, and right now, I struggling
to avoid wrapping PathIterator.

If a developer can extend Graphics2D, I don't know how to do it.  The
'obvious' way doesn't work, of course.  The compiler is happy with a new
"is-a" abstract class and a cast that tries to fashion a new Graphics*
object out of a Graphics2D, but the run-time won't buy it.

Any hints?  Any alternative to the wrapper?

Same with GeneralPath.  I'm certain that the designers struggled with each
of these design decisions, but they must have known the grief and gnashing
of teeth they caused by making GeneralPath final.  I hope that they realized
some great advantage by doing that.

Any hints?  Any alternative to a wrapper.  Get smart enough to write my own
from scratch?

TIA,

Fred Klingener
Brock Engineering

===========================================================================
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