KickJava   Java API By Example, From Geeks To Geeks.

Java > Open Source Codes > org > objectweb > fractal > swing > JFrameImpl


1 // skeleton class automatically generated
2

3 package org.objectweb.fractal.swing;
4
5 import org.objectweb.fractal.api.control.LifeCycleController;
6 import org.objectweb.fractal.api.control.BindingController;
7
8 import java.awt.event.WindowAdapter JavaDoc;
9 import java.awt.event.WindowEvent JavaDoc;
10
11 import javax.swing.JMenuBar JavaDoc;
12
13 public class JFrameImpl
14   extends javax.swing.JFrame JavaDoc
15   implements JFrameItf, JFrameAttributes, BindingController, LifeCycleController
16 {
17
18   // fields manually added
19
public final static String JavaDoc CONTENT_PANE_BINDING = "content-pane";
20   public final static String JavaDoc MENU_BAR_BINDING = "menu-bar";
21   private java.awt.Container JavaDoc contentPane;
22
23   public JFrameImpl () {
24     super();
25     // manually added
26
addWindowListener(
27       new WindowAdapter JavaDoc() {
28         public void windowClosing (WindowEvent JavaDoc e) {
29           System.exit(0);
30         }
31       });
32   }
33   public JFrameImpl (java.awt.GraphicsConfiguration JavaDoc arg0) {
34     super(arg0);
35   }
36   public JFrameImpl (String JavaDoc arg0) {
37     super(arg0);
38   }
39   public JFrameImpl (String JavaDoc arg0, java.awt.GraphicsConfiguration JavaDoc arg1) {
40     super(arg0,arg1);
41   }
42
43   public String JavaDoc[] listFc () {
44     // put your own code here
45
return new String JavaDoc[] {
46       CONTENT_PANE_BINDING,
47       MENU_BAR_BINDING
48     };
49   }
50
51   public Object JavaDoc lookupFc (String JavaDoc clientItfName) {
52     // put your own code here
53
if (clientItfName.equals(CONTENT_PANE_BINDING)) {
54       return contentPane;
55     } else if (clientItfName.equals(MENU_BAR_BINDING)) {
56       return getJMenuBar();
57     }
58     return null;
59   }
60
61   public void bindFc (String JavaDoc clientItfName, Object JavaDoc serverItf) {
62     // put your own code here
63
if (clientItfName.equals(CONTENT_PANE_BINDING)) {
64       contentPane = (java.awt.Container JavaDoc)serverItf;
65       super.setContentPane(contentPane);
66     } else if (clientItfName.equals(MENU_BAR_BINDING)) {
67       super.setJMenuBar((JMenuBar JavaDoc)serverItf);
68     }
69   }
70
71   public void unbindFc (String JavaDoc clientItfName) {
72     // put your own code here
73
if (clientItfName.equals(CONTENT_PANE_BINDING)) {
74       contentPane = null;
75       super.setContentPane(new java.awt.Container JavaDoc());
76     } else if (clientItfName.equals(MENU_BAR_BINDING)) {
77       super.setJMenuBar(null);
78     }
79   }
80
81   // methods manually added
82

83   public void setWidth (int width) {
84     setSize(width, getHeight());
85   }
86
87   public void setHeight (int height) {
88     setSize(getWidth(), height);
89   }
90
91   public String JavaDoc getFcState () {
92     return null;
93   }
94
95   public void startFc () {
96     show();
97   }
98
99   public void stopFc () {
100   }
101
102 }
103
Popular Tags