sdeboy      2004/05/21 22:26:12

  Modified:    src/java/org/apache/log4j/chainsaw LogPanel.java
               src/java/org/apache/log4j/chainsaw/help release-notes.html
  Log:
  Changed how 'scroll to bottom' is activated and deactivated.  

  Now, scrolling occurs only if 'scroll to bottom' is selected in the context menu AND 
the last row is selected.  

  To deactivate scrolling, select a row other than last row.  To re-activate 
scrolling, press ctrl-end to select the last row.  

  (Scrolling is bypassed in two cases: when a find is active, or when the bottom row 
is not selected as described above.)  

  Scrolling enhancement suggested by Hani.

  
  Revision  Changes    Path
  1.73      +12 -4     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.72
  retrieving revision 1.73
  diff -u -r1.72 -r1.73
  --- LogPanel.java     17 May 2004 06:17:59 -0000      1.72
  +++ LogPanel.java     22 May 2004 05:26:12 -0000      1.73
  @@ -210,7 +210,8 @@
     private double lastDetailPanelSplitLocation = DEFAULT_DETAIL_SPLIT_LOCATION;
     private double lastLogTreePanelSplitLocation =
       DEFAULT_LOG_TREE_SPLIT_LOCATION;
  -  private boolean bypassScroll;
  +  private boolean bypassScrollFind;
  +  private boolean bypassScrollSelection;
     private Point currentPoint;
     private boolean scroll;
     private boolean paused = false;
  @@ -222,6 +223,7 @@
     static final String TABLE_COLUMN_WIDTHS = "table.columns.widths";
     static final String COLUMNS_EXTENSION = ".columns";
     static final String COLORS_EXTENSION = ".colors";
  +  private int previousSelectedIndex = -1;
   
     /**
      * Creates a new LogPanel object.  If a LogPanel with this identifier has
  @@ -703,6 +705,12 @@
                 && (evt.getFirstIndex() > 0)) || (evt.getValueIsAdjusting())) {
               return;
             }
  +          if (previousSelectedIndex > -1) {
  +                bypassScrollSelection = (!bypassScrollSelection && 
(evt.getLastIndex() == (table.getRowCount() - 1)) 
  +                &&
  +                (!((previousSelectedIndex == evt.getFirstIndex()) && 
(evt.getLastIndex() == (table.getRowCount() - 1)))));
  +          }
  +          previousSelectedIndex = evt.getLastIndex();
   
             final ListSelectionModel lsm = (ListSelectionModel) evt.getSource();
   
  @@ -1327,7 +1335,7 @@
         tableModel.fireTableEvent(
           first, tableModel.getLastAdded(), eventBatchEntrys.size());
   
  -      if (scroll && !bypassScroll) {
  +      if (scroll && !bypassScrollFind && !bypassScrollSelection) {
           table.scrollToBottom(
             table.columnAtPoint(table.getVisibleRect().getLocation()));
         }
  @@ -1570,13 +1578,13 @@
       if ((ruleText == null) || ((ruleText != null) && ruleText.equals(""))) {
         findRule = null;
         colorizer.setFindRule(null);
  -      bypassScroll = false;
  +      bypassScrollFind = false;
         findField.setToolTipText(
           "Enter expression - right click or ctrl-space for menu");
   
         return false;
       } else {
  -      bypassScroll = true;
  +      bypassScrollFind = true;
   
         try {
           findField.setToolTipText(
  
  
  
  1.9       +1 -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.8
  retrieving revision 1.9
  diff -u -r1.8 -r1.9
  --- release-notes.html        22 May 2004 01:21:58 -0000      1.8
  +++ release-notes.html        22 May 2004 05:26:12 -0000      1.9
  @@ -14,6 +14,7 @@
   <ul>
    <li>Corrected a bug in XML decoders which caused a Swing exception when rendering 
the exception column - discovered by Stephen Pain.</li>
   <li>Events loaded from an XML-formatted file are now processed like other events 
(throttled based on responsiveness setting and conforming to cyclic buffer limits) - 
discovered by Stephen Pain.</li>
  +<li>Changed how 'scroll to bottom' is activated and deactivated.  Now, scrolling 
occurs only if 'scroll to bottom' is selected in the context menu AND the last row is 
selected.  To deactivate scrolling, select a row other than last row.  To re-activate 
scrolling, press ctrl-end to select the last row.  (Scrolling is bypassed in two 
cases: a find is active, or when the bottom row is not selected as described above.)  
Scrolling enhancement suggested by Hani.</li>
   </ul>
   
   <h2>20 May 2004</h2>
  
  
  

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

Reply via email to