Hi Tolga,
I'm sure somebody will correct me if I'm wrong,
but I believe that the transformation that you've created
and applied to the graphics context only applies to
operations performed via that context, like drawing.
Mouse input is, technically, not part of Java 2D, but is
instead part of the window managment framework, like AWT
or Swing.
You'll have to take the mouse input you receive and
manually apply any transformations you have to get the
coordinates of mouse operations in your new space.
Yopu might want to put the entire transformation into your
AffineTransform object and then translate user input via
AffineTransform.transform().
Ethan
Tolga Sakman wrote:
>
> Hello all.
>
> I've been trying to transform my x,y axes to the middle of my drawing
> canvas, and make them scientific as to positive x towards EAST, and positive
> y towards NORTH (rather than SOUTH as is in the original user space).
>
> I used the following code, but although the drawings re transformed, somehow
> the mouse events are caught at the old user space. For instance I can select
> a point only by clicking where it would have been if there was no transform.
>
> AffineTransform at = AffineTransform.getTranslateInstance(width,
> height);
> g2.transform(at);
> g2.scale(1,-1);
>
> Any help w/ this is appreciated.
>
> Hope everyone had a happy halloween...
>
> Tolga Sakman
>
> ===========================================================================
> 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".
--
Ethan Henry [EMAIL PROTECTED]
Java Evangelist, KL Group http://www.klg.com
"Software Development Productivity"
===========================================================================
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".