Author: jflesch
Date: 2007-07-08 16:16:18 +0000 (Sun, 08 Jul 2007)
New Revision: 13992

Modified:
   trunk/apps/Thaw/src/thaw/core/Core.java
   trunk/apps/Thaw/src/thaw/core/Main.java
   trunk/apps/Thaw/src/thaw/plugins/ThemeSelector.java
Log:
Fix some weirdness in the code related to the look'n'feel management

Modified: trunk/apps/Thaw/src/thaw/core/Core.java
===================================================================
--- trunk/apps/Thaw/src/thaw/core/Core.java     2007-07-08 15:47:50 UTC (rev 
13991)
+++ trunk/apps/Thaw/src/thaw/core/Core.java     2007-07-08 16:16:18 UTC (rev 
13992)
@@ -39,7 +39,7 @@

        private FCPClientHello clientHello = null;

-       private static String lookAndFeel = null;
+       private String lookAndFeel = null;

        public final static int MAX_CONNECT_TRIES = 3;
        public final static int TIME_BETWEEN_EACH_TRY = 5000;
@@ -362,8 +362,8 @@
         * To call before initGraphics() !
         * @param lAndF LookAndFeel name
         */
-       public static void setLookAndFeel(final String lAndF) {
-               Core.lookAndFeel = lAndF;
+       public void setLookAndFeel(final String lAndF) {
+               this.lookAndFeel = lAndF;
        }


@@ -398,10 +398,10 @@
        }


-       public static void setTheme(Core core, String theme) {
+       public void setTheme(String theme) {
                if (theme == null) {
-                       if (core.getConfig() != null)
-                               theme = 
core.getConfig().getValue("lookAndFeel");
+                       if (getConfig() != null)
+                               theme = getConfig().getValue("lookAndFeel");

                        if (theme == null)
                                theme = 
UIManager.getSystemLookAndFeelClassName();
@@ -410,9 +410,9 @@
                if (theme == null)
                        return;

-               Logger.notice(core, "Setting theme : "+ theme);
+               Logger.notice(this, "Setting theme : "+ theme);

-               LnFSetter s = new LnFSetter(core, theme);
+               LnFSetter s = new LnFSetter(this, theme);

                try {
                        javax.swing.SwingUtilities.invokeAndWait(s);
@@ -440,7 +440,7 @@
                JDialog.setDefaultLookAndFeelDecorated(false);

                try {
-                       setTheme(this, Core.lookAndFeel);
+                       setTheme(this.lookAndFeel);

                        if (splashScreen != null)
                                splashScreen.rebuild();

Modified: trunk/apps/Thaw/src/thaw/core/Main.java
===================================================================
--- trunk/apps/Thaw/src/thaw/core/Main.java     2007-07-08 15:47:50 UTC (rev 
13991)
+++ trunk/apps/Thaw/src/thaw/core/Main.java     2007-07-08 16:16:18 UTC (rev 
13992)
@@ -52,7 +52,14 @@
                        I18n.setLocale(new Locale(Main.locale));

                core = new Core();
-               Core.setLookAndFeel(Main.lookAndFeel);
+
+               /* we specify to the core what lnf to use */
+               core.setLookAndFeel(Main.lookAndFeel);
+
+               /* and we force it to refresh change it right now */
+               if (Main.lookAndFeel != null)
+                       core.setTheme(Main.lookAndFeel);
+
                core.initAll();
        }


Modified: trunk/apps/Thaw/src/thaw/plugins/ThemeSelector.java
===================================================================
--- trunk/apps/Thaw/src/thaw/plugins/ThemeSelector.java 2007-07-08 15:47:50 UTC 
(rev 13991)
+++ trunk/apps/Thaw/src/thaw/plugins/ThemeSelector.java 2007-07-08 16:16:18 UTC 
(rev 13992)
@@ -162,7 +162,7 @@
                }

                public void run() {
-                       Core.setTheme(core, theme);
+                       core.setTheme(theme);
                }
        }



Reply via email to