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  Changes    Path
  1.45      +17 -17    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.44
  retrieving revision 1.45
  diff -u -r1.44 -r1.45
  --- LogPanel.java     31 Dec 2003 09:54:40 -0000      1.44
  +++ LogPanel.java     31 Dec 2003 19:31:16 -0000      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 -62    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.68
  retrieving revision 1.69
  diff -u -r1.68 -r1.69
  --- LogUI.java        31 Dec 2003 09:54:40 -0000      1.68
  +++ LogUI.java        31 Dec 2003 19:31:16 -0000      1.69
  @@ -78,7 +78,6 @@
   import java.util.List;
   import java.util.Map;
   import java.util.Set;
  -import java.util.Vector;
   
   import javax.swing.AbstractAction;
   import javax.swing.Action;
  @@ -111,7 +110,6 @@
   import org.apache.log4j.Level;
   import org.apache.log4j.LogManager;
   import org.apache.log4j.Priority;
  -import org.apache.log4j.UtilLoggingLevel;
   import org.apache.log4j.chainsaw.help.HelpManager;
   import org.apache.log4j.chainsaw.help.Tutorial;
   import org.apache.log4j.chainsaw.helper.SwingHelper;
  @@ -166,7 +164,6 @@
     private static final String MAIN_WINDOW_X = "main.window.x";
     static final String TABLE_COLUMN_ORDER = "table.columns.order";
     static final String TABLE_COLUMN_WIDTHS = "table.columns.widths";
  -  private static final String STATUS_BAR = "StatusBar";
     static final String COLUMNS_EXTENSION = ".columns";
     static final String COLORS_EXTENSION = ".colors";
     private final JFrame preferencesFrame = new JFrame();
  @@ -217,7 +214,6 @@
      */
     private EventListenerList shutdownListenerList = new EventListenerList();
     private WelcomePanel welcomePanel;
  -  private String lookAndFeelClassName;
   
     /**
      * Constructor which builds up all the visual elements of the frame including
  @@ -533,7 +529,7 @@
       }
   
   
  -    List utilList = UtilLoggingLevel.getAllPossibleLevels();
  +    //List utilList = UtilLoggingLevel.getAllPossibleLevels();
   
       // TODO: Replace the array list creating with the standard way of
       // retreiving the Level set. (TBD)
  @@ -1258,15 +1254,15 @@
         }
       }
       
  -    JWindow progress = new JWindow();
  +    JWindow progressWindow = new JWindow();
       final ProgressPanel panel = new ProgressPanel(1, 3, "Shutting down");
  -    progress.getContentPane().add(panel);
  -    progress.pack();
  +    progressWindow.getContentPane().add(panel);
  +    progressWindow.pack();
   
       Point p = new Point(getLocation());
       p.move((int) getSize().getWidth() >> 1, (int) getSize().getHeight() >> 1);
  -    progress.setLocation(p);
  -    progress.setVisible(true);
  +    progressWindow.setLocation(p);
  +    progressWindow.setVisible(true);
   
       Runnable runnable =
         new Runnable() {
  @@ -1386,38 +1382,6 @@
     }
   
     /**
  -   * Formats the individual elements of an LoggingEvent by ensuring that there
  -   * are no null bits, replacing them with EMPTY_STRING
  -   *
  -   * @param v
  -   * @return
  -   */
  -  private Vector formatFields(Vector v) {
  -    for (int i = 0; i < v.size(); i++) {
  -      if (v.get(i) == null) {
  -        v.set(i, ChainsawConstants.EMPTY_STRING);
  -      }
  -    }
  -
  -    return v;
  -  }
  -
  -  /**
  -   * Modify the saved Look And Feel - does not update the currently used Look
  -   * And Feel
  -   *
  -   * @param lookAndFeelClassName
  -   *                    The FQN of the LookAndFeel
  -   */
  -  public void setLookAndFeel(String lookAndFeelClassName) {
  -    this.lookAndFeelClassName = lookAndFeelClassName;
  -    JOptionPane.showMessageDialog(
  -      getContentPane(),
  -      "Restart application for the new Look and Feel to take effect.",
  -      "Look and Feel Updated", JOptionPane.INFORMATION_MESSAGE);
  -  }
  -
  -  /**
      * Changes the currently used Look And Feel of the App
      *
      * @param lookAndFeelClassName
  @@ -1643,10 +1607,6 @@
           return;
         }
   
  -      EventContainer tableModel;
  -      JSortTable table;
  -      HashMap map = null;
  -
         if (!isGUIFullyInitialized) {
           synchronized (initializationLock) {
             while (!isGUIFullyInitialized) {
  @@ -1747,18 +1707,14 @@
     }
   
     class TabIconHandler implements EventCountListener {
  -    private final String ident;
  -    private int lastCount;
  -    private int currentCount;
   
       //the tabIconHandler is associated with a new tab, and a new tab always
  -    //has new events
  -    private boolean hasNewEvents = true;
  +    //shows the 'new events' icon
  +    private boolean receivedNotification = true;
       ImageIcon NEW_EVENTS = new ImageIcon(ChainsawIcons.ANIM_RADIO_TOWER);
       ImageIcon HAS_EVENTS = new ImageIcon(ChainsawIcons.INFO);
   
       public TabIconHandler(final String ident) {
  -      this.ident = ident;
   
         new Thread(
           new Runnable() {
  @@ -1773,24 +1729,18 @@
                   getTabbedPane().setIconAt(
                     getTabbedPane().indexOfTab(ident), null);
   
  -                //reset fields so no icon will display
  -                lastCount = currentCount;
  -                hasNewEvents = false;
                 } else {
                   //don't process undocked tabs
                   if (getTabbedPane().indexOfTab(ident) > -1) {
  -                  //if the tab is not active and the counts don't match, set the
  +                  //if the tab is not active and we received notification, set the
                     // new events icon
  -                  if (lastCount != currentCount) {
  +                  if (receivedNotification) {
                       getTabbedPane().setIconAt(
                         getTabbedPane().indexOfTab(ident), NEW_EVENTS);
  -                    lastCount = currentCount;
  -                    hasNewEvents = true;
  +                    receivedNotification = false;
                     } else {
  -                    if (hasNewEvents) {
                         getTabbedPane().setIconAt(
                           getTabbedPane().indexOfTab(ident), HAS_EVENTS);
  -                    }
                     }
                   }
                 }
  @@ -1813,7 +1763,7 @@
            *                    DOCUMENT ME!
            */
       public void eventCountChanged(int currentCount, int totalCount) {
  -      this.currentCount = currentCount;
  +      receivedNotification = true;
       }
     }
     /**
  
  
  
  1.4       +0 -1      logging-log4j/src/java/org/apache/log4j/chainsaw/FileMenu.java
  
  Index: FileMenu.java
  ===================================================================
  RCS file: /home/cvs/logging-log4j/src/java/org/apache/log4j/chainsaw/FileMenu.java,v
  retrieving revision 1.3
  retrieving revision 1.4
  diff -u -r1.3 -r1.4
  --- FileMenu.java     8 Dec 2003 06:00:20 -0000       1.3
  +++ FileMenu.java     31 Dec 2003 19:31:16 -0000      1.4
  @@ -78,7 +78,6 @@
     private Action remoteLog4JAction;
     private Action remoteUtilLoggingAction;
     private Action saveAction;
  -  private Action saveSettingsAction;
   
     public FileMenu(final LogUI logUI) {
       super("File");
  
  
  

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

Reply via email to