pivot-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Greg Brown <gkbr...@mac.com>
Subject Theme provider change
Date Fri, 03 Apr 2009 19:24:53 GMT
Hi all,

I just submitted a change that locates and loads themes dynamically using the provider system
we just built for charts. The code that loads a service provider has been refactored into
a new pivot.util.Service class. This class has a single method, getProvider(), that locates
and loads a provider class for a given service name. Both charts and themes now use this.

As a result, themes can now be swapped in and out with no configuration changes. However,
since themes are now loaded dynamically, the default constructor, and therefore the default
color scheme, is used. To change the color scheme, you can now do this:

    TerraTheme terraTheme = (TerraTheme)Theme.getTheme();
    URL schemeLocation = TerraTheme.class.getResource("TerraTheme_default.json");

Be sure to do this before instantiating any components, though, or you'll get the wrong colors.

This change should make themes a little bit easier to use. Please let me know if you have
any questions or comments.


View raw message