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



Manuel Hermann <email@hidden> wrote:

>Because Java provides a better and more elegant solution to determine the
>colors of GUI objects.
>
>--- snip ---
>A class to encapsulate symbolic colors representing the color of native GUI
>objects on a system. For systems which support the dynamic update of the
>system colors (when the user changes the colors) the actual RGB values of
>these symbolic colors will also change dynamically.
>--- snip ---

That's the description of SystemColor. Sadly, SystemColor is inadequate.

Specifically, there is no notification or event that any SystemColor has
indeed changed. The result is arguably worse than if SystemColors didn't
change dynamically at all.

Since you don't know when the colors actually change, you don't know when
to repaint anything. Furthermore, you can't tell when you should repaint
only part of a control vs. when you have to repaint all of it.

Imagine that the knob on a JSlider is partially exposed behind an
overlapping window of another app. Say that other app is the control panel
that changes the system colors. So you change from Blue to Graphite...

Does the JSlider know it needs to repaint? No, because nothing told it
there was a system color change. At best, it will repaint in the
now-changed SystemColor the next time it repaints itself.

If the JSlider's window returns to front, does it repaint everything in the
JSlider, or just the re-exposed part? Well, it probably repaints
everything in the JSlider, but that depends on the implementation. A
custom component would only see a paint request with the clipping rect set
to the newly exposed area, since the previously exposed part is apparently
undamaged and unchanged. So a custom component would be partly rendered in
the old Blue color-scheme and partly in the Graphite color-scheme. Yucky,
at best.

If a JComponent that used SystemColor wants to find out about a color
change, can it? Yes, but only by polling for changes in all the
SystemColor RGB-values it happens to use. Hmm, yucky in a different
dimension.

At best, a dynamic SystemColor is only half of what's needed. And in it's
current state, it doesn't seem like that much more elegant a solution to
me. Maybe I'm missing something.

Or maybe system-color change notifications are something that Sun has
provided in 1.5, and I should jump on that rather boisterous bandwagon. Or
even better: Whadda we want? One Point Six! When do we want it? Now!

-- GG
_______________________________________________
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.



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.