KickJava   Java API By Example, From Geeks To Geeks.

Java > Open Source Codes > org > oddjob > monitor > view > DetailView


1 package org.oddjob.monitor.view;
2
3 import java.awt.Dimension JavaDoc;
4 import java.util.Observable JavaDoc;
5 import java.util.Observer JavaDoc;
6
7 import javax.swing.JTabbedPane JavaDoc;
8
9 import org.oddjob.monitor.model.DetailModel;
10
11 /**
12  * The detail view component of the monitor.
13  *
14  * @author Rob Gordon
15  */

16
17 public class DetailView extends JTabbedPane JavaDoc implements Observer JavaDoc {
18     private static final long serialVersionUID = 0;
19     
20     /** State view */
21     private final StatePanel statePanel;
22
23     /** Consol panel */
24     private final LogTextPanel consolePanel;
25
26     /** Log panel */
27     private final LogTextPanel logPanel;
28
29     /** Property view */
30     private PropertyPanel propertyPanel;
31
32     /**
33      * Constructor. Create the view and add the three pannels.
34      *
35      */

36
37     public DetailView(DetailModel model) {
38         
39         // state
40
statePanel = new StatePanel();
41         model.getStateModel().addObserver(statePanel);
42
43         this.consolePanel = new LogTextPanel(model.getConsoleModel());
44         this.logPanel = new LogTextPanel(model.getLogModel());
45         
46         propertyPanel = new PropertyPanel(
47                 model.getPropertyModel());
48         
49         setPreferredSize(new Dimension JavaDoc(400, 350));
50
51         add("State", statePanel);
52         add("Console", consolePanel);
53         add("Log", logPanel);
54         add("Properties", propertyPanel);
55     }
56
57     /* (non-Javadoc)
58      * @see java.util.Observer#update(java.util.Observable, java.lang.Object)
59      */

60     public void update(Observable JavaDoc o, Object JavaDoc arg) {
61     }
62 }
63
Popular Tags