logging-general mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From sde...@apache.org
Subject svn commit: r831518 - in /logging/chainsaw/trunk/src/main: java/org/apache/log4j/chainsaw/ resources/org/apache/log4j/chainsaw/prefs/
Date Sat, 31 Oct 2009 07:34:30 GMT
Author: sdeboy
Date: Sat Oct 31 07:34:29 2009
New Revision: 831518

URL: http://svn.apache.org/viewvc?rev=831518&view=rev
Log:
Chainsaw bug fixes
 - when undocking a logpanel, the initial size would be incorrect
 - level icons lost when marker icon was added
 - prevent NPE in tablecolorizingrenderer

Also, changed the default chainsaw frame size to 1024x768

Modified:
    logging/chainsaw/trunk/src/main/java/org/apache/log4j/chainsaw/ChainsawToolBarAndMenus.java
    logging/chainsaw/trunk/src/main/java/org/apache/log4j/chainsaw/DockablePanel.java
    logging/chainsaw/trunk/src/main/java/org/apache/log4j/chainsaw/LogPanel.java
    logging/chainsaw/trunk/src/main/java/org/apache/log4j/chainsaw/TableColorizingRenderer.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/ChainsawToolBarAndMenus.java
URL: http://svn.apache.org/viewvc/logging/chainsaw/trunk/src/main/java/org/apache/log4j/chainsaw/ChainsawToolBarAndMenus.java?rev=831518&r1=831517&r2=831518&view=diff
==============================================================================
--- logging/chainsaw/trunk/src/main/java/org/apache/log4j/chainsaw/ChainsawToolBarAndMenus.java
(original)
+++ logging/chainsaw/trunk/src/main/java/org/apache/log4j/chainsaw/ChainsawToolBarAndMenus.java
Sat Oct 31 07:34:29 2009
@@ -613,6 +613,7 @@
   private Action createCustomExpressionPanelAction() {
     final JDialog dialog = new JDialog(logui, "Define tab", true);
     dialog.getContentPane().add(getCustomExpressionPanel());
+    dialog.setLocationRelativeTo(null);
     dialog.pack();
 
     Action createExpressionPanel =
@@ -623,7 +624,7 @@
       };
 
     createExpressionPanel.putValue(
-      Action.SHORT_DESCRIPTION, "Create custom expression LogPanel...");
+      Action.SHORT_DESCRIPTION, "Create custom expression LogPanel...   ");
 
     // TODO think of good mnemonics and HotKey for this action
     return createExpressionPanel;

Modified: logging/chainsaw/trunk/src/main/java/org/apache/log4j/chainsaw/DockablePanel.java
URL: http://svn.apache.org/viewvc/logging/chainsaw/trunk/src/main/java/org/apache/log4j/chainsaw/DockablePanel.java?rev=831518&r1=831517&r2=831518&view=diff
==============================================================================
--- logging/chainsaw/trunk/src/main/java/org/apache/log4j/chainsaw/DockablePanel.java (original)
+++ logging/chainsaw/trunk/src/main/java/org/apache/log4j/chainsaw/DockablePanel.java Sat
Oct 31 07:34:29 2009
@@ -17,6 +17,8 @@
 
 package org.apache.log4j.chainsaw;
 
+import java.awt.Dimension;
+
 import javax.swing.JPanel;
 
 
@@ -38,4 +40,8 @@
     return isDocked;
   }
 
+    public Dimension getPreferredSize()
+    {
+        return new Dimension(1024, 768);
+    }
 }

Modified: logging/chainsaw/trunk/src/main/java/org/apache/log4j/chainsaw/LogPanel.java
URL: http://svn.apache.org/viewvc/logging/chainsaw/trunk/src/main/java/org/apache/log4j/chainsaw/LogPanel.java?rev=831518&r1=831517&r2=831518&view=diff
==============================================================================
--- logging/chainsaw/trunk/src/main/java/org/apache/log4j/chainsaw/LogPanel.java (original)
+++ logging/chainsaw/trunk/src/main/java/org/apache/log4j/chainsaw/LogPanel.java Sat Oct 31
07:34:29 2009
@@ -318,7 +318,6 @@
 
     externalPanel = new DockablePanel();
     externalPanel.setLayout(new BorderLayout());
