KickJava   Java API By Example, From Geeks To Geeks.

Java > Open Source Codes > org > jacorb > poa > gui > poa > AOMPanel


1 package org.jacorb.poa.gui.poa;
2
3 /*
4  * JacORB - a free Java ORB
5  *
6  * Copyright (C) 1997-2004 Gerald Brose.
7  *
8  * This library is free software; you can redistribute it and/or
9  * modify it under the terms of the GNU Library General Public
10  * License as published by the Free Software Foundation; either
11  * version 2 of the License, or (at your option) any later version.
12  *
13  * This library is distributed in the hope that it will be useful,
14  * but WITHOUT ANY WARRANTY; without even the implied warranty of
15  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
16  * Library General Public License for more details.
17  *
18  * You should have received a copy of the GNU Library General Public
19  * License along with this library; if not, write to the Free
20  * Software Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
21  */

22  
23 import org.jacorb.poa.gui.beans.FillLevelBar;
24
25 /**
26  * @author Reimo Tiedemann, FU Berlin
27  * @version 1.01, 05/07/99, RT
28  */

29 public class AOMPanel extends java.awt.Panel JavaDoc implements java.awt.event.ActionListener JavaDoc {
30     private DetailsButtonController controller;
31     
32     private java.awt.Button JavaDoc ivjDetailsButton = null;
33     private org.jacorb.poa.gui.beans.FillLevelBar ivjFillLevelBar = null;
34     private java.awt.Label JavaDoc ivjLabel1 = null;
35     private java.awt.Label JavaDoc ivjLabel2 = null;
36     /**
37      * Comment
38      */

39     private void _actionDetailsButtonPressed() {
40     if (controller != null) {
41             controller._actionDetailsButtonPressed("aom");
42     }
43     }
44     /**
45      * Method to handle events for the ActionListener interface.
46      * @param e java.awt.event.ActionEvent
47      */

48     /* WARNING: THIS METHOD WILL BE REGENERATED. */
49     public void actionPerformed(java.awt.event.ActionEvent JavaDoc e) {
50     // user code begin {1}
51
// user code end
52
if ((e.getSource() == getDetailsButton()) ) {
53             connEtoC1(e);
54     }
55     // user code begin {2}
56
// user code end
57
}
58     /**
59      * connEtoC1: (DetailsButton.action.actionPerformed(java.awt.event.ActionEvent) --> AOMPanel.detailsButtonPressed()V)
60      * @param arg1 java.awt.event.ActionEvent
61      */

62     /* WARNING: THIS METHOD WILL BE REGENERATED. */
63     private void connEtoC1(java.awt.event.ActionEvent JavaDoc arg1) {
64     try {
65             // user code begin {1}
66
// user code end
67
this._actionDetailsButtonPressed();
68             // user code begin {2}
69
// user code end
70
} catch (java.lang.Throwable JavaDoc ivjExc) {
71             // user code begin {3}
72
// user code end
73
handleException(ivjExc);
74     }
75     }
76     FillLevelBar _getAOMBar() {
77     return getFillLevelBar();
78     }
79     /**
80      * Return the DetailsButton property value.
81      * @return java.awt.Button
82      */

83     /* WARNING: THIS METHOD WILL BE REGENERATED. */
84     private java.awt.Button JavaDoc getDetailsButton() {
85     if (ivjDetailsButton == null) {
86             try {
87                 ivjDetailsButton = new java.awt.Button JavaDoc();
88                 ivjDetailsButton.setName("DetailsButton");
89                 ivjDetailsButton.setLocation(33, 170);
90                 ivjDetailsButton.setBackground(java.awt.SystemColor.control);
91                 ivjDetailsButton.setSize(23, 23);
92                 ivjDetailsButton.setFont(new java.awt.Font JavaDoc("dialog", 0, 8));
93                 ivjDetailsButton.setActionCommand("...");
94                 ivjDetailsButton.setLabel("...");
95                 // user code begin {1}
96
// user code end
97
} catch (java.lang.Throwable JavaDoc ivjExc) {
98                 // user code begin {2}
99
// user code end
100
handleException(ivjExc);
101             }
102     };
103     return ivjDetailsButton;
104     }
105     /**
106      * Return the FillLevelBar property value.
107      * @return org.jacorb.poa.gui.beans.FillLevelBar
108      */

109     /* WARNING: THIS METHOD WILL BE REGENERATED. */
110     private org.jacorb.poa.gui.beans.FillLevelBar getFillLevelBar() {
111     if (ivjFillLevelBar == null) {
112             try {
113                 ivjFillLevelBar = new org.jacorb.poa.gui.beans.FillLevelBar();
114                 ivjFillLevelBar.setName("FillLevelBar");
115                 ivjFillLevelBar.setLocation(32, 35);
116                 ivjFillLevelBar.setBackground(java.awt.SystemColor.control);
117                 ivjFillLevelBar.setSize(50, 130);
118                 // user code begin {1}
119
// user code end
120
} catch (java.lang.Throwable JavaDoc ivjExc) {
121                 // user code begin {2}
122
// user code end
123
handleException(ivjExc);
124             }
125     };
126     return ivjFillLevelBar;
127     }
128     /**
129      * Return the Label1 property value.
130      * @return java.awt.Label
131      */

132     /* WARNING: THIS METHOD WILL BE REGENERATED. */
133     private java.awt.Label JavaDoc getLabel1() {
134     if (ivjLabel1 == null) {
135             try {
136                 ivjLabel1 = new java.awt.Label JavaDoc();
137                 ivjLabel1.setName("Label1");
138                 ivjLabel1.setLocation(10, 10);
139                 ivjLabel1.setText("Active Object");
140                 ivjLabel1.setBackground(java.awt.SystemColor.control);
141                 ivjLabel1.setSize(70, 12);
142                 ivjLabel1.setForeground(java.awt.Color.black);
143                 ivjLabel1.setFont(new java.awt.Font JavaDoc("dialog", 2, 10));
144                 ivjLabel1.setAlignment(1);
145                 // user code begin {1}
146
// user code end
147
} catch (java.lang.Throwable JavaDoc ivjExc) {
148                 // user code begin {2}
149
// user code end
150
handleException(ivjExc);
151             }
152     };
153     return ivjLabel1;
154     }
155     /**
156      * Return the Label2 property value.
157      * @return java.awt.Label
158      */

159     /* WARNING: THIS METHOD WILL BE REGENERATED. */
160     private java.awt.Label JavaDoc getLabel2() {
161     if (ivjLabel2 == null) {
162             try {
163                 ivjLabel2 = new java.awt.Label JavaDoc();
164                 ivjLabel2.setName("Label2");
165                 ivjLabel2.setLocation(10, 22);
166                 ivjLabel2.setText("Map");
167                 ivjLabel2.setBackground(java.awt.SystemColor.control);
168                 ivjLabel2.setSize(70, 12);
169                 ivjLabel2.setForeground(java.awt.Color.black);
170                 ivjLabel2.setFont(new java.awt.Font JavaDoc("dialog", 2, 10));
171                 ivjLabel2.setAlignment(1);
172                 // user code begin {1}
173
// user code end
174
} catch (java.lang.Throwable JavaDoc ivjExc) {
175                 // user code begin {2}
176
// user code end
177
handleException(ivjExc);
178             }
179     };
180     return ivjLabel2;
181     }
182     /**
183      * Called whenever the part throws an exception.
184      * @param exception java.lang.Throwable
185      */

186     private void handleException(Throwable JavaDoc exception) {
187
188     /* Uncomment the following lines to print uncaught exceptions to stdout */
189     // System.out.println("--------- UNCAUGHT EXCEPTION ---------");
190
// exception.printStackTrace(System.out);
191
}
192     /**
193      * Initializes connections
194      */

195     /* WARNING: THIS METHOD WILL BE REGENERATED. */
196     private void initConnections() {
197     // user code begin {1}
198
// user code end
199
getDetailsButton().addActionListener(this);
200     }
201     /**
202      * Initialize the class.
203      */

204     /* WARNING: THIS METHOD WILL BE REGENERATED. */
205     private void initialize() {
206     // user code begin {1}
207
// user code end
208
setName("AOMPanel");
209     setLayout(null);
210     setBackground(java.awt.SystemColor.control);
211     setSize(90, 200);
212     add(getLabel1(), getLabel1().getName());
213     add(getLabel2(), getLabel2().getName());
214     add(getFillLevelBar(), getFillLevelBar().getName());
215     add(getDetailsButton(), getDetailsButton().getName());
216     initConnections();
217     // user code begin {2}
218
// user code end
219
}
220     void _init(DetailsButtonController _controller) {
221     controller = _controller;
222     }
223     /**
224      * AOMPanel constructor comment.
225      * @param layout java.awt.LayoutManager
226      */

227     public AOMPanel(java.awt.LayoutManager JavaDoc layout) {
228     super(layout);
229     }
230     /**
231      * main entrypoint - starts the part when it is run as an application
232      * @param args java.lang.String[]
233      */

234     public static void main(java.lang.String JavaDoc[] args) {
235     try {
236             java.awt.Frame JavaDoc frame;
237             try {
238                 Class JavaDoc aFrameClass = Class.forName("com.ibm.uvm.abt.edit.TestFrame");
239                 frame = (java.awt.Frame JavaDoc)aFrameClass.newInstance();
240             } catch (java.lang.Throwable JavaDoc ivjExc) {
241                 frame = new java.awt.Frame JavaDoc();
242             }
243             AOMPanel aAOMPanel;
244             aAOMPanel = new AOMPanel();
245             frame.add("Center", aAOMPanel);
246             frame.setSize(aAOMPanel.getSize());
247             frame.setVisible(true);
248     } catch (Throwable JavaDoc exception) {
249             System.err.println("Exception occurred in main() of java.awt.Panel");
250             exception.printStackTrace(System.out);
251     }
252     }
253     public void paint(java.awt.Graphics JavaDoc g) {
254     g.setColor(getBackground());
255     g.fill3DRect(0, 0, getBounds().width, getBounds().height, true);
256     }
257     /**
258      * Constructor
259      */

260     /* WARNING: THIS METHOD WILL BE REGENERATED. */
261     public AOMPanel() {
262     super();
263     initialize();
264     }
265 }
266
267
268
269
270
271
272
273
274
275
276
277
278
279
Popular Tags