cvs commit: jakarta-log4j/src/java/org/apache/log4j/chainsaw/plugins ChainsawCentral.java

2003-12-31 Thread psmith
psmith  2003/12/30 23:00:11

  Added:   src/java/org/apache/log4j/chainsaw/plugins
ChainsawCentral.java
  Log:
  Very rough check-in, but hopefully you can see where I am headed.
  
  This plugin will have a graph window of the rate of events arriving in the
  top right hand corner. (if you have seen GetRight's data transfer graph,
  that is idea I am borrowing).
  
  The message center is now within this panel.
  
  Revision  ChangesPath
  1.1  
jakarta-log4j/src/java/org/apache/log4j/chainsaw/plugins/ChainsawCentral.java
  
  Index: ChainsawCentral.java
  ===
  /*
   * 
   *   The Apache Software License, Version 1.1
   * 
   *
   *Copyright (C) 1999 The Apache Software Foundation. All rights reserved.
   *
   * Redistribution and use in source and binary forms, with or without modifica-
   * tion, are permitted provided that the following conditions are met:
   *
   * 1. Redistributions of  source code must  retain the above copyright  notice,
   *this list of conditions and the following disclaimer.
   *
   * 2. Redistributions in binary form must reproduce the above copyright notice,
   *this list of conditions and the following disclaimer in the documentation
   *and/or other materials provided with the distribution.
   *
   * 3. The end-user documentation included with the redistribution, if any, must
   *include  the following  acknowledgment:  "This product includes  software
   *developed  by the  Apache Software Foundation  (http://www.apache.org/)."
   *Alternately, this  acknowledgment may  appear in the software itself,  if
   *and wherever such third-party acknowledgments normally appear.
   *
   * 4. The names "log4j" and  "Apache Software Foundation"  must not be used to
   *endorse  or promote  products derived  from this  software without  prior
   *written permission. For written permission, please contact
   *[EMAIL PROTECTED]
   *
   * 5. Products  derived from this software may not  be called "Apache", nor may
   *"Apache" appear  in their name,  without prior written permission  of the
   *Apache Software Foundation.
   *
   * THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESSED OR IMPLIED WARRANTIES,
   * INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND
   * FITNESS  FOR A PARTICULAR  PURPOSE ARE  DISCLAIMED.  IN NO  EVENT SHALL  THE
   * APACHE SOFTWARE  FOUNDATION  OR ITS CONTRIBUTORS  BE LIABLE FOR  ANY DIRECT,
   * INDIRECT, INCIDENTAL, SPECIAL,  EXEMPLARY, OR CONSEQUENTIAL  DAMAGES (INCLU-
   * DING, BUT NOT LIMITED TO, PROCUREMENT  OF SUBSTITUTE GOODS OR SERVICES; LOSS
   * OF USE, DATA, OR  PROFITS; OR BUSINESS  INTERRUPTION)  HOWEVER CAUSED AND ON
   * ANY  THEORY OF LIABILITY,  WHETHER  IN CONTRACT,  STRICT LIABILITY,  OR TORT
   * (INCLUDING  NEGLIGENCE OR  OTHERWISE) ARISING IN  ANY WAY OUT OF THE  USE OF
   * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
   *
   * This software  consists of voluntary contributions made  by many individuals
   * on  behalf of the Apache Software  Foundation.  For more  information on the
   * Apache Software Foundation, please see .
   *
   */
  
  package org.apache.log4j.chainsaw.plugins;
  
  import org.apache.log4j.Appender;
  import org.apache.log4j.chainsaw.ChainsawAppenderHandler;
  import org.apache.log4j.chainsaw.messages.MessageCenter;
  import org.apache.log4j.helpers.LogLog;
  
  import java.awt.BorderLayout;
  import java.awt.Color;
  import java.awt.GridLayout;
  
  import java.beans.PropertyChangeEvent;
  import java.beans.PropertyChangeListener;
  
  import java.text.NumberFormat;
  
  import java.util.Enumeration;
  import java.util.LinkedList;
  
  import javax.swing.BorderFactory;
  import javax.swing.JComponent;
  import javax.swing.JLabel;
  import javax.swing.JPanel;
  import javax.swing.SwingUtilities;
  
  
  /**
   * @author Paul Smith <[EMAIL PROTECTED]>
   */
  public class ChainsawCentral extends GUIPluginSkeleton {
private final JLabel dataRateLabel = new JLabel();
private final NumberFormat nf = NumberFormat.getNumberInstance();
private ChainsawAppenderHandler handler;
private LinkedList dataRateModel = new LinkedList();
  
/**
 *
 */
public ChainsawCentral() {
  super();
  setName("ChainsawCentral");
  initComponents();
}
  
/* (non-Javadoc)
 * @see org.apache.log4j.plugins.Plugin#shutdown()
 */
public void shutdown() {
  // TODO Auto-generated method stub
}
  
/* (non-Javadoc)
 * @see org.apache.log4j.spi.OptionHandler#activateOptions()
 */
public void activateOptions() {
  Enumeration enumeration =
getLogg

cvs commit: jakarta-log4j/src/java/org/apache/log4j/chainsaw LogUI.java

2003-12-31 Thread psmith
psmith  2003/12/30 23:03:34

  Modified:src/java/org/apache/log4j/chainsaw LogUI.java
  Log:
  moved some code within the acivation area into new methods.
  
  added the ChainsawCentral as a hard coded plugin for now.
  
  Revision  ChangesPath
  1.66  +170 -150  jakarta-log4j/src/java/org/apache/log4j/chainsaw/LogUI.java
  
  Index: LogUI.java
  ===
  RCS file: /home/cvs/jakarta-log4j/src/java/org/apache/log4j/chainsaw/LogUI.java,v
  retrieving revision 1.65
  retrieving revision 1.66
  diff -u -r1.65 -r1.66
  --- LogUI.java23 Dec 2003 02:18:40 -  1.65
  +++ LogUI.java31 Dec 2003 07:03:34 -  1.66
  @@ -109,7 +109,6 @@
   import org.apache.log4j.AppenderSkeleton;
   import org.apache.log4j.Level;
   import org.apache.log4j.LogManager;
  -import org.apache.log4j.Logger;
   import org.apache.log4j.Priority;
   import org.apache.log4j.UtilLoggingLevel;
   import org.apache.log4j.chainsaw.help.HelpManager;
  @@ -117,6 +116,7 @@
   import org.apache.log4j.chainsaw.helper.SwingHelper;
   import org.apache.log4j.chainsaw.icons.ChainsawIcons;
   import org.apache.log4j.chainsaw.messages.MessageCenter;
  +import org.apache.log4j.chainsaw.plugins.ChainsawCentral;
   import org.apache.log4j.chainsaw.prefs.LoadSettingsEvent;
   import org.apache.log4j.chainsaw.prefs.SaveSettingsEvent;
   import org.apache.log4j.chainsaw.prefs.SettingsListener;
  @@ -155,7 +155,6 @@
*
*/
   public class LogUI extends JFrame implements ChainsawViewer, SettingsListener {
  -  private static final Logger messageLogger = 
Logger.getLogger(MessageCenter.getInstance().getClass());
 private static final String CONFIG_FILE_TO_USE = "config.file";
 static final String USE_CYCLIC_BUFFER_PROP_NAME = "chainsaw.usecyclicbuffer";
 static final String CYCLIC_BUFFER_SIZE_PROP_NAME =
  @@ -278,7 +277,7 @@
   
   applyLookAndFeel(model.getLookAndFeelClassName());
   
  -createChainsawGUI(model, null);
  +createChainsawGUI(model, true, null);
 }
   
 /**
  @@ -291,10 +290,10 @@
  *DOCUMENT ME!
  */
 public static void createChainsawGUI(ApplicationPreferenceModel model,
  -Action shutdownAction) {
  +boolean showSplash, Action shutdownAction) {
   LogUI logUI = new LogUI();
   
  -if (model.isShowSplash()) {
  +if (showSplash) {
 showSplash(logUI);
   }
   
  @@ -337,6 +336,8 @@
   setJMenuBar(getToolBarAndMenus().getMenubar());
   setTabbedPane(new ChainsawTabbedPane());
   
  +
  +
   applicationPreferenceModelPanel.setOkCancelActionListener(
   new ActionListener() {
 public void actionPerformed(ActionEvent e) {
  @@ -346,12 +347,32 @@
   
 }
   
  +  private void initPlugins() {
  +PluginRegistry.addPluginListener(new PluginListener() {
  +
  +  public void pluginStarted(PluginEvent e) {
  +if (e.getPlugin() instanceof JComponent) {
  +  JComponent plugin = (JComponent) e.getPlugin();
  +  getTabbedPane().addANewTab(plugin.getName(), plugin, null, null);
  +}
  +  }
  +
  +  public void pluginStopped(PluginEvent e) {
  +//TODO remove the plugin from the gui
  +  }});
  +
  +
  +// TODO this should all be in a config file
  +ChainsawCentral cc = new ChainsawCentral();
  +PluginRegistry.startPlugin(cc);
  +  }
  +
 private void setupReceiverPanel() {
   receiversPanel = new ReceiversPanel();
   receiversPanel.addPropertyChangeListener("visible", new 
PropertyChangeListener() {
   
 public void propertyChange(PropertyChangeEvent evt) {
  -messageLogger.debug("Receiver's panel:" + evt.getNewValue());
  +MessageCenter.getInstance().getLogger().debug("Receiver's panel:" + 
evt.getNewValue());
 
getApplicationPreferenceModel().setReceivers(((Boolean)evt.getNewValue()).booleanValue());
 }});
 }
  @@ -448,67 +469,13 @@
 public void activateViewer() {
   initGUI();
   
  -applicationPreferenceModel.addPropertyChangeListener("identifierExpression", 
new PropertyChangeListener() {
  - public void propertyChange(PropertyChangeEvent evt) {
  - handler.setIdentifierExpression(evt.getNewValue().toString());
  - }
  - } );
  -applicationPreferenceModel.addPropertyChangeListener("responsiveness", new 
PropertyChangeListener() {
  -  public void propertyChange(PropertyChangeEvent evt) {
  -int value = ((Integer)evt.getNewValue()).intValue();
  -handler.setQueueInterval((value*1000)-750);
  -  }
  -} );
  -
  -applicationPreferenceModel.addPropertyChangeListener("tabPlacement", new 
PropertyChangeListener() {
  -
  -  public void propertyChange(final PropertyChangeEvent evt) {
  -SwingUtilities.invokeLater(new Runnable() {
  -
  -  public void run() {
 

cvs commit: jakarta-log4j/src/java/org/apache/log4j/chainsaw ChainsawStatusBar.java

2003-12-31 Thread psmith
psmith  2003/12/30 23:04:03

  Modified:src/java/org/apache/log4j/chainsaw/messages
MessageCenter.java
   src/java/org/apache/log4j/chainsaw ChainsawStatusBar.java
  Log:
  Removed the Message Center from being accessed via the status bar.
  
  Revision  ChangesPath
  1.3   +22 -44
jakarta-log4j/src/java/org/apache/log4j/chainsaw/messages/MessageCenter.java
  
  Index: MessageCenter.java
  ===
  RCS file: 
/home/cvs/jakarta-log4j/src/java/org/apache/log4j/chainsaw/messages/MessageCenter.java,v
  retrieving revision 1.2
  retrieving revision 1.3
  diff -u -r1.2 -r1.3
  --- MessageCenter.java20 Dec 2003 04:54:20 -  1.2
  +++ MessageCenter.java31 Dec 2003 07:04:03 -  1.3
  @@ -49,19 +49,9 @@
   
   package org.apache.log4j.chainsaw.messages;
   
  -import org.apache.log4j.Layout;
  -import org.apache.log4j.Level;
  -import org.apache.log4j.Logger;
  -import org.apache.log4j.TTCCLayout;
  -import org.apache.log4j.chainsaw.ChainsawConstants;
  -import org.apache.log4j.chainsaw.PopupListener;
  -import org.apache.log4j.chainsaw.icons.ChainsawIcons;
  -import org.apache.log4j.spi.LoggingEvent;
  -
   import java.awt.BorderLayout;
   import java.awt.Component;
   import java.awt.event.ActionEvent;
  -
   import java.beans.PropertyChangeEvent;
   import java.beans.PropertyChangeListener;
   import java.beans.PropertyChangeSupport;
  @@ -71,8 +61,9 @@
   import javax.swing.DefaultListCellRenderer;
   import javax.swing.ImageIcon;
   import javax.swing.JButton;
  -import javax.swing.JFrame;
  +import javax.swing.JComponent;
   import javax.swing.JList;
  +import javax.swing.JPanel;
   import javax.swing.JPopupMenu;
   import javax.swing.JScrollPane;
   import javax.swing.JToolBar;
  @@ -81,6 +72,16 @@
   import javax.swing.event.ListDataEvent;
   import javax.swing.event.ListDataListener;
   
  +import org.apache.log4j.Layout;
  +import org.apache.log4j.Level;
  +import org.apache.log4j.Logger;
  +import org.apache.log4j.TTCCLayout;
  +import org.apache.log4j.chainsaw.ChainsawConstants;
  +import org.apache.log4j.chainsaw.PopupListener;
  +import org.apache.log4j.chainsaw.SmallButton;
  +import org.apache.log4j.chainsaw.icons.ChainsawIcons;
  +import org.apache.log4j.spi.LoggingEvent;
  +
   
   /**
* The MessageCenter is central place for all elements within Chainsaw to
  @@ -109,19 +110,18 @@
 private final MessageCenterAppender appender = new MessageCenterAppender();
 private ListCellRenderer listCellRenderer =
   new LayoutListCellRenderer(layout);
  -  private boolean visible;
 private PropertyChangeSupport propertySupport =
   new PropertyChangeSupport(this);
  -  private JFrame window = new JFrame("Message Center");
 private JScrollPane pane = new JScrollPane(messageList);
 private final JToolBar toolbar = new JToolBar();
 private JPopupMenu popupMenu = new JPopupMenu();
 private PopupListener popupListener = new PopupListener(popupMenu);
 private Action clearAction;
  +  private final JPanel componentPanel = new JPanel(new BorderLayout());
   
 private MessageCenter() {
   setupActions();
  -setupFrame();
  +setupComponentPanel();
   setupLogger();
   setupListeners();
   setupPopMenu();
  @@ -139,7 +139,7 @@
  *
  */
 private void setupToolbar() {
  -JButton clearButton = new JButton(clearAction);
  +JButton clearButton = new SmallButton(clearAction);
   clearButton.setText(null);
   toolbar.add(clearButton);
   
  @@ -159,15 +159,6 @@
   
 private void setupListeners() {
   propertySupport.addPropertyChangeListener(
  -  "visible",
  -  new PropertyChangeListener() {
  -public void propertyChange(PropertyChangeEvent evt) {
  -  boolean value = ((Boolean) evt.getNewValue()).booleanValue();
  -  window.setVisible(value);
  -}
  -  });
  -
  -propertySupport.addPropertyChangeListener(
 "layout",
 new PropertyChangeListener() {
   public void propertyChange(PropertyChangeEvent evt) {
  @@ -208,17 +199,16 @@
   logger.setLevel(Level.DEBUG);
 }
   
  -  private void setupFrame() {
  -window.getContentPane().setLayout(new BorderLayout());
  -
  +  private void setupComponentPanel() {
   messageList.setModel(appender.getModel());
   messageList.setCellRenderer(listCellRenderer);
   
  -window.getContentPane().add(pane, BorderLayout.CENTER);
  -window.getContentPane().add(toolbar, BorderLayout.NORTH);
  -
  -window.setSize(480, 240);
  -window.setIconImage(new ImageIcon(ChainsawIcons.WINDOW_ICON).getImage());
  +componentPanel.add(this.toolbar, BorderLayout.NORTH);
  +componentPanel.add(this.pane, BorderLayout.CENTER);
  +  }
  +  
  +  public final JComponent getGUIComponent() {
  +return componentPanel;
 }
   
 public ListModel getMo

cvs commit: jakarta-log4j/src/java/org/apache/log4j/chainsaw LogUI.java

2003-12-31 Thread psmith
psmith  2003/12/30 23:05:33

  Modified:src/java/org/apache/log4j/chainsaw LogUI.java
  Log:
  mangled a merge, this fixes it.
  
  Revision  ChangesPath
  1.67  +3 -3  jakarta-log4j/src/java/org/apache/log4j/chainsaw/LogUI.java
  
  Index: LogUI.java
  ===
  RCS file: /home/cvs/jakarta-log4j/src/java/org/apache/log4j/chainsaw/LogUI.java,v
  retrieving revision 1.66
  retrieving revision 1.67
  diff -u -r1.66 -r1.67
  --- LogUI.java31 Dec 2003 07:03:34 -  1.66
  +++ LogUI.java31 Dec 2003 07:05:33 -  1.67
  @@ -277,7 +277,7 @@
   
   applyLookAndFeel(model.getLookAndFeelClassName());
   
  -createChainsawGUI(model, true, null);
  +createChainsawGUI(model, null);
 }
   
 /**
  @@ -290,10 +290,10 @@
  *DOCUMENT ME!
  */
 public static void createChainsawGUI(ApplicationPreferenceModel model,
  -boolean showSplash, Action shutdownAction) {
  +Action shutdownAction) {
   LogUI logUI = new LogUI();
   
  -if (showSplash) {
  +if (model.isShowSplash()) {
 showSplash(logUI);
   }
   
  
  
  

-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]



cvs commit: logging-log4j/src/java/org/apache/log4j/chainsaw/prefs default.properties

2003-12-31 Thread sdeboy
sdeboy  2003/12/31 01:54:40

  Modified:src/java/org/apache/log4j/chainsaw
ChainsawCyclicBufferTableModel.java LogUI.java
LogPanel.java TableColorizingRenderer.java
JSortTable.java
ApplicationPreferenceModelPanel.java
ApplicationPreferenceModel.java
ChainsawAppenderHandler.java
   src/java/org/apache/log4j/rule ColorRule.java
PartialTextMatchRule.java LevelInequalityRule.java
ExpressionRuleContext.java EqualsRule.java
NotEqualsRule.java InequalityRule.java
ExistsRule.java LikeRule.java
   src/java/org/apache/log4j/chainsaw/prefs default.properties
  Added:   src/java/org/apache/log4j/spi LoggingEventFieldResolver.java
  Removed: src/java/org/apache/log4j/chainsaw
LoggingEventFieldResolver.java
  Log:
  - added tooltip duration application-level preference
  - modified tooltip logic - if tooltips are not enabled and icons are shown for 
levels, the icon's value is displayed.  if tooltips are displayed, the normal tooltip 
is displayed when the mouse is over the level icon
  - updated row selection code to prevent unnecessary 'blinking' of selection
  - updated detailpane update logic to ensure detail pane was staying in sync with 
selection
  - removed unneeded default property, added default tooltip duration (4000 ms) and 
changed default responsiveness to 3
  - moved loggingeventfieldresolver to spi package
  - modified cyclicbuffertablemodel to remove unneeded variables and fix a bug where 
it was always iterating through mdc keyset
  - fixed bug where as new events were received, if scrolltobottom was off and you 
scrolled, the display was always shifting back to the selected row
  - removed unused parameter in logpanel constructor
  
  Revision  ChangesPath
  1.15  +18 -39
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.14
  retrieving revision 1.15
  diff -u -r1.14 -r1.15
  --- ChainsawCyclicBufferTableModel.java   14 Dec 2003 20:35:09 -  1.14
  +++ ChainsawCyclicBufferTableModel.java   31 Dec 2003 09:54:40 -  1.15
  @@ -211,16 +211,14 @@
*/
 public void sort() {
   if (sortEnabled) {
  -  int size = 0;
   
 synchronized (filteredList) {
  -size = filteredList.size();
   Collections.sort(
 filteredList,
 new ColumnComparator(currentSortColumn, currentSortAscending));
 }
   
  -  fireTableRowsUpdated(0, size);
  +  fireTableDataChanged();
   }
 }
   
  @@ -410,7 +408,6 @@
 public boolean isAddRow(LoggingEvent e, boolean valueIsAdjusting) {
   boolean rowAdded = false;
   
  -int newRow = 0;
   Object id = e.getProperty(ChainsawConstants.LOG4J_ID_KEY);
   
   if (id == null) {
  @@ -424,20 +421,13 @@
   }
   idSet.add(id);
   unfilteredList.add(e);
  -
   rowAdded = true;
   
   if ((displayRule == null) || (displayRule.evaluate(e))) {
 synchronized (filteredList) {
   filteredList.add(e);
  -newRow = filteredList.size() - 1;
  +fireTableRowsInserted(filteredList.size(),filteredList.size());
 }
  -
  -  rowAdded = true;
  -}
  -
  -if (!valueIsAdjusting) {
  -  notifyCountListeners();
   }
   
   /**
  @@ -445,32 +435,21 @@
*/
   boolean newColumn = uniqueMDCKeys.addAll(e.getMDCKeySet());
   
  -/**
  - * If so, we should add them as columns and notify listeners.
  - */
  -for (Iterator iter = e.getMDCKeySet().iterator(); iter.hasNext();) {
  -  Object key = iter.next();
  -
  -  if (!columnNames.contains(key)) {
  -columnNames.add(key);
  -LogLog.debug("Adding col '" + key + "', columNames=" + columnNames);
  -fireNewKeyColumnAdded(
  -  new NewKeyEvent(
  -this, columnNames.indexOf(key), key, e.getMDC(key.toString(;
  -  }
  -}
  -
  -if (!isCyclic() && !newColumn) {
  -  fireTableRowsInserted(newRow, newRow);
  -} else {
  -  if (
  -newColumn
  -  || (unfilteredList.size() == ((CyclicBufferList) unfilteredList)
  -  .getMaxSize())) {
  -fireTableDataChanged();
  -  } else {
  -fireTableRowsInserted(newRow, newRow);
  -  }
  +if (newColumn) {
  +/**
  + * If so, we should add them as columns and notify listeners.
  + */
  +for (Iterator iter = e.getMDCKeySet().iterator(); iter.hasNext();) {
  + 

cvs commit: logging-log4j/src/java/org/apache/log4j/rule AbstractRule.java

2003-12-31 Thread sdeboy
sdeboy  2003/12/31 02:03:26

  Modified:src/java/org/apache/log4j/rule AbstractRule.java
  Log:
  added serialversionuid
  
  Revision  ChangesPath
  1.2   +2 -1  logging-log4j/src/java/org/apache/log4j/rule/AbstractRule.java
  
  Index: AbstractRule.java
  ===
  RCS file: /home/cvs/logging-log4j/src/java/org/apache/log4j/rule/AbstractRule.java,v
  retrieving revision 1.1
  retrieving revision 1.2
  diff -u -r1.1 -r1.2
  --- AbstractRule.java 14 Dec 2003 20:35:08 -  1.1
  +++ AbstractRule.java 31 Dec 2003 10:03:26 -  1.2
  @@ -62,7 +62,8 @@
* @author Scott Deboy <[EMAIL PROTECTED]>
*/
   public abstract class AbstractRule implements Rule, Serializable {
  -
  +  static final long serialVersionUID = -2844288145563025172L;
  +  
 private PropertyChangeSupport propertySupport =
   new PropertyChangeSupport(this);
   
  
  
  

-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]



cvs commit: logging-log4j/src/java/org/apache/log4j/chainsaw LogPanel.java LogUI.java FileMenu.java

2003-12-31 Thread sdeboy
sdeboy  2003/12/31 11:31:16

  Modified:src/java/org/apache/log4j/chainsaw LogPanel.java LogUI.java
FileMenu.java
  Log:
  - updated status bar code to correctly display selected row
  - 'new event' and 'existing event' icons display logic for full cyclic buffer
  - logger tree panel now following stored preference on app start
  - removed unused methods and members
  
  Revision  ChangesPath
  1.45  +17 -17logging-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.44
  retrieving revision 1.45
  diff -u -r1.44 -r1.45
  --- LogPanel.java 31 Dec 2003 09:54:40 -  1.44
  +++ LogPanel.java 31 Dec 2003 19:31:16 -  1.45
  @@ -279,7 +279,6 @@
   }
   });
   
  -detailPanel.setVisible(getPreferenceModel().isDetailPaneVisible());
   detailPanel.setPreferredSize(new Dimension(320, 160));
   
   preferenceModel.addPropertyChangeListener("logTreePanelVisible",
  @@ -411,7 +410,6 @@
   tableModel.setDisplayRule(ruleMediator);
   
   logTreePanel = new LoggerNameTreePanel(logTreeModel);
  -
   /**
* Set the LoggerRule to be the LoggerTreePanel, as this visual component
* is a rule itself, and the RuleMediator will automatically listen
  @@ -701,16 +699,18 @@
   lowerPanel.setBorder(null);
   lowerPanel.setContinuousLayout(true);
   
  -lowerPanel.setOneTouchExpandable(true);
  +detailPanel.setVisible(getPreferenceModel().isDetailPaneVisible());
  +
lowerPanel.setOneTouchExpandable(getPreferenceModel().isDetailPaneVisible());
   
   nameTreeAndMainPanelSplit = new JSplitPane(JSplitPane.HORIZONTAL_SPLIT);
   nameTreeAndMainPanelSplit.add(logTreePanel);
   nameTreeAndMainPanelSplit.add(lowerPanel);
  -nameTreeAndMainPanelSplit.setOneTouchExpandable(true);
   nameTreeAndMainPanelSplit.setToolTipText("Still under development");
   nameTreeAndMainPanelSplit.setDividerLocation(-1);
   
   add(nameTreeAndMainPanelSplit, BorderLayout.CENTER);
  +nameTreeAndMainPanelSplit.setOneTouchExpandable(isLogTreePanelVisible());
  +logTreePanel.setVisible(isLogTreePanelVisible());
   
   /**
* This listener deals with when the user hides the LogPanel,
  @@ -1013,7 +1013,7 @@
   tableModel.addEventCountListener(new EventCountListener() {
   public void eventCountChanged(int currentCount, int totalCount) {
   if (LogPanel.this.isVisible()) {
  -statusBar.setSelectedLine(0, currentCount, totalCount);
  +statusBar.setSelectedLine(table.getSelectedRow()+1, 
currentCount, totalCount);
   }
   }
   });
  @@ -1297,7 +1297,7 @@
   String getIdentifier() {
   return identifier;
   }
  -
  +
   void clearModel() {
   tableModel.clearModel();
   
  @@ -1697,7 +1697,7 @@
   /* (non-Javadoc)
* @see 
org.apache.log4j.chainsaw.EventBatchListener#receiveEventBatch(java.lang.String, 
java.util.List)
*/
  -public void receiveEventBatch(String identifier, List eventBatchEntrys) {
  +public void receiveEventBatch(String ident, List eventBatchEntrys) {
   /**
* if this panel is paused, we totally ignore events
*/
  @@ -2107,27 +2107,27 @@
   }
   
   class ScrollToBottom  {
  -boolean scrollToBottom;
  -boolean bypassed;
  +boolean scroll;
  +boolean bypass;
   
  -public ScrollToBottom(boolean scrollToBottom) {
  -this.scrollToBottom = scrollToBottom;
  +public ScrollToBottom(boolean scrollBottom) {
  +scroll = scrollBottom;
   }
   
  -public void scroll(boolean scrollToBottom) {
  -this.scrollToBottom = scrollToBottom;
  +public void scroll(boolean scrollBottom) {
  +scroll = scrollBottom;
   }
   
   public boolean isScrolled() {
  -return scrollToBottom;
  +return scroll;
   }
   
  -public void bypass(boolean bypassed) {
  -this.bypassed = bypassed;
  +public void bypass(boolean bypassScroll) {
  +bypass = bypassScroll;
   }
   
   public boolean isBypassed() {
  -return bypassed;
  +return bypass;
   }
   }
   }
  
  
  
  1.69  +12 -62logging-log4j/src/java/org/apache/log4j/chainsaw/LogUI.java
  
  Index: LogUI.java
  ===
  RCS file: /home/cvs/logging-log4j/src/java/org/apache/log4j/chai

cvs commit: logging-log4j/src/java/org/apache/log4j/chainsaw/color ColorPanel.java

2003-12-31 Thread sdeboy
sdeboy  2003/12/31 16:36:10

  Modified:src/java/org/apache/log4j/chainsaw
ChainsawCyclicBufferTableModel.java
ChainsawStatusBar.java
   src/java/org/apache/log4j/chainsaw/color ColorPanel.java
  Log:
  - fixed cyclictablemodel so it will use the 'CHAINSAW_CAPACITY' system property and 
correctly size the capacity.  Will move to a normal pref next.
  - sized status bar so it will hold 99k without truncating
  
  Revision  ChangesPath
  1.16  +4 -2  
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.15
  retrieving revision 1.16
  diff -u -r1.15 -r1.16
  --- ChainsawCyclicBufferTableModel.java   31 Dec 2003 09:54:40 -  1.15
  +++ ChainsawCyclicBufferTableModel.java   1 Jan 2004 00:36:10 -   1.16
  @@ -92,8 +92,8 @@
 private final int DEFAULT_CAPACITY = 5000;
 private int capacity = DEFAULT_CAPACITY;
 private static final String PANEL_CAPACITY = "CHAINSAW_CAPACITY";
  -  List unfilteredList = new CyclicBufferList(capacity);
  -  List filteredList = new CyclicBufferList(capacity);
  +  List unfilteredList;
  +  List filteredList;
 Set idSet = new HashSet(capacity);
 private boolean currentSortAscending;
 private int currentSortColumn;
  @@ -122,6 +122,8 @@
   capacity = Integer.parseInt(System.getProperty(PANEL_CAPACITY));
   } catch (NumberFormatException nfe) {}
   }
  +unfilteredList = new CyclicBufferList(capacity);
  +filteredList = new CyclicBufferList(capacity);
 }
   
 /**
  
  
  
  1.10  +1 -5  
logging-log4j/src/java/org/apache/log4j/chainsaw/ChainsawStatusBar.java
  
  Index: ChainsawStatusBar.java
  ===
  RCS file: 
/home/cvs/logging-log4j/src/java/org/apache/log4j/chainsaw/ChainsawStatusBar.java,v
  retrieving revision 1.9
  retrieving revision 1.10
  diff -u -r1.9 -r1.10
  --- ChainsawStatusBar.java31 Dec 2003 07:04:03 -  1.9
  +++ ChainsawStatusBar.java1 Jan 2004 00:36:10 -   1.10
  @@ -84,12 +84,9 @@
 private final JLabel eventCountLabel = new JLabel("", JLabel.CENTER);
 private final JLabel receivedEventLabel = new JLabel("0.0", JLabel.CENTER);
 private final JLabel receivedConnectionlabel = new JLabel("", JLabel.CENTER);
  -  private volatile long lastReceivedEvent = System.currentTimeMillis();
 private volatile long lastReceivedConnection = System.currentTimeMillis();
 private final Thread connectionThread;
 private final Icon pausedIcon = new ImageIcon(ChainsawIcons.PAUSE);
  -  private final Icon radioTowerIcon =
  -new ImageIcon(ChainsawIcons.ANIM_RADIO_TOWER);
 private final Icon netConnectIcon =
   new ImageIcon(ChainsawIcons.ANIM_NET_CONNECT);
 private final NumberFormat nf = NumberFormat.getNumberInstance();
  @@ -105,7 +102,6 @@
   
   JPanel statusMsgPanel = new JPanel(new FlowLayout(FlowLayout.LEFT, 2, 2));
   
  -
   statusMsgPanel.add(statusMsg);
   statusMsgPanel.setBorder(statusBarComponentBorder);
   
  @@ -130,7 +126,7 @@
eventCountLabel.setMinimumSize(
new Dimension(
eventCountLabel.getFontMetrics(eventCountLabel.getFont())
  - .stringWidth(":") + 5,
  + .stringWidth("9:9") + 5,
  (int) eventCountLabel.getPreferredSize().getHeight()));
  
   receivedConnectionlabel.setBorder(statusBarComponentBorder);
  
  
  
  1.12  +4 -4  
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.11
  retrieving revision 1.12
  diff -u -r1.11 -r1.12
  --- ColorPanel.java   16 Dec 2003 00:45:26 -  1.11
  +++ ColorPanel.java   1 Jan 2004 00:36:10 -   1.12
  @@ -147,10 +147,10 @@
   tableModel.setDataVector(data, columns);
   
   table.sizeColumnsToFit(0);
  -table.getColumnModel().getColumn(1).setPreferredWidth(70);
  -table.getColumnModel().getColumn(2).setPreferredWidth(70);
  -table.getColumnModel().getColumn(1).setMaxWidth(70);
  -table.getColumnModel().getColumn(2).setMaxWidth(70);
  +table.getColumnModel().getColumn(1).setPreferredWidth(80);
  +table.getColumnModel().getColumn(2).setPreferredWidth(80);
  +table.getColumnModel().getColumn(1).setMaxWidth(80);
  +table.getColumnModel().getColumn(2).setMaxWidth(80);
   
   configureTable();