-    undockedFrame.getContentPane().add(externalPanel);
 
     undockedFrame.addWindowListener(
       new WindowAdapter() {
@@ -329,6 +328,8 @@
 
     undockedToolbar = createDockwindowToolbar();
     externalPanel.add(undockedToolbar, BorderLayout.NORTH);
+    undockedFrame.getContentPane().add(externalPanel);
+    undockedFrame.setSize(new Dimension(1024, 768));
     undockedFrame.pack();
 
     /*
@@ -1593,8 +1594,14 @@
                 nameTreeAndMainPanelSplit.setDividerLocation(in.readInt());
                 detailLayout.setConversionPattern(in.readObject().toString());
                 Point p = (Point)in.readObject();
-                undockedFrame.setLocation(p.x, p.y);
-                undockedFrame.setSize(((Dimension)in.readObject()));
+                Dimension d = (Dimension)in.readObject();
+                if (p.x != 0 && p.y != 0) {
+                    undockedFrame.setLocation(p.x, p.y);
+                    undockedFrame.setSize(d);
+                } else {
+                    undockedFrame.setLocation(0, 0);
+                    undockedFrame.setSize(new Dimension(1024, 768));
+                }
 
                 int versionNumber = 0;
                 Vector savedVector;
@@ -1806,6 +1813,7 @@
     externalPanel.add(undockedToolbar, BorderLayout.NORTH);
     externalPanel.add(nameTreeAndMainPanelSplit, BorderLayout.CENTER);
     externalPanel.setDocked(false);
+    undockedFrame.pack();
 
     undockedFrame.setVisible(true);
     dockingAction.putValue(Action.NAME, "Dock");

Modified: logging/chainsaw/trunk/src/main/java/org/apache/log4j/chainsaw/TableColorizingRenderer.java
URL: http://svn.apache.org/viewvc/logging/chainsaw/trunk/src/main/java/org/apache/log4j/chainsaw/TableColorizingRenderer.java?rev=831518&r1=831517&r2=831518&view=diff
==============================================================================
--- logging/chainsaw/trunk/src/main/java/org/apache/log4j/chainsaw/TableColorizingRenderer.java
(original)
+++ logging/chainsaw/trunk/src/main/java/org/apache/log4j/chainsaw/TableColorizingRenderer.java
Sat Oct 31 07:34:29 2009
@@ -100,6 +100,10 @@
 
     EventContainer container = (EventContainer) table.getModel();
     LoggingEvent event = container.getRow(row);
+    //no event, use default renderer
+    if (event == null) {
+        return super.getTableCellRendererComponent(table, value, isSelected, hasFocus, row,
col);
+    }
 
     switch (colIndex) {
     case ChainsawColumns.INDEX_ID_COL_NAME:
@@ -187,10 +191,12 @@
         break;
     }
     //set the 'marker' icon next to the zeroth column if marker is set
-    if (col == 0 && event.getProperty(ChainsawConstants.MARKER_PROPERTY_NAME) !=
null) {
+    if (col == 0) {
+      if (event.getProperty(ChainsawConstants.MARKER_PROPERTY_NAME) != null) {
         c.setIcon(markerIcon);
-    } else {
+      } else {
         c.setIcon(null);
+      }
     }
 
     if (isSelected) {

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=831518&r1=831517&r2=831518&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
Sat Oct 31 07:34:29 2009
@@ -4,10 +4,10 @@
 
 # These next settings define the location and dimenions of the main
 # window when it is first realized on startup
-main.window.x=50
-main.window.y=50
-main.window.width=640
-main.window.height=480
+main.window.x=0
+main.window.y=0
+main.window.width=1024
+main.window.height=768
 
 table.columns.order=ID,TIMESTAMP,LEVEL,LOGGER,MESSAGE,THROWABLE,THREAD,NDC,CLASS,METHOD,FILE,LINE
 table.columns.widths=50,150,50,100,300,100,150,150,300,150,100,100



Mime
View raw message