logging-general mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From sde...@apache.org
Subject svn commit: r930644 - in /logging/chainsaw/trunk/src/main: java/org/apache/log4j/chainsaw/ java/org/apache/log4j/chainsaw/layout/ resources/org/apache/log4j/chainsaw/help/
Date Sun, 04 Apr 2010 08:41:33 GMT
Author: sdeboy
Date: Sun Apr  4 08:41:32 2010
New Revision: 930644

URL: http://svn.apache.org/viewvc?rev=930644&view=rev
Log:
Chainsaw updates
 - It's now possible to directly load events stored in a zip file created when saving events
to a file with a zip extension
 - Now hiding the receivers panel by default
 - Reduced the default size of the details pane
 - Updated logpanel details, welcome tab and release notes panes to use system fonts and size

Modified:
    logging/chainsaw/trunk/src/main/java/org/apache/log4j/chainsaw/ApplicationPreferenceModel.java
    logging/chainsaw/trunk/src/main/java/org/apache/log4j/chainsaw/ChainsawAbout.java
    logging/chainsaw/trunk/src/main/java/org/apache/log4j/chainsaw/FileLoadAction.java
    logging/chainsaw/trunk/src/main/java/org/apache/log4j/chainsaw/LogPanel.java
    logging/chainsaw/trunk/src/main/java/org/apache/log4j/chainsaw/LogUI.java
    logging/chainsaw/trunk/src/main/java/org/apache/log4j/chainsaw/WelcomePanel.java
    logging/chainsaw/trunk/src/main/java/org/apache/log4j/chainsaw/layout/LayoutEditorPane.java
    logging/chainsaw/trunk/src/main/resources/org/apache/log4j/chainsaw/help/release-notes.html

Modified: logging/chainsaw/trunk/src/main/java/org/apache/log4j/chainsaw/ApplicationPreferenceModel.java
URL: http://svn.apache.org/viewvc/logging/chainsaw/trunk/src/main/java/org/apache/log4j/chainsaw/ApplicationPreferenceModel.java?rev=930644&r1=930643&r2=930644&view=diff
==============================================================================
--- logging/chainsaw/trunk/src/main/java/org/apache/log4j/chainsaw/ApplicationPreferenceModel.java
(original)
+++ logging/chainsaw/trunk/src/main/java/org/apache/log4j/chainsaw/ApplicationPreferenceModel.java
Sun Apr  4 08:41:32 2010
@@ -32,7 +32,7 @@ public class ApplicationPreferenceModel 
     private boolean showNoReceiverWarning = true ;
     private boolean statusBar = true;
     private boolean toolbar = true;
-    private boolean receivers = true;
+    private boolean receivers = false; //setting this to true will cause the receivers panel
to be displayed by default
     private boolean confirmExit = true;
     private boolean showSplash = true;
     private String lookAndFeelClassName = "";

Modified: logging/chainsaw/trunk/src/main/java/org/apache/log4j/chainsaw/ChainsawAbout.java
URL: http://svn.apache.org/viewvc/logging/chainsaw/trunk/src/main/java/org/apache/log4j/chainsaw/ChainsawAbout.java?rev=930644&r1=930643&r2=930644&view=diff
==============================================================================
--- logging/chainsaw/trunk/src/main/java/org/apache/log4j/chainsaw/ChainsawAbout.java (original)
+++ logging/chainsaw/trunk/src/main/java/org/apache/log4j/chainsaw/ChainsawAbout.java Sun
Apr  4 08:41:32 2010
@@ -23,6 +23,7 @@ package org.apache.log4j.chainsaw;
 
 import java.awt.BorderLayout;
 import java.awt.Color;
+import java.awt.Font;
 import java.awt.Point;
 import java.awt.event.ActionEvent;
 import java.awt.event.ActionListener;
@@ -34,8 +35,10 @@ import javax.swing.JFrame;
 import javax.swing.JScrollPane;
 import javax.swing.ScrollPaneConstants;
 import javax.swing.SwingUtilities;
+import javax.swing.UIManager;
 import javax.swing.event.HyperlinkEvent;
 import javax.swing.event.HyperlinkListener;
+import javax.swing.text.html.HTMLDocument;
 
 import org.apache.log4j.Logger;
 import org.apache.log4j.chainsaw.help.HelpManager;
