psmith      2003/06/16 17:19:11

  Modified:    src/java/org/apache/log4j/chainsaw LogUI.java
  Log:
  refactored a very small bit of code (more of a save point really, was 
  chasing down a bug, and now I've forgotten what I was doing prior).
  
  Revision  Changes    Path
  1.98      +23 -9     
jakarta-log4j-sandbox/src/java/org/apache/log4j/chainsaw/LogUI.java
  
  Index: LogUI.java
  ===================================================================
  RCS file: 
/home/cvs/jakarta-log4j-sandbox/src/java/org/apache/log4j/chainsaw/LogUI.java,v
  retrieving revision 1.97
  retrieving revision 1.98
  diff -u -r1.97 -r1.98
  --- LogUI.java        16 Jun 2003 17:02:00 -0000      1.97
  +++ LogUI.java        17 Jun 2003 00:19:10 -0000      1.98
  @@ -316,7 +316,7 @@
       event.saveSetting(LogUI.MAIN_WINDOW_HEIGHT, getHeight());
   
       if (lookAndFeelClassName != null) {
  -        event.saveSetting(LogUI.LOOK_AND_FEEL, lookAndFeelClassName);
  +      event.saveSetting(LogUI.LOOK_AND_FEEL, lookAndFeelClassName);
       }
   
       event.saveSetting(
  @@ -457,7 +457,7 @@
                       tableModelMap.remove(logPanel.getIdentifier());
                       tabbedPane.removeTabAt(tabIndex);
   
  -                    //                                       TODO should also tidy 
up any other references to things... Might need to be able to recover this pane 
again...
  +                    //          TODO should also tidy up any other references to 
things... Might need to be able to recover this pane again...
                     }
                   } else {
                     logPanel.undock();
  @@ -503,7 +503,7 @@
      *
      */
     void exit() {
  -    //       TODO Ask the user if they want to save the settings via a dialog.
  +    //    TODO Ask the user if they want to save the settings via a dialog.
       sm.saveSettings();
   
       int tabCount = tabbedPane.getTabCount();
  @@ -559,7 +559,7 @@
       if (selectedTab instanceof LogPanel) {
         return (LogPanel) selectedTab;
       } else {
  -      //             System.out.println(selectedTab);
  +      //      System.out.println(selectedTab);
       }
   
       return null;
  @@ -1315,6 +1315,7 @@
         eventsAndStatusPanel.setLayout(new BorderLayout());
   
         final JScrollPane eventsPane = new JScrollPane(table);
  +
         eventsPane.setPreferredSize(new Dimension(900, 300));
   
         eventsAndStatusPanel.add(eventsPane, BorderLayout.CENTER);
  @@ -1404,8 +1405,7 @@
                   int selectedRow = table.getSelectedRow();
   
                   if (getIdentifier().equals(getActiveTabName())) {
  -                  statusBar.setSelectedLine(
  -                    selectedRow + 1, table.getModel().getRowCount());
  +                  updateStatusBar();
                   }
   
                   try {
  @@ -1676,6 +1676,16 @@
         f.pack();
       }
   
  +    void updateStatusBar() {
  +      SwingUtilities.invokeLater(
  +        new Runnable() {
  +          public void run() {
  +            statusBar.setSelectedLine(
  +              table.getSelectedRow() + 1, table.getModel().getRowCount());
  +          }
  +        });
  +    }
  +
       void showPreferences() {
         colorDisplaySelector.show();
       }
  @@ -1699,6 +1709,10 @@
         statusBar.setNothingSelected();
       }
   
  +    public int getCurrentRow() {
  +      return table.getSelectedRow();
  +    }
  +
       /**
        * Find from the top
        * @param text
  @@ -1907,10 +1921,10 @@
           table.addColumn(element);
         }
   
  -      //             TODO Rest of the load settings
  +      //    TODO Rest of the load settings
         String columnWidths = event.getSetting(TABLE_COLUMN_WIDTHS);
   
  -      //       System.out.println("Column widths=" + columnWidths);
  +      //    System.out.println("Column widths=" + columnWidths);
         tok = new StringTokenizer(columnWidths, ",");
         index = 0;
   
  @@ -2053,7 +2067,7 @@
           if (selectedRow == -1) {
             text = "Nothing selected";
           } else {
  -          //                 TODO refactor to use a single getEvent(row) call, and 
use a Formatter interface for pluggable formatting
  +          //            TODO refactor to use a single getEvent(row) call, and use a 
Formatter interface for pluggable formatting
             text = model.getDetailText(selectedRow);
           }
   
  
  
  

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

Reply via email to