How can I get the individual values in t, i.e. 383.0? My life would be much easier if I could do that, but I’m missing something even though I scoured the j2d docs.
Hmm, quick techical question for the IA crew. I tried using getTranslateX() from the saved transform, i.e.:
t = g.getTransform()
print t.getTranslateX()
but I get odd results when the paint object refreshes automatically. For instance, when I click on the paint object and trigger my own repaint, the getTranslateX is what I would expect. But if I drag a window over the paint object (which forces it to repaint itself), the getTranslateX() returns wild numbers, although the image paints correctly. So, I went back to using my old method of storing and retrieving the calculated x translation instead, which also works fine.
So, just for my own curiousity, do the internal workings of the paint object handle its own transformation at another level and apply my translation on top of it, which is why the absolute getTranslateX() could have unexpected values? I hope what I just wrote made sense.
I think the answer to your question is: Yes. The graphics object is not always going to be anchored at the same spot, depending on the scope of the current repaint. You are applying a transformation on top of another, which you shouldn’t make any assumptions about.