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: Determine appearance settings



I would find it extremely useful if it were possible to fetch some basic
colors/gradients from UIManager. Anyone writing their own UI delegates
who wants them to be Aqua friendly has to either hard-code colors, or
do the trick of painting a component into an offscreen buffer and diving
for pixels, which is most definitely a hack, and not necessarily a reliable
one (component metrics can change between systems and releases, so
the pixel location you choose now may not have the right color later).

It would make it much easier to create natural looking component UIs
for Aqua if one could do, e.g.

Paint p = (Paint) UIManager.get("ButtonGradient.enabled");

or even simply fetch the colors needed to compose the gradients.

While the Aqua UI's button painting may be native, this can be done with
no measurable startup overhead for the L&F, only initializing the value
if it is ever asked for.

-Tim

On Feb 6, 2004, at 9:26 AM, Manuel Hermann wrote:

You could render a JComponent that has color in an offscreen BufferedImage,
then examine the resulting pixels for hue. You'll want to use something
like the knob of a JSlider that's easy to grab pixels from, and whose color
definitely tracks the system state.

That9s exactly the idea I had already, but of course that's not what I call
"easy". :)

Thanks for your suggestions.

Manuel
_______________________________________________
java-dev mailing list | email@hidden
Help/Unsubscribe/Archives: http://www.lists.apple.com/mailman/listinfo/java-dev
Be sure to read the FAQ http://developer.apple.com/java/faq/ before posting
Do not post admin requests to the list. They will be ignored.
_______________________________________________
java-dev mailing list | email@hidden
Help/Unsubscribe/Archives: http://www.lists.apple.com/mailman/listinfo/java-dev
Be sure to read the FAQ http://developer.apple.com/java/faq/ before posting
Do not post admin requests to the list. They will be ignored.

References: 
 >Re: Determine appearance settings (From: Manuel Hermann <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.