Re: [skinlf-dev] Follow-up on laf-plugin proposal

Kirill Grouchnikov <[email protected]> Fri, 17 Feb 2006 11:19:18 -0800 (PST)
Newsgroups gmane.comp.java.skinlf.devel
Message-ID <[email protected]>
--0-194135455-1140203958=:23894
Content-Type: text/plain; charset=iso-8859-1
Content-Transfer-Encoding: 8bit

Fred,

1. The initialize and reset functionality is somewhat different. Reset() should be used by the plugin in order to clear all its caches. In Substance, I call it on theme switch. Initialize() is called in the LAF.initialize().

2. I have one static PluginManager for the component plugins. This allows using it in both instance functions and in static functions exposed by your main LAF class.

3. The main difference between getDefaults() and other get functions (fonts / uiDelegates) is that the getDefaults() result will most probably depend on the currently set theme, whereas the getFonts and getUIDelegates will stay the same. That's why only getDefaults has this parameter. That's also why there's a separation. In Substance, getFonts() is called in initComponentDefaults() and getUIDelegates is called in initClassDefaults(). The getDefaults() is called in the constructor of the new theme on theme change - in its addCustomEntriesToTable() function.

4. The functions that you have proposed will be added shortly to the laf-plugin project.

Thanks
Kirill


Fr�d�ric Lavigne <[email protected]> wrote: Hi Kirill,

I worked on it but did not commit the code yet. I copied the code  
from the LiquidLnf.

I have the following questions though regarding the integration:

* about initialize() and reset(), should I call both of them in  
LookAndFeel#initialize or only the first?

* what is the recommended approach? one static PluginManager (as done  
in LiquidLnf) or one PluginManager instance as member of the  
LookAndFeel subclass?

* why separate getFonts() and getDefaults() methods?

* plugin.getDefaults takes as parameter a themeInfo so the plugin  
developer can specify different "defaults" based on the current  
theme. Why getFonts and even getUIDelegates do not follow the same  
scheme?

* I had to copy a bunch of code from the LiquidLnf and did not have  
to make any changes to the copied code. Maybe the PluginManager could  
provide more helper methods like "initializeAvailablePlugins()",  
"resetAvailablePlugins()", "populateDefaultsFromPlugins(UIDefaults  
defaults)"... I mean all kinds of methods which would make the  
integration even easier. With this method I would just declare a  
PluginManager then call one of its method in my LookAndFeel  
initialize, initComponentDefaults, initClassDefaults, ... I checked  
the SquarenessLookAndFeel and it also duplicates this code.

regards,
-fred

On Feb 16, 2006, at 10:29 PM, Kirill Grouchnikov wrote:

> Frederic,
>
> We have spoken about two months ago on possible adoption of laf- 
> plugin [1] in this project. Has this ever come to the list of  
> things to-do or should i drop this subject entirely?
>
> Thanks
> Kirill
>
> [1] https://laf-plugin.dev.java.net
>
>
> What are the most popular cars? Find out at Yahoo! Autos


---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]



__________________________________________________
Do You Yahoo!?
Tired of spam?  Yahoo! Mail has the best spam protection around 
http://mail.yahoo.com 
--0-194135455-1140203958=:23894
Content-Type: text/html; charset=iso-8859-1
Content-Transfer-Encoding: 8bit

Fred,<br><br>1. The initialize and reset functionality is somewhat different. Reset() should be used by the plugin in order to clear all its caches. In Substance, I call it on theme switch. Initialize() is called in the LAF.initialize().<br><br>2. I have one static PluginManager for the component plugins. This allows using it in both instance functions and in static functions exposed by your main LAF class.<br><br>3. The main difference between getDefaults() and other get functions (fonts / uiDelegates) is that the getDefaults() result will most probably depend on the currently set theme, whereas the getFonts and getUIDelegates will stay the same. That's why only getDefaults has this parameter. That's also why there's a separation. In Substance, getFonts() is called in initComponentDefaults() and getUIDelegates is called in initClassDefaults(). The getDefaults() is called in the construc
 tor of the new theme on theme change - in its addCustomEntriesToTable() function.<br><br>4. The
 functions that you have proposed will be added shortly to the laf-plugin project.<br><br>Thanks<br>Kirill<br><br><br><b><i>Fr�d�ric Lavigne &lt;[email protected]&gt;</i></b> wrote:<blockquote class="replbq" style="border-left: 2px solid rgb(16, 16, 255); margin-left: 5px; padding-left: 5px;"> Hi Kirill,<br><br>I worked on it but did not commit the code yet. I copied the code  <br>from the LiquidLnf.<br><br>I have the following questions though regarding the integration:<br><br>* about initialize() and reset(), should I call both of them in  <br>LookAndFeel#initialize or only the first?<br><br>* what is the recommended approach? one static PluginManager (as done  <br>in LiquidLnf) or one PluginManager instance as member of the  <br>LookAndFeel subclass?<br><br>* why separate getFonts() and getDefaults() methods?<br><br>* plugin.getDefaults takes as parameter a themeInfo so the plugin 
  <br>developer can specify different "defaults" based on the current  <br>theme. Why getFonts and
 even getUIDelegates do not follow the same  <br>scheme?<br><br>* I had to copy a bunch of code from the LiquidLnf and did not have  <br>to make any changes to the copied code. Maybe the PluginManager could  <br>provide more helper methods like "initializeAvailablePlugins()",  <br>"resetAvailablePlugins()", "populateDefaultsFromPlugins(UIDefaults  <br>defaults)"... I mean all kinds of methods which would make the  <br>integration even easier. With this method I would just declare a  <br>PluginManager then call one of its method in my LookAndFeel  <br>initialize, initComponentDefaults, initClassDefaults, ... I checked  <br>the SquarenessLookAndFeel and it also duplicates this code.<br><br>regards,<br>-fred<br><br>On Feb 16, 2006, at 10:29 PM, Kirill Grouchnikov wrote:<br><br>&gt; Frederic,<br>&gt;<br>&gt; We have spoken about two months ago on possible adoption of laf- <br>&gt; plugin [1]
  in this project. Has this ever come to the list of  <br>&gt; things to-do or should i drop this
 subject entirely?<br>&gt;<br>&gt; Thanks<br>&gt; Kirill<br>&gt;<br>&gt; [1] https://laf-plugin.dev.java.net<br>&gt;<br>&gt;<br>&gt; What are the most popular cars? Find out at Yahoo! Autos<br><br><br>---------------------------------------------------------------------<br>To unsubscribe, e-mail: [email protected]<br>For additional commands, e-mail: [email protected]<br><br></blockquote><br><p>__________________________________________________<br>Do You Yahoo!?<br>Tired of spam?  Yahoo! Mail has the best spam protection around <br>http://mail.yahoo.com 
--0-194135455-1140203958=:23894--