Mailing Lists: Apple Mailing Lists

Image of Mac OS face in stamp
 
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: AWT Frame with constant height-width ratio



Nicholas R. Rinard wrote:

I just programmed an awt Frame which resizes itself to conform to a certain aspect ratio. It is a media popup window which displays either an image or a movie. I wanted a frame which would constrain it's dimensions to the original ratio. [...]

If there is a prescribed way to do this, I'd be keen to know.

It occurs to me that, if it were possible to "intercept" the mouse event on its way *to* the AWT resize listener, then you could change the mouse X,Y coordinates reported by the mouse event to a position that "fits in" with your preferred aspect ratio. You could let the AWT resize logic go ahead and redraw the changing window (which would draw to the size you'd like to see it). The user would notice that the motion is coordinated with, but not the same as, the real mouse motion - but I guess that that is the effect you're after... You would have to know that this mouse event is part of a window resize, I guess - and I don't know how to do that...


Maybe redefining processMouseEvent() (or something like that)?

Moises

_______________________________________________
Do not post admin requests to the list. They will be ignored.
Java-dev mailing list      (email@hidden)
Help/Unsubscribe/Update your Subscription:
http://lists.apple.com/mailman/options/java-dev/email@hidden

This email sent to email@hidden
References: 
 >AWT Frame with constant height-width ratio (From: "Nicholas R. Rinard" <email@hidden>)



Visit the Apple Store online or at retail locations.
1-800-MY-APPLE

Contact Apple | Terms of Use | Privacy Policy

Copyright © 2007 Apple Inc. All rights reserved.