Author: remi
Date: 2008-09-19 10:41:48 +0200 (Fri, 19 Sep 2008)
New Revision: 1911

Modified:
   software_suite_v2/software/tools/attitunesStudio/trunk/src/MainFrame.java
   
software_suite_v2/software/tools/attitunesStudio/trunk/src/com/tuxisalive/attitunes/ATTConfig.java
   
software_suite_v2/software/tools/attitunesStudio/trunk/src/com/tuxisalive/attitunes/format/ATTFormatMisc.java
   
software_suite_v2/software/tools/attitunesStudio/trunk/src/com/tuxisalive/attitunes/format/ATTFormatReadWrite.java
   software_suite_v2/software/tools/attitunesStudio/trunk/src/main.java
Log:
* fixed font problems on linux
* fixed frame bugs on linux (openJDK : crazy resizing)
* fixed paths on linux (slash inversions)
* added some constants

Modified: 
software_suite_v2/software/tools/attitunesStudio/trunk/src/MainFrame.java
===================================================================
--- software_suite_v2/software/tools/attitunesStudio/trunk/src/MainFrame.java   
2008-09-18 16:09:39 UTC (rev 1910)
+++ software_suite_v2/software/tools/attitunesStudio/trunk/src/MainFrame.java   
2008-09-19 08:41:48 UTC (rev 1911)
@@ -104,10 +104,18 @@
                initGUI();
                this.setSize(WINDOW_WIDTH, WINDOW_HEIGHT_WBP);
                this.setResizable(false);
-               this.pack();
+               //this.pack();
                TuxAPIMisc.sleep(0.15);
                this.setVisible(true);
-               attBlockViewer.loadAttitune(ATTConfig.ATT_TEMPLATE_PATH); 
//$NON-NLS-1$
+               
+               if (System.getProperty("os.name").contains("Windows"))
+               {
+                       
attBlockViewer.loadAttitune(ATTConfig.ATT_TEMPLATE_PATH_WIN); //$NON-NLS-1$
+               }
+               else
+               {
+                       
attBlockViewer.loadAttitune(ATTConfig.ATT_TEMPLATE_PATH_LINUX); //$NON-NLS-1$
+               }
                attBlockViewer.setAttituneIsTemplate(true);
        }
        
@@ -502,8 +510,19 @@
                        }
                }
                /* Load the template */
-               if (attBlockViewer.loadAttitune(ATTConfig.ATT_TEMPLATE_PATH)) 
//$NON-NLS-1$
+               String attituneTemplatePath;
+               
+               if (System.getProperty("os.name").contains("Windows"))
                {
+                       attituneTemplatePath = ATTConfig.ATT_TEMPLATE_PATH_WIN;
+               }
+               else
+               {
+                       attituneTemplatePath = 
ATTConfig.ATT_TEMPLATE_PATH_LINUX;
+               }
+               
+               if (attBlockViewer.loadAttitune(attituneTemplatePath))
+               {
                        attBlockViewer.setAttituneIsTemplate(true);
                }       
        }
@@ -736,19 +755,13 @@
        {       
                if (jPanelBlProperties.isVisible())
                {
-                       this.setVisible(false);
+                       jPanelBlProperties.setVisible(false);
                        this.setSize(WINDOW_WIDTH, WINDOW_HEIGHT_WBP);
-                       jPanelBlProperties.setVisible(false);
-                       this.pack();
-                       this.setVisible(true);
                }
                else
                {
-                       this.setVisible(false);
                        this.setSize(WINDOW_WIDTH, WINDOW_HEIGHT_BP);
                        jPanelBlProperties.setVisible(true);
-                       this.pack();
-                       this.setVisible(true);
                }
        }
        
@@ -774,7 +787,6 @@
                jPanelBlocConf.removeAll();
                AttituneCmdConf.showBlockConf(attBlockViewer, jPanelBlocConf, 
cmd);
                jPanelBlocConf.setVisible(true);
