>>>>> "EG" == Eli Gordon <[EMAIL PROTECTED]> writes:
EG> [...] I've run into a problem with GraphicsNode's paint() method
EG> not preserving my Graphic's current Stroke. I've worked around it
EG> by just saving the stroke and re-applying it when the paint()
EG> method is finished, but it seems to me that the GraphicsNode
EG> should handle that internally.
Hmm, do you have any compelling reason that the GraphicsNode
should handle it internally?
I'll admit that the GraphicsNode would be a 'better neighbor' if
it did, but for example currently the 'paint' call in most AWT
components doesn't bother to be this nice.
Also you would end up doing lots of unneeded getting and setting
of stroke/fill/clip/... since the next node simply wants to set it's
own stroke/fill/clip...:
X= getStroke();
setStroke(Y);
// paint
setStroke(X);
X = getStroke();
setStroke(Z);
// paint
setStroke(X);
// ....
I don't have strong feelings about this, but in general if you
pass a mutable object (which a Graphics2D is) into a method I think
it's ok for the method to change the state of the object...
I think your solution is the correct one, if you need to preserve
the state of the object for your case than do so.
Other opinions welcome.
---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]