psmith      2003/06/26 16:02:10

  Modified:    src/java/org/apache/log4j/chainsaw LogUI.java
  Log:
  Changes because WelcomePanel is now a singleton.
  
  Fix for a JDK 1.4 specific method that was being used.
  
  Also added a convenience method to show a Help url, that
  ensures the Welcome Panel is made visible and the URl set for display.
  
  Revision  Changes    Path
  1.2       +19 -2     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.1
  retrieving revision 1.2
  diff -u -r1.1 -r1.2
  --- LogUI.java        25 Jun 2003 04:05:22 -0000      1.1
  +++ LogUI.java        26 Jun 2003 23:02:10 -0000      1.2
  @@ -100,6 +100,7 @@
   import java.io.ObjectInputStream;
   import java.io.ObjectOutputStream;
   import java.io.Serializable;
  +import java.net.URL;
   
   import java.text.NumberFormat;
   
  @@ -570,7 +571,7 @@
   
     void addWelcomePanel() {
       tabbedPane.addANewTab(
  -      "Welcome", new WelcomePanel(), new ImageIcon(ChainsawIcons.ABOUT),
  +      "Welcome", WelcomePanel.getInstance(), new ImageIcon(ChainsawIcons.ABOUT),
         "Welcome/Help");
     }
   
  @@ -621,7 +622,10 @@
       final ProgressPanel panel = new ProgressPanel(1, 3, "Shutting down");
       progress.getContentPane().add(panel);
       progress.pack();
  -    progress.setLocationRelativeTo(this);
  +    
  +    Point p = new Point(getLocation());
  +    p.move((int)getSize().getWidth()>>1, (int)getSize().getHeight()>>1);
  +    progress.setLocation(p);
       progress.setVisible(true);
   
       Runnable runnable =
  @@ -2332,5 +2336,18 @@
   
       public void columnSelectionChanged(ListSelectionEvent e) {
       }
  +  }
  +
  +  /**
  +   * Causes the Welcome Panel to become visible, and shows the URL
  +   * specified as it's contents
  +   * @param url for content to show
  +   */
  +  void showHelp(URL url) {
  +    removeWelcomePanel();
  +    addWelcomePanel();
  +//    TODO ensure the Welcome Panel is the selected tab
  +    WelcomePanel.getInstance().setURL(url);
  +    
     }
   }
  
  
  

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

Reply via email to