-               this.pack();
        }
        
        /*
@@ -937,7 +949,6 @@
                {
                        this.setSize(WINDOW_WIDTH, WINDOW_HEIGHT_BP);
                        jPanelBlProperties.setVisible(true);
-                       this.pack();
                }
        }
        

Modified: 
software_suite_v2/software/tools/attitunesStudio/trunk/src/com/tuxisalive/attitunes/ATTConfig.java
===================================================================
--- 
software_suite_v2/software/tools/attitunesStudio/trunk/src/com/tuxisalive/attitunes/ATTConfig.java
  2008-09-18 16:09:39 UTC (rev 1910)
+++ 
software_suite_v2/software/tools/attitunesStudio/trunk/src/com/tuxisalive/attitunes/ATTConfig.java
  2008-09-19 08:41:48 UTC (rev 1911)
@@ -121,5 +121,12 @@
                EVENT_ATTITUNE_SAVED,
        };
        
-       public static String ATT_TEMPLATE_PATH                          = 
"C:/tuxdroid/resources/templates/template.att";
+       public static String THEMEPACK_PATH_WIN          = 
"C:/tuxdroid/resources/skin/tuxthemepack.zip";
+       public static String THEMEPACK_PATH_LINUX        = "./tuxthemepack.zip";
+       
+       public static String ATT_TEMPLATE_PATH_WIN       = 
"C:/tuxdroid/resources/templates/template.att";
+       public static String ATT_TEMPLATE_PATH_LINUX = "./template.att";
+       
+       public static String GLOBAL_FONT_WIN             = "Verdana";
+       public static String GLOBAL_FONT_LINUX           = "Bitstream Vera 
Sans";       
 }
\ No newline at end of file

Modified: 
software_suite_v2/software/tools/attitunesStudio/trunk/src/com/tuxisalive/attitunes/format/ATTFormatMisc.java
===================================================================
--- 
software_suite_v2/software/tools/attitunesStudio/trunk/src/com/tuxisalive/attitunes/format/ATTFormatMisc.java
       2008-09-18 16:09:39 UTC (rev 1910)
+++ 
software_suite_v2/software/tools/attitunesStudio/trunk/src/com/tuxisalive/attitunes/format/ATTFormatMisc.java
       2008-09-19 08:41:48 UTC (rev 1911)
@@ -31,22 +31,9 @@
 
 public class ATTFormatMisc
 {
-       private static String goodSepSlash = "";
-       private static String badSepSlash = "";
-       static {
-               if (File.separator == "/")
-               {
-                       goodSepSlash = "/";
-                       badSepSlash = "\\";
-               }
-               else
-               {
-                       goodSepSlash = "\\";
-                       badSepSlash = "/";
-               }
-       }
-       
-       
+       private static String goodSepSlash = "/";
+       private static String badSepSlash = "\\";
+
        /**
         * 
         */

Modified: 
software_suite_v2/software/tools/attitunesStudio/trunk/src/com/tuxisalive/attitunes/format/ATTFormatReadWrite.java
===================================================================
--- 
software_suite_v2/software/tools/attitunesStudio/trunk/src/com/tuxisalive/attitunes/format/ATTFormatReadWrite.java
  2008-09-18 16:09:39 UTC (rev 1910)
+++ 
software_suite_v2/software/tools/attitunesStudio/trunk/src/com/tuxisalive/attitunes/format/ATTFormatReadWrite.java
  2008-09-19 08:41:48 UTC (rev 1911)
@@ -74,6 +74,8 @@
                
                File attFile = new File(attFilePath);
                
