View Javadoc

1   /*
2    * @(#) LoggerFrame.java Oct 26, 2003 Copyright (c) 2002-2005 Delft University
3    * of Technology Jaffalaan 5, 2628 BX Delft, the Netherlands. All rights
4    * reserved. This software is proprietary information of Delft University of
5    * Technology The code is published under the Lesser General Public License
6    */
7   package nl.tudelft.simulation.logger.gui;
8   
9   import java.util.logging.Logger;
10  
11  import javax.swing.JFrame;
12  import javax.swing.WindowConstants;
13  
14  /***
15   * The LoggerFrame <br>
16   * (c) copyright 2002-2005 <a href="http://www.simulation.tudelft.nl">Delft
17   * University of Technology </a>, the Netherlands. <br>
18   * See for project information <a
19   * href="http://www.simulation.tudelft.nl">www.simulation.tudelft.nl </a> <br>
20   * License of use: <a href="http://www.gnu.org/copyleft/lesser.html">Lesser
21   * General Public License (LGPL) </a>, no warranty.
22   * 
23   * @version $Revision: 1.7 $ $Date: 2005/08/04 12:09:00 $
24   * @author <a href="http://www.peter-jacobs.com">Peter Jacobs </a>, <a
25   *         href="mailto:nlang@fbk.eur.nl">Niels Lang </a>
26   */
27  public class LoggerFrame extends JFrame
28  {
29      /*** the Logger */
30      private Logger logger = null;
31  
32      /***
33       * constructs a new LoggerFrame
34       * 
35       * @param logger the logger to see
36       */
37      public LoggerFrame(final Logger logger)
38      {
39          super("Logger: " + logger.getName());
40          this.logger = logger;
41          this.initialize();
42          this.pack();
43          this.setVisible(true);
44          this.setDefaultCloseOperation(WindowConstants.DISPOSE_ON_CLOSE);
45      }
46  
47      /***
48       * initializes the Loggerframe
49       */
50      private void initialize()
51      {
52          LogPanel logPanel = new LogPanel(this.logger);
53          this.setContentPane(logPanel);
54      }
55  
56      /***
57       * @see java.awt.Window#dispose()
58       */
59      @Override
60  	public void dispose()
61      {
62          LogPanel content = (LogPanel) this.getContentPane();
63          content.finalize();
64      }
65  }