sdeboy 2004/07/28 01:02:18
Modified: src/java/org/apache/log4j/chainsaw/version
VersionManager.java
src/java/org/apache/log4j/chainsaw
ChainsawCyclicBufferTableModel.java LogPanel.java
LogUI.java LoggerNameTreePanel.java
src/java/org/apache/log4j/chainsaw/color RuleColorizer.java
ColorPanel.java
src/java/org/apache/log4j/chainsaw/help release-notes.html
Log:
- Corrected row selection and detail pane synchronization bugs related selection of
nodes in the logger tree and docking/undocking.
- Dock now re-selects the docked tab.
Revision Changes Path
1.10 +1 -1
logging-log4j/src/java/org/apache/log4j/chainsaw/version/VersionManager.java
Index: VersionManager.java
===================================================================
RCS file:
/home/cvs/logging-log4j/src/java/org/apache/log4j/chainsaw/version/VersionManager.java,v
retrieving revision 1.9
retrieving revision 1.10
diff -u -r1.9 -r1.10
--- VersionManager.java 27 Jul 2004 06:48:51 -0000 1.9
+++ VersionManager.java 28 Jul 2004 08:02:17 -0000 1.10
@@ -10,7 +10,7 @@
private static final VersionManager instance = new VersionManager();
- private static final String VERSION_INFO = "1.99.99 (26 July 2004)";
+ private static final String VERSION_INFO = "1.99.99 (28 July 2004)";
public static final VersionManager getInstance() {
return instance;
1.33 +24 -9
logging-log4j/src/java/org/apache/log4j/chainsaw/ChainsawCyclicBufferTableModel.java
Index: ChainsawCyclicBufferTableModel.java
===================================================================
RCS file:
/home/cvs/logging-log4j/src/java/org/apache/log4j/chainsaw/ChainsawCyclicBufferTableModel.java,v
retrieving revision 1.32
retrieving revision 1.33
diff -u -r1.32 -r1.33
--- ChainsawCyclicBufferTableModel.java 20 Jul 2004 22:22:11 -0000 1.32
+++ ChainsawCyclicBufferTableModel.java 28 Jul 2004 08:02:17 -0000 1.33
@@ -16,16 +16,9 @@
package org.apache.log4j.chainsaw;
-import org.apache.log4j.helpers.Constants;
-import org.apache.log4j.helpers.LogLog;
-import org.apache.log4j.rule.Rule;
-import org.apache.log4j.spi.LocationInfo;
-import org.apache.log4j.spi.LoggingEvent;
-
import java.beans.PropertyChangeEvent;
import java.beans.PropertyChangeListener;
import java.beans.PropertyChangeSupport;
-
import java.util.ArrayList;
import java.util.Collection;
import java.util.Collections;
@@ -36,9 +29,16 @@
import java.util.Set;
import javax.swing.ProgressMonitor;
+import javax.swing.SwingUtilities;
import javax.swing.event.EventListenerList;
import javax.swing.table.AbstractTableModel;
+import org.apache.log4j.helpers.Constants;
+import org.apache.log4j.helpers.LogLog;
+import org.apache.log4j.rule.Rule;
+import org.apache.log4j.spi.LocationInfo;
+import org.apache.log4j.spi.LoggingEvent;
+
/**
* A CyclicBuffer implementation of the EventContainer.
@@ -118,6 +118,7 @@
private void reFilter() {
synchronized (unfilteredList) {
+ final int previousSize = filteredList.size();
try {
filteredList.clear();
@@ -131,8 +132,22 @@
}
}
} finally {
- fireTableDataChanged();
- notifyCountListeners();
+ SwingUtilities.invokeLater(new Runnable() {
+ public void run() {
+ if (previousSize == filteredList.size()) {
+ //same - update all
+ fireTableRowsUpdated(0, filteredList.size() -
1);
+ } else if (previousSize > filteredList.size()) {
+ //less now..update and delete difference
+ fireTableRowsUpdated(0, filteredList.size() -
1);
+ fireTableRowsDeleted(filteredList.size(),
previousSize);
+ } else if (previousSize < filteredList.size()) {
+ //more now..update and insert difference
+ fireTableRowsUpdated(0, previousSize - 1);
+ fireTableRowsInserted(previousSize,
filteredList.size() - 1);
+ }
+ notifyCountListeners();
+ }});
}
}
}
1.86 +22 -9 logging-log4j/src/java/org/apache/log4j/chainsaw/LogPanel.java
Index: LogPanel.java
===================================================================
RCS file: /home/cvs/logging-log4j/src/java/org/apache/log4j/chainsaw/LogPanel.java,v
retrieving revision 1.85
retrieving revision 1.86
diff -u -r1.85 -r1.86
--- LogPanel.java 27 Jul 2004 07:06:58 -0000 1.85
+++ LogPanel.java 28 Jul 2004 08:02:17 -0000 1.86
@@ -104,6 +104,7 @@
import javax.swing.event.TableColumnModelEvent;
import javax.swing.event.TableColumnModelListener;
import javax.swing.event.TableModelEvent;
+import javax.swing.event.TableModelListener;
import javax.swing.table.TableColumn;
import javax.swing.table.TableColumnModel;
@@ -663,8 +664,6 @@
if (table != null) {
table.repaint();
}
-
- colorPanel.updateColors();
}
});
@@ -963,7 +962,12 @@
}
});
-
+ tableModel.addTableModelListener(new TableModelListener() {
+ public void tableChanged(TableModelEvent e) {
+ detailPaneUpdater.setSelectedRow(table.getSelectedRow());
+ }
+ });
+
addPropertyChangeListener(
"detailPaneConversionPattern", detailPaneUpdater);
@@ -1562,6 +1566,7 @@
* and placing it inside it's own JFrame.
*/
void undock() {
+ int row = table.getSelectedRow();
setDocked(false);
externalPanel.removeAll();
findPanel.removeAll();
@@ -1577,6 +1582,9 @@
undockedFrame.setVisible(true);
dockingAction.putValue(Action.NAME, "Dock");
dockingAction.putValue(Action.SMALL_ICON, ChainsawIcons.ICON_DOCK);
+ if (row > -1) {
+ table.scrollToRow(row,
table.columnAtPoint(table.getVisibleRect().getLocation()));
+ }
}
/**
@@ -2046,6 +2054,8 @@
* inside the LogUI window.
*/
private void dock() {
+
+ int row = table.getSelectedRow();
setDocked(true);
undockedFrame.setVisible(false);
removeAll();
@@ -2054,6 +2064,9 @@
externalPanel.setDocked(true);
dockingAction.putValue(Action.NAME, "Undock");
dockingAction.putValue(Action.SMALL_ICON, ChainsawIcons.ICON_UNDOCK);
+ if (row > -1) {
+ table.scrollToRow(row,
table.columnAtPoint(table.getVisibleRect().getLocation()));
+ }
}
/**
@@ -2253,12 +2266,12 @@
}
SwingUtilities.invokeLater(
- new Runnable() {
- public void run() {
- repaint();
- }
- });
- }
+ new Runnable() {
+ public void run() {
+ repaint();
+ }
+ });
+ }
public JTextField getFindTextField() {
return findField;
1.103 +1 -0 logging-log4j/src/java/org/apache/log4j/chainsaw/LogUI.java
Index: LogUI.java
===================================================================
RCS file: /home/cvs/logging-log4j/src/java/org/apache/log4j/chainsaw/LogUI.java,v
retrieving revision 1.102
retrieving revision 1.103
diff -u -r1.102 -r1.103
--- LogUI.java 26 Jul 2004 07:39:31 -0000 1.102
+++ LogUI.java 28 Jul 2004 08:02:17 -0000 1.103
@@ -1803,6 +1803,7 @@
getPanelMap().put(logPanel.getIdentifier(), logPanel);
getTabbedPane().addANewTab(
logPanel.getIdentifier(), logPanel, null);
+
getTabbedPane().setSelectedTab(getTabbedPane().indexOfTab(logPanel.getIdentifier()));
} else {
getTabbedPane().remove(logPanel);
}
1.30 +2 -2
logging-log4j/src/java/org/apache/log4j/chainsaw/LoggerNameTreePanel.java
Index: LoggerNameTreePanel.java
===================================================================
RCS file:
/home/cvs/logging-log4j/src/java/org/apache/log4j/chainsaw/LoggerNameTreePanel.java,v
retrieving revision 1.29
retrieving revision 1.30
diff -u -r1.29 -r1.30
--- LoggerNameTreePanel.java 2 Jul 2004 05:49:27 -0000 1.29
+++ LoggerNameTreePanel.java 28 Jul 2004 08:02:17 -0000 1.30
@@ -1051,7 +1051,7 @@
if (result && isFocusOnSelected())
{
- result = result &&
(e.getLoggerName().startsWith(currentlySelectedLoggerName+".") ||
e.getLoggerName().endsWith(currentlySelectedLoggerName)) ;
+ result = result && (e.getLoggerName() != null &&
(e.getLoggerName().startsWith(currentlySelectedLoggerName+".") ||
e.getLoggerName().endsWith(currentlySelectedLoggerName))) ;
}
return result;
1.9 +8 -9
logging-log4j/src/java/org/apache/log4j/chainsaw/color/RuleColorizer.java
Index: RuleColorizer.java
===================================================================
RCS file:
/home/cvs/logging-log4j/src/java/org/apache/log4j/chainsaw/color/RuleColorizer.java,v
retrieving revision 1.8
retrieving revision 1.9
diff -u -r1.8 -r1.9
--- RuleColorizer.java 2 Jul 2004 05:49:27 -0000 1.8
+++ RuleColorizer.java 28 Jul 2004 08:02:17 -0000 1.9
@@ -16,22 +16,20 @@
package org.apache.log4j.chainsaw.color;
-import org.apache.log4j.rule.ColorRule;
-import org.apache.log4j.rule.ExpressionRule;
-import org.apache.log4j.rule.Rule;
-import org.apache.log4j.spi.LoggingEvent;
-
import java.awt.Color;
-
import java.beans.PropertyChangeListener;
import java.beans.PropertyChangeSupport;
-
import java.util.ArrayList;
import java.util.HashMap;
import java.util.Iterator;
import java.util.List;
import java.util.Map;
+import org.apache.log4j.rule.ColorRule;
+import org.apache.log4j.rule.ExpressionRule;
+import org.apache.log4j.rule.Rule;
+import org.apache.log4j.spi.LoggingEvent;
+
/**
* A colorizer supporting an ordered collection of ColorRules, including support
for notification of
@@ -84,7 +82,7 @@
this.rules = rules;
colorChangeSupport.firePropertyChange("colorrule", false, true);
}
-
+
public Map getRules() {
return rules;
}
@@ -119,6 +117,7 @@
public void clear() {
rules.clear();
+ colorChangeSupport.firePropertyChange("colorrule", false, true);
}
public void removeRule(String ruleSetName, String expression) {
@@ -190,7 +189,7 @@
return null;
}
-
+
public void addPropertyChangeListener(PropertyChangeListener listener) {
colorChangeSupport.addPropertyChangeListener(listener);
}
1.15 +10 -0
logging-log4j/src/java/org/apache/log4j/chainsaw/color/ColorPanel.java
Index: ColorPanel.java
===================================================================
RCS file:
/home/cvs/logging-log4j/src/java/org/apache/log4j/chainsaw/color/ColorPanel.java,v
retrieving revision 1.14
retrieving revision 1.15
diff -u -r1.14 -r1.15
--- ColorPanel.java 27 Feb 2004 16:47:31 -0000 1.14
+++ ColorPanel.java 28 Jul 2004 08:02:18 -0000 1.15
@@ -27,6 +27,8 @@
import java.awt.event.ActionListener;
import java.awt.event.ItemEvent;
import java.awt.event.ItemListener;
+import java.beans.PropertyChangeEvent;
+import java.beans.PropertyChangeListener;
import java.util.ArrayList;
import java.util.HashMap;
import java.util.Iterator;
@@ -96,6 +98,14 @@
this.colorizer = colorizer;
this.filterModel = filterModel;
+
+ colorizer.addPropertyChangeListener(
+ "colorrule",
+ new PropertyChangeListener() {
+ public void propertyChange(PropertyChangeEvent evt) {
+ updateColors();
+ }
+ });
tableModel = new DefaultTableModel();
table = new JTable(tableModel);
1.37 +6 -0
logging-log4j/src/java/org/apache/log4j/chainsaw/help/release-notes.html
Index: release-notes.html
===================================================================
RCS file:
/home/cvs/logging-log4j/src/java/org/apache/log4j/chainsaw/help/release-notes.html,v
retrieving revision 1.36
retrieving revision 1.37
diff -u -r1.36 -r1.37
--- release-notes.html 27 Jul 2004 07:06:59 -0000 1.36
+++ release-notes.html 28 Jul 2004 08:02:18 -0000 1.37
@@ -8,6 +8,12 @@
<h1>Release Notes</h2>
<h1>1.99.99</h2>
+<h2>28 July 2004</h2>
+<ul>
+<li>Corrected row selection and detail pane synchronization bugs related selection
of nodes in the logger tree and docking/undocking.</li>
+<li>Dock now re-selects the docked tab.</li>
+</ul>
+
<h2>26 July 2004</h2>
<ul>
<li>Tab settings file names are now URL encoded. In order to preserve the
usefulness of existing settings files, if the URL-encoded files don't exist, Chainsaw
will attempt to load the tab's non-URL-encoded files.</li>
---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]