+               System.out.println(attFilePath);
+               
                /* Check if the temp dir exists */
                if (!tmpDirFound)
                {

Modified: software_suite_v2/software/tools/attitunesStudio/trunk/src/main.java
===================================================================
--- software_suite_v2/software/tools/attitunesStudio/trunk/src/main.java        
2008-09-18 16:09:39 UTC (rev 1910)
+++ software_suite_v2/software/tools/attitunesStudio/trunk/src/main.java        
2008-09-19 08:41:48 UTC (rev 1911)
@@ -25,6 +25,8 @@
 import javax.swing.JDialog;
 import javax.swing.JFrame;
 import javax.swing.UIManager;
+import java.awt.Font;
+import com.tuxisalive.attitunes.ATTConfig;
 
 /**
  * 
@@ -33,17 +35,37 @@
  */
 public class main
 {
+       public static void setUIFont(javax.swing.plaf.FontUIResource f)
+       {
+           java.util.Enumeration<?> keys = UIManager.getDefaults().keys();
+           
+           while (keys.hasMoreElements())
+           {
+               Object key = keys.nextElement();
+               Object value = UIManager.get (key);
+               
+               if (value instanceof javax.swing.plaf.FontUIResource)
+               {
+                       UIManager.put (key, f);
+               }
+           }
+       }
+       
        public static void main(String[] args)
-       {
-               String themepack;
-               
-               // Skinlf Begin
-               try
+       {       
+               String fontName;
+
+               // On windows
+               if (System.getProperty("os.name").contains("Windows"))
                {
-                       if (System.getProperty("os.name").contains("Windows"))
+                       fontName = ATTConfig.GLOBAL_FONT_WIN;
+                       
+                       // Set the skin
+                       try
                        {
-                               themepack = 
"C:\\tuxdroid\\resources\\skin\\tuxthemepack.zip";
-                               
SkinLookAndFeel.setSkin(SkinLookAndFeel.loadThemePack(themepack));
+                               SkinLookAndFeel.setSkin(
+                                               SkinLookAndFeel.loadThemePack(
+                                                               
ATTConfig.THEMEPACK_PATH_WIN));
                                UIManager.setLookAndFeel(new SkinLookAndFeel());
                                
                                if (OS.isOneDotFourOrMore())
@@ -61,19 +83,42 @@
                              method.invoke(null, new Object[] { Boolean.TRUE 
});
                            }
                        }
-                       else
+                       catch (Exception e) {}
+               }
+               // On linux
+               else
+               {
+                       fontName = ATTConfig.GLOBAL_FONT_LINUX;
+                       
+                       // Set the skin
+                       try
                        {
-                               themepack = "./tuxthemepack.zip";
-                               
SkinLookAndFeel.setSkin(SkinLookAndFeel.loadThemePack(themepack));
+                               SkinLookAndFeel.setSkin(
+                                               SkinLookAndFeel.loadThemePack(
+                                                               
ATTConfig.THEMEPACK_PATH_LINUX));
                                UIManager.setLookAndFeel(new SkinLookAndFeel());
                        }
+                       catch (Exception e) {}
                }
-               catch (Exception e) {}
-               // Skinlf end
                
+               // Set the global font
+               setUIFont(new javax.swing.plaf.FontUIResource(
+                               fontName,
+                               Font.PLAIN,
+                               11));
+               // Set the frame title font
+               UIManager.put("InternalFrame.titleFont",new Font(
+                               fontName,
+                               Font.BOLD,
+                               12));
+               // Set the menu font
+               UIManager.put("Menu.font",new Font(
+                               fontName,
+                               Font.BOLD,
+                               11));
+               
                MainFrame mainFrame = new MainFrame();
                mainFrame.setLocationRelativeTo(null);
                mainFrame.setVisible(true);
-               
        }
 }


-------------------------------------------------------------------------
This SF.Net email is sponsored by the Moblin Your Move Developer's challenge
Build the coolest Linux based applications with Moblin SDK & win great prizes
Grand prize is a trip for two to an Open Source event anywhere in the world
http://moblin-contest.org/redirect.php?banner_id=100&url=/
_______________________________________________
Tux-droid-svn mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/tux-droid-svn

Reply via email to