logging-general mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From sde...@apache.org
Subject svn commit: r1025836 - in /logging/chainsaw/trunk/src/main/java/org/apache/log4j/chainsaw: ApplicationPreferenceModelPanel.java LogPanel.java LoggingEventWrapper.java
Date Thu, 21 Oct 2010 05:56:34 GMT
Author: sdeboy
Date: Thu Oct 21 05:56:34 2010
New Revision: 1025836

URL: http://svn.apache.org/viewvc?rev=1025836&view=rev
Log:
Fixed bug in Nimbus L&F removal logic
Removed property removal logic from loggingeventwrapper constructor
Minor changes to Swing calls (revalidate, etc)

Modified:
    logging/chainsaw/trunk/src/main/java/org/apache/log4j/chainsaw/ApplicationPreferenceModelPanel.java
    logging/chainsaw/trunk/src/main/java/org/apache/log4j/chainsaw/LogPanel.java
    logging/chainsaw/trunk/src/main/java/org/apache/log4j/chainsaw/LoggingEventWrapper.java

Modified: logging/chainsaw/trunk/src/main/java/org/apache/log4j/chainsaw/ApplicationPreferenceModelPanel.java
URL: http://svn.apache.org/viewvc/logging/chainsaw/trunk/src/main/java/org/apache/log4j/chainsaw/ApplicationPreferenceModelPanel.java?rev=1025836&r1=1025835&r2=1025836&view=diff
==============================================================================
--- logging/chainsaw/trunk/src/main/java/org/apache/log4j/chainsaw/ApplicationPreferenceModelPanel.java
(original)
+++ logging/chainsaw/trunk/src/main/java/org/apache/log4j/chainsaw/ApplicationPreferenceModelPanel.java
Thu Oct 21 05:56:34 2010
@@ -183,18 +183,20 @@ public static void main(String[] args) {
 
       //Nimbus has major issues with colors in tables..just remove it from the list..
       //only use this if nimbus was found..
-      UIManager.LookAndFeelInfo[] newLookAndFeels = new UIManager.LookAndFeelInfo[lookAndFeels.length
- 1];
+      UIManager.LookAndFeelInfo[] newLookAndFeels = new UIManager.LookAndFeelInfo[lookAndFeels.length];
       boolean useNewLookAndFeels = false;
       int j = 0;
       for (int i=0;i<lookAndFeels.length;i++) {
-          if (!lookAndFeels[i].getClassName().toLowerCase().contains("nimbus")) {
-              newLookAndFeels[j++] = lookAndFeels[i];
-          } else {
-              useNewLookAndFeels = true;
-          }
+        if (lookAndFeels[i].getClassName().toLowerCase().contains("nimbus")) {
+            useNewLookAndFeels = true;
+        } else {
+            newLookAndFeels[j++] = lookAndFeels[i];
+        }
       }
       if (useNewLookAndFeels) {
-          lookAndFeels = newLookAndFeels;
+          UIManager.LookAndFeelInfo[] replacedLookAndFeels = new UIManager.LookAndFeelInfo[lookAndFeels.length
- 1];
+          System.arraycopy(newLookAndFeels, 0, replacedLookAndFeels, 0, newLookAndFeels.length
- 1);
+          lookAndFeels = replacedLookAndFeels;
       }
 
       setupComponents();

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=1025836&r1=1025835&r2=1025836&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 Thu Oct 21
05:56:34 2010
@@ -267,6 +267,7 @@ public class LogPanel extends DockablePa
   private JToolBar detailToolbar;
   private boolean searchResultsDisplayed;
   private ColorizedEventAndSearchMatchThumbnail colorizedEventAndSearchMatchThumbnail;
+  private EventTimeDeltaMatchThumbnail eventTimeDeltaMatchThumbnail;
 
   /**
    * Creates a new LogPanel object.  If a LogPanel with this identifier has
@@ -854,11 +855,9 @@ public class LogPanel extends DockablePa
 //             loggingEventWrapper.updateColorRuleColors(colorizer.getBackgroundColor(loggingEventWrapper.getLoggingEvent()),
colorizer.getForegroundColor(loggingEventWrapper.getLoggingEvent()));
 //           }
           colorizedEventAndSearchMatchThumbnail.configureColors();
-          lowerPanel.invalidate();
           lowerPanel.revalidate();
           lowerPanel.repaint();
 
-          searchTable.invalidate();
           searchTable.revalidate();
           searchTable.repaint();
         }
@@ -1258,7 +1257,8 @@ public class LogPanel extends DockablePa
     JPanel leftThumbNailPanel = new JPanel();
     leftThumbNailPanel.setLayout(new BoxLayout(leftThumbNailPanel, BoxLayout.Y_AXIS));
     leftThumbNailPanel.add(Box.createVerticalStrut(scrollBarWidth.intValue()));
-    leftThumbNailPanel.add(new EventTimeDeltaMatchThumbnail());
+    eventTimeDeltaMatchThumbnail = new EventTimeDeltaMatchThumbnail();
+    leftThumbNailPanel.add(eventTimeDeltaMatchThumbnail);
     leftThumbNailPanel.add(Box.createVerticalStrut(scrollBarWidth.intValue()));
     leftPanel.add(leftThumbNailPanel);
 
@@ -2606,7 +2606,6 @@ public class LogPanel extends DockablePa
       detailPanel.add(leftSpacePanel, BorderLayout.WEST);
       detailPanel.add(rightSpacePanel, BorderLayout.EAST);
  
-      detailPanel.invalidate();
       detailPanel.revalidate();
       detailPanel.repaint();
       //if the detail visible pref is not enabled, hide the detail pane
@@ -2630,7 +2629,6 @@ public class LogPanel extends DockablePa
       rightSpacePanel.setPreferredSize(new Dimension(scrollBarWidth.intValue() -4, -1));
       detailPanel.add(leftSpacePanel, BorderLayout.WEST);
       detailPanel.add(rightSpacePanel, BorderLayout.EAST);
-      detailPanel.invalidate();
       detailPanel.revalidate();
       detailPanel.repaint();
       //if the detail visible pref is not enabled, show the detail pane
@@ -3749,7 +3747,7 @@ public class LogPanel extends DockablePa
 
     private class EventTimeDeltaMatchThumbnail extends AbstractEventMatchThumbnail {
         public EventTimeDeltaMatchThumbnail() {
-            super();
+            super("timedelta");
             initializeLists();
         }
 
@@ -3782,7 +3780,7 @@ public class LogPanel extends DockablePa
                     primaryList.add(wrapper);
                 }
             }
-            invalidate();
+            revalidate();
             repaint();
         }
 
@@ -3829,7 +3827,7 @@ public class LogPanel extends DockablePa
   //a listener receiving color updates needs to call configureColors on this class
     private class ColorizedEventAndSearchMatchThumbnail extends AbstractEventMatchThumbnail
{
         public ColorizedEventAndSearchMatchThumbnail() {
-            super();
+            super("colors");
             configureColors();
         }
 
@@ -3858,7 +3856,7 @@ public class LogPanel extends DockablePa
                     primaryList.add(wrapper);
                 }
             }
-            invalidate();
+            revalidate();
             repaint();
         }
 
@@ -3940,7 +3938,7 @@ public class LogPanel extends DockablePa
         protected List secondaryList = new ArrayList();
         protected final int maxEventHeight = 6;
 
-        AbstractEventMatchThumbnail() {
+        AbstractEventMatchThumbnail(final String name) {
             super();
             addMouseMotionListener(new MouseMotionAdapter() {
               public void mouseMoved(MouseEvent e) {
@@ -4062,7 +4060,7 @@ public class LogPanel extends DockablePa
                         }
 //                        System.out.println("update - new warnings: " + warnings.size()
+ ", errors: " + errors.size());
                     }
-                    invalidate();
+                    revalidate();
                     repaint();
                     //run this in an invokeLater block to ensure this action is enqueued
to the end of the EDT
                     EventQueue.invokeLater(new Runnable() {

Modified: logging/chainsaw/trunk/src/main/java/org/apache/log4j/chainsaw/LoggingEventWrapper.java
URL: http://svn.apache.org/viewvc/logging/chainsaw/trunk/src/main/java/org/apache/log4j/chainsaw/LoggingEventWrapper.java?rev=1025836&r1=1025835&r2=1025836&view=diff
==============================================================================
--- logging/chainsaw/trunk/src/main/java/org/apache/log4j/chainsaw/LoggingEventWrapper.java
(original)
+++ logging/chainsaw/trunk/src/main/java/org/apache/log4j/chainsaw/LoggingEventWrapper.java
Thu Oct 21 05:56:34 2010
@@ -61,19 +61,6 @@ public class LoggingEventWrapper {
     this.syncWrapper = loggingEventWrapper;
     this.eventContainer = eventContainer;
     loggingEventWrapper.syncWrapper = this;
-    Map theseProperties = loggingEvent.getProperties();
-
-    LoggingEvent thatLoggingEvent = syncWrapper.getLoggingEvent();
-    Map syncEventPropertiesCopy = new HashMap(thatLoggingEvent.getProperties());
-    for (Iterator iter = syncEventPropertiesCopy.entrySet().iterator();iter.hasNext();) {
-      Map.Entry entry = (Map.Entry)iter.next();
-      thatLoggingEvent.removeProperty(entry.getKey().toString());
-    }
-
-    for (Iterator iter = theseProperties.entrySet().iterator();iter.hasNext();) {
-      Map.Entry entry = (Map.Entry)iter.next();
-      thatLoggingEvent.setProperty(entry.getKey().toString(), entry.getValue().toString());
-    }
   }
 
   public LoggingEvent getLoggingEvent() {



Mime
View raw message