KickJava   Java API By Example, From Geeks To Geeks.

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


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 QueuePanel extends java.awt.Panel JavaDoc implements java.awt.event.ActionListener JavaDoc {
30     private DetailsButtonController controller;
31     private java.awt.Button JavaDoc ivjDetailsButton = null;
32     private org.jacorb.poa.gui.beans.FillLevelBar ivjFillLevelBar = null;
33     private java.awt.Label JavaDoc ivjLabel1 = null;
34     private java.awt.Label JavaDoc ivjLabel2 = null;
35     /**
36      * Comment
37      */

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

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

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

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

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

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

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

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

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

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

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

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

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