@@ -84,6 +87,10 @@ class ChainsawAbout extends JDialog {
         getContentPane().add(scrollPane, BorderLayout.CENTER);
         getContentPane().add(closeButton, BorderLayout.SOUTH);
 
+        Font font = UIManager.getFont("Label.font");
+        String bodyRule = "body { font-family: " + font.getFamily() + "; font-size: " + (font.getSize()
+ 1) + "pt; }";
+        ((HTMLDocument)editPane.getDocument()).getStyleSheet().addRule(bodyRule);
+
         editPane.setEditable(false);
         editPane.addHyperlinkListener(
                 new HyperlinkListener() {

Modified: logging/chainsaw/trunk/src/main/java/org/apache/log4j/chainsaw/FileLoadAction.java
URL: http://svn.apache.org/viewvc/logging/chainsaw/trunk/src/main/java/org/apache/log4j/chainsaw/FileLoadAction.java?rev=930644&r1=930643&r2=930644&view=diff
==============================================================================
--- logging/chainsaw/trunk/src/main/java/org/apache/log4j/chainsaw/FileLoadAction.java (original)
+++ logging/chainsaw/trunk/src/main/java/org/apache/log4j/chainsaw/FileLoadAction.java Sun
Apr  4 08:41:32 2010
@@ -91,12 +91,12 @@ class FileLoadAction extends AbstractAct
 
                 chooser.setFileFilter(new FileFilter() {
                     public boolean accept(File f) {
-                        return (f.getName().toLowerCase().endsWith(".xml") || f
-                                .isDirectory());
+                        return (f.getName().toLowerCase().endsWith(".xml") || f.getName().toLowerCase().endsWith(".zip")
+                                || f.isDirectory());
                     }
 
                     public String getDescription() {
-                        return "XML files (*.xml)";
+                        return "XML files (*.xml), ZIP files (*.zip)";
                     }
                 });
             }

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=930644&r1=930643&r2=930644&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 Sun Apr 
4 08:41:32 2010
@@ -124,6 +124,7 @@ import javax.swing.table.TableCellEditor
 import javax.swing.table.TableColumn;
 import javax.swing.table.TableColumnModel;
 import javax.swing.text.Document;
+import javax.swing.text.html.HTMLDocument;
 
 import org.apache.log4j.Level;
 import org.apache.log4j.LogManager;
@@ -206,7 +207,7 @@ import com.thoughtworks.xstream.io.xml.D
  *
  */
 public class LogPanel extends DockablePanel implements EventBatchListener, Profileable {
-  private static final double DEFAULT_DETAIL_SPLIT_LOCATION = 0.56d;
+  private static final double DEFAULT_DETAIL_SPLIT_LOCATION = 0.71d;
   private static final double DEFAULT_LOG_TREE_SPLIT_LOCATION = 0.2d;
   private final String identifier;
   private final ChainsawStatusBar statusBar;
@@ -2951,9 +2952,13 @@ public class LogPanel extends DockablePa
 		          	try {
 		          		final Document doc = detail.getEditorKit().createDefaultDocument();
 		          		detail.getEditorKit().read(new StringReader(buf.toString()), doc, 0);
+
 				      	SwingHelper.invokeOnEDT(new Runnable() {
 				      		public void run() {
 				      			detail.setDocument(doc);
+                                Font font = UIManager.getFont("Label.font");
+                                String bodyRule = "body { font-family: " + font.getFamily()
+ "; font-size: " + (font.getSize() + 1) + "pt; }";
+                                ((HTMLDocument)detail.getDocument()).getStyleSheet().addRule(bodyRule);
 				      			detail.setCaretPosition(0);
                                 lastRow = selectedRow;
 				      		}
@@ -2970,6 +2975,9 @@ public class LogPanel extends DockablePa
 		      	SwingHelper.invokeOnEDT(new Runnable() {
 		      		public void run() {
 		      			detail.setDocument(doc);
+                        Font font = UIManager.getFont("Label.font");
+                        String bodyRule = "body { font-family: " + font.getFamily() + ";
font-size: " + (font.getSize() + 1) + "pt; }";
+                        ((HTMLDocument)detail.getDocument()).getStyleSheet().addRule(bodyRule);
 		      			detail.setCaretPosition(0);
                         lastRow = selectedRow;
 		      		}

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=930644&r1=930643&r2=930644&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 Apr  4 08:41:32
2010
@@ -23,6 +23,7 @@ import java.awt.Container;
 import java.awt.Dimension;
 import java.awt.Event;
 import java.awt.EventQueue;
+import java.awt.Font;
 import java.awt.Frame;
 import java.awt.Point;
 import java.awt.Toolkit;
@@ -85,6 +86,7 @@ import javax.swing.event.ChangeListener;
 import javax.swing.event.EventListenerList;
 import javax.swing.event.HyperlinkEvent;
 import javax.swing.event.HyperlinkListener;
+import javax.swing.text.html.HTMLDocument;
 
 import org.apache.log4j.Appender;
 import org.apache.log4j.AppenderSkeleton;
@@ -168,8 +170,7 @@ public class LogUI extends JFrame implem
   private final SettingsManager sm = SettingsManager.getInstance();
   private final JFrame tutorialFrame = new JFrame("Chainsaw Tutorial");
   private JSplitPane mainReceiverSplitPane;
-  private double lastMainReceiverSplitLocation =
-    DEFAULT_MAIN_RECEIVER_SPLIT_LOCATION;
+  private double lastMainReceiverSplitLocation = DEFAULT_MAIN_RECEIVER_SPLIT_LOCATION;
   private final List identifierPanels = new ArrayList();
   private int dividerSize;
   private int cyclicBufferSize;
@@ -1030,6 +1031,10 @@ public class LogUI extends JFrame implem
 
     try {
       tutorialArea.setPage(ChainsawConstants.TUTORIAL_URL);
+      Font font = UIManager.getFont("Label.font");
+      String bodyRule = "body { font-family: " + font.getFamily() + "; font-size: " + (font.getSize()
+ 1) + "pt; }";
+      ((HTMLDocument)tutorialArea.getDocument()).getStyleSheet().addRule(bodyRule);
+
       container.add(new JScrollPane(tutorialArea), BorderLayout.CENTER);
     } catch (Exception e) {
       MessageCenter.getInstance().getLogger().error(

Modified: logging/chainsaw/trunk/src/main/java/org/apache/log4j/chainsaw/WelcomePanel.java
URL: http://svn.apache.org/viewvc/logging/chainsaw/trunk/src/main/java/org/apache/log4j/chainsaw/WelcomePanel.java?rev=930644&r1=930643&r2=930644&view=diff
==============================================================================
--- logging/chainsaw/trunk/src/main/java/org/apache/log4j/chainsaw/WelcomePanel.java (original)
+++ logging/chainsaw/trunk/src/main/java/org/apache/log4j/chainsaw/WelcomePanel.java Sun Apr
 4 08:41:32 2010
@@ -22,6 +22,7 @@ import org.apache.log4j.chainsaw.icons.C
 import java.awt.BorderLayout;
 import java.awt.Color;
 import java.awt.Dimension;
+import java.awt.Font;
 import java.awt.event.ActionEvent;
 
 import java.io.IOException;
@@ -40,8 +41,10 @@ import javax.swing.JPanel;
 import javax.swing.JScrollPane;
 import javax.swing.JToolBar;
 import javax.swing.SwingUtilities;
+import javax.swing.UIManager;
 import javax.swing.event.HyperlinkEvent;
 import javax.swing.event.HyperlinkListener;
+import javax.swing.text.html.HTMLDocument;
 
 
 /**
@@ -65,8 +68,7 @@ public class WelcomePanel extends JPanel
 
     if (helpURL != null) {
       textInfo.setBorder(BorderFactory.createEmptyBorder(0, 5, 0, 5));
-      textInfo.setEditable(false);
-      textInfo.setPreferredSize(new Dimension(320, 240));
+      Font font = UIManager.getFont("Label.font");
 
       JScrollPane pane = new JScrollPane(textInfo);
       pane.setBorder(null);
@@ -74,6 +76,10 @@ public class WelcomePanel extends JPanel
 
       try {
         textInfo.setPage(helpURL);
+        String bodyRule = "body { font-family: " + font.getFamily() + "; font-size: " + (font.getSize()
+ 1) + "pt; }";
+        ((HTMLDocument)textInfo.getDocument()).getStyleSheet().addRule(bodyRule);
+        textInfo.setEditable(false);
+        textInfo.setPreferredSize(new Dimension(320, 240));
         textInfo.addHyperlinkListener(
           new HyperlinkListener() {
             public void hyperlinkUpdate(HyperlinkEvent e) {
@@ -102,6 +108,9 @@ public class WelcomePanel extends JPanel
           try {
             urlStack.push(textInfo.getPage());
             textInfo.setPage(url);
+            Font font = UIManager.getFont("Label.font");
+            String bodyRule = "body { font-family: " + font.getFamily() + "; font-size: "
+ (font.getSize() + 1) + "pt; }";
+            ((HTMLDocument)textInfo.getDocument()).getStyleSheet().addRule(bodyRule);
             urlToolbar.updateToolbar();
           } catch (IOException e) {
             e.printStackTrace();

Modified: logging/chainsaw/trunk/src/main/java/org/apache/log4j/chainsaw/layout/LayoutEditorPane.java
URL: http://svn.apache.org/viewvc/logging/chainsaw/trunk/src/main/java/org/apache/log4j/chainsaw/layout/LayoutEditorPane.java?rev=930644&r1=930643&r2=930644&view=diff
==============================================================================
--- logging/chainsaw/trunk/src/main/java/org/apache/log4j/chainsaw/layout/LayoutEditorPane.java
(original)
+++ logging/chainsaw/trunk/src/main/java/org/apache/log4j/chainsaw/layout/LayoutEditorPane.java
Sun Apr  4 08:41:32 2010
@@ -18,6 +18,7 @@
 package org.apache.log4j.chainsaw.layout;
 
 import java.awt.Dimension;
+import java.awt.Font;
 import java.awt.Frame;
 import java.awt.event.ActionEvent;
 import java.awt.event.ActionListener;
@@ -36,11 +37,13 @@ import javax.swing.JPanel;
 import javax.swing.JScrollPane;
 import javax.swing.JToolBar;
 import javax.swing.ScrollPaneConstants;
+import javax.swing.UIManager;
 import javax.swing.WindowConstants;
 import javax.swing.event.CaretEvent;
 import javax.swing.event.CaretListener;
 import javax.swing.event.DocumentEvent;
 import javax.swing.event.DocumentListener;
+import javax.swing.text.html.HTMLDocument;
 
 import org.apache.log4j.Logger;
 import org.apache.log4j.chainsaw.ChainsawConstants;
@@ -203,7 +206,11 @@ public final class LayoutEditorPane exte
     okCancelToolbar.setFloatable(false);
     okButton.setToolTipText("Accepts the current Pattern layout and will apply it to the
Log Panel");
     cancelButton.setToolTipText("Closes this dialog and discards your changes");
-    
+
+    Font font = UIManager.getFont("Label.font");
+    String bodyRule = "body { font-family: " + font.getFamily() + "; font-size: " + (font.getSize()
+ 1) + "pt; }";
+    ((HTMLDocument)previewer.getDocument()).getStyleSheet().addRule(bodyRule);
+      
     previewer.setEditable(false);
     patternEditor.setPreferredSize(new Dimension(240, 240));
     patternEditor.setMaximumSize(new Dimension(320, 240));

Modified: logging/chainsaw/trunk/src/main/resources/org/apache/log4j/chainsaw/help/release-notes.html
URL: http://svn.apache.org/viewvc/logging/chainsaw/trunk/src/main/resources/org/apache/log4j/chainsaw/help/release-notes.html?rev=930644&r1=930643&r2=930644&view=diff
==============================================================================
--- logging/chainsaw/trunk/src/main/resources/org/apache/log4j/chainsaw/help/release-notes.html
(original)
+++ logging/chainsaw/trunk/src/main/resources/org/apache/log4j/chainsaw/help/release-notes.html
Sun Apr  4 08:41:32 2010
@@ -10,6 +10,14 @@
 <b>NOTE:</b> The mechanism and format used to persist settings in Chainsaw is
subject to change.  If you are experiencing problems displaying events in Chainsaw, please
delete everything in the $user.dir/.chainsaw directory and restart Chainsaw.
 <br>
 <h1>1.99.99</h1>
+<h2>3 Apr 2010</h2>
+<ul>
+<li>
+It's now possible to directly load events stored in a zip file created when saving events
to a file with a zip extension.</li>
+<li>Now hiding the receivers panel by default.</li>
+<li>Reduced the default size of the details pane.</li>
+<li>Updated logpanel details, welcome tab and release notes panes to use system fonts
and size.</li>
+</ul>
 <h2>2 Apr 2010</h2>
 <ul>
 <li>
@@ -19,18 +27,15 @@ just creates a text file containing the 
 </ul>
 <h2>1 Apr 2010</h2>
 <ul>
-<li>
-Updated thumbnail bar to display all events with a defined color (will include the default
color rules for marker, warning, error & fatal events).
-Added search matches to thumbnail bar (will display black in the left half of the row if
the row matches the search expression.
-Added ctrl-n to go to next colorized event, ctrl-p to go to previous colorized event.
-</li>
+<li>Updated thumbnail bar to display all events with a defined color (will include
the default color rules for marker, warning, error & fatal events).</li>
+<li>Added search matches to thumbnail bar (will display black in the left half of the
row if the row matches the search expression.</li>
+<li>Added ctrl-n to go to next colorized event, ctrl-p to go to previous colorized
event.</li>
 </ul>
 <h2>27 Mar 2010</h2>
 <ul>
-<li>
-New clickable thumbnail bar next to logpanel scroll bar provides a visual indicator of events
with warning level as well as error/fatal.
-Clicking in the bar will jump to the closest event.
-Colors in the thumbnail bar will sync with the default warning and error/fatal color rules
(LEVEL == WARNING) and (level == FATAL || level == ERROR) respectively.
+<li>New clickable thumbnail bar next to logpanel scroll bar provides a visual indicator
of events with warning level as well as error/fatal.</li>
+<li>Clicking in the bar will jump to the closest event.</li>
+<li>Colors in the thumbnail bar will sync with the default warning and error/fatal
color rules (LEVEL == WARNING) and (level == FATAL || level == ERROR) respectively.</li>
 </li>
 </ul>
 <h2>23 Mar 2010</h2>



Mime
View raw message