logging-general mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From sde...@apache.org
Subject svn commit: r1034942 - in /logging/chainsaw/trunk/src/main: java/org/apache/log4j/chainsaw/LogUI.java resources/org/apache/log4j/chainsaw/prefs/default.properties
Date Sun, 14 Nov 2010 06:31:46 GMT
Author: sdeboy
Date: Sun Nov 14 06:31:46 2010
New Revision: 1034942

URL: http://svn.apache.org/viewvc?rev=1034942&view=rev
Log:
Minor UI fixes
Using platform-specific default look and feel on mac & linux instead of metal
Defaulting Chainsaw screen size to maximized by default

Modified:
    logging/chainsaw/trunk/src/main/java/org/apache/log4j/chainsaw/LogUI.java
    logging/chainsaw/trunk/src/main/resources/org/apache/log4j/chainsaw/prefs/default.properties

Modified: logging/chainsaw/trunk/src/main/java/org/apache/log4j/chainsaw/LogUI.java
URL: http://svn.apache.org/viewvc/logging/chainsaw/trunk/src/main/java/org/apache/log4j/chainsaw/LogUI.java?rev=1034942&r1=1034941&r2=1034942&view=diff
==============================================================================
--- logging/chainsaw/trunk/src/main/java/org/apache/log4j/chainsaw/LogUI.java (original)
+++ logging/chainsaw/trunk/src/main/java/org/apache/log4j/chainsaw/LogUI.java Sun Nov 14 06:31:46
2010
@@ -290,6 +290,19 @@ public class LogUI extends JFrame implem
         public void run()
         {
           String lookAndFeelClassName = model.getLookAndFeelClassName();
+          if (lookAndFeelClassName == null || lookAndFeelClassName.trim().equals("")) {
+              String osName = System.getProperty("os.name");
+              if (osName.toLowerCase().startsWith("mac")) {
+                  //no need to assign look and feel
+              } else if (osName.toLowerCase().startsWith("windows")) {
+                  lookAndFeelClassName = "com.sun.java.swing.plaf.windows.WindowsLookAndFeel";
+                  model.setLookAndFeelClassName(lookAndFeelClassName);
+              } else if (osName.toLowerCase().startsWith("linux")) {
+                  lookAndFeelClassName = "com.sun.java.swing.plaf.gtk.GTKLookAndFeel";
+                  model.setLookAndFeelClassName(lookAndFeelClassName);
+              }
+          }
+
           if (lookAndFeelClassName != null && !(lookAndFeelClassName.trim().equals("")))
{
             loadLookAndFeelUsingPluginClassLoader(lookAndFeelClassName);
           }
@@ -709,9 +722,16 @@ public class LogUI extends JFrame implem
   public void loadSettings(LoadSettingsEvent event) {
     setLocation(
       event.asInt(LogUI.MAIN_WINDOW_X), event.asInt(LogUI.MAIN_WINDOW_Y));
-    setSize(
-      event.asInt(LogUI.MAIN_WINDOW_WIDTH),
-      event.asInt(LogUI.MAIN_WINDOW_HEIGHT));
+      int width = event.asInt(LogUI.MAIN_WINDOW_WIDTH);
+      int height = event.asInt(LogUI.MAIN_WINDOW_HEIGHT);
+      if (width == -1 && height == -1) {
+          width = Toolkit.getDefaultToolkit().getScreenSize().width;
+          height = Toolkit.getDefaultToolkit().getScreenSize().height;
+          setSize(width, height);
+          setExtendedState(getExtendedState() | MAXIMIZED_BOTH);
+      } else {
+          setSize(width, height);
+      }
 
     getToolBarAndMenus().stateChange();
     RuleColorizer colorizer = new RuleColorizer();

Modified: logging/chainsaw/trunk/src/main/resources/org/apache/log4j/chainsaw/prefs/default.properties
URL: http://svn.apache.org/viewvc/logging/chainsaw/trunk/src/main/resources/org/apache/log4j/chainsaw/prefs/default.properties?rev=1034942&r1=1034941&r2=1034942&view=diff
==============================================================================
--- logging/chainsaw/trunk/src/main/resources/org/apache/log4j/chainsaw/prefs/default.properties
(original)
+++ logging/chainsaw/trunk/src/main/resources/org/apache/log4j/chainsaw/prefs/default.properties
Sun Nov 14 06:31:46 2010
@@ -21,8 +21,9 @@
 # window when it is first realized on startup
 main.window.x=0
 main.window.y=0
-main.window.width=1024
-main.window.height=768
+# default width and height to -1 will display the app at full screen resolution
+main.window.width=-1
+main.window.height=-1
 
 table.columns.order=ID,TIMESTAMP,MARKER,LEVEL,LOGGER,MESSAGE,THROWABLE,THREAD,NDC,CLASS,METHOD,FILE,LINE,MILLISDELTA
 table.columns.widths=50,80,95,50,100,500,100,100,100,100,100,100,100,100



Mime
View raw message