001: package org.jacorb.poa.gui.poa;
002:
003: /*
004: * JacORB - a free Java ORB
005: *
006: * Copyright (C) 1997-2004 Gerald Brose.
007: *
008: * This library is free software; you can redistribute it and/or
009: * modify it under the terms of the GNU Library General Public
010: * License as published by the Free Software Foundation; either
011: * version 2 of the License, or (at your option) any later version.
012: *
013: * This library is distributed in the hope that it will be useful,
014: * but WITHOUT ANY WARRANTY; without even the implied warranty of
015: * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
016: * Library General Public License for more details.
017: *
018: * You should have received a copy of the GNU Library General Public
019: * License along with this library; if not, write to the Free
020: * Software Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
021: */
022:
023: import org.jacorb.poa.gui.beans.FillLevelBar;
024:
025: /**
026: * @author Reimo Tiedemann, FU Berlin
027: * @version 1.01, 05/07/99, RT
028: */
029: public class QueuePanel extends java.awt.Panel implements
030: java.awt.event.ActionListener {
031: private DetailsButtonController controller;
032: private java.awt.Button ivjDetailsButton = null;
033: private org.jacorb.poa.gui.beans.FillLevelBar ivjFillLevelBar = null;
034: private java.awt.Label ivjLabel1 = null;
035: private java.awt.Label ivjLabel2 = null;
036:
037: /**
038: * Comment
039: */
040: private void _actionDetailsButtonPressed() {
041: if (controller != null) {
042: controller._actionDetailsButtonPressed("queue");
043: }
044: }
045:
046: /**
047: * Method to handle events for the ActionListener interface.
048: * @param e java.awt.event.ActionEvent
049: */
050: /* WARNING: THIS METHOD WILL BE REGENERATED. */
051: public void actionPerformed(java.awt.event.ActionEvent e) {
052: // user code begin {1}
053: // user code end
054: if ((e.getSource() == getDetailsButton())) {
055: connEtoC1(e);
056: }
057: // user code begin {2}
058: // user code end
059: }
060:
061: /**
062: * connEtoC1: (DetailsButton.action.actionPerformed(java.awt.event.ActionEvent) --> QueuePanel._actionDetailsButtonPressed()V)
063: * @param arg1 java.awt.event.ActionEvent
064: */
065: /* WARNING: THIS METHOD WILL BE REGENERATED. */
066: private void connEtoC1(java.awt.event.ActionEvent arg1) {
067: try {
068: // user code begin {1}
069: // user code end
070: this ._actionDetailsButtonPressed();
071: // user code begin {2}
072: // user code end
073: } catch (java.lang.Throwable ivjExc) {
074: // user code begin {3}
075: // user code end
076: handleException(ivjExc);
077: }
078: }
079:
080: /**
081: * Return the DetailsButton property value.
082: * @return java.awt.Button
083: */
084: /* WARNING: THIS METHOD WILL BE REGENERATED. */
085: private java.awt.Button getDetailsButton() {
086: if (ivjDetailsButton == null) {
087: try {
088: ivjDetailsButton = new java.awt.Button();
089: ivjDetailsButton.setName("DetailsButton");
090: ivjDetailsButton.setLocation(33, 170);
091: ivjDetailsButton
092: .setBackground(java.awt.SystemColor.control);
093: ivjDetailsButton.setSize(23, 23);
094: ivjDetailsButton.setFont(new java.awt.Font("dialog", 0,
095: 8));
096: ivjDetailsButton.setActionCommand("...");
097: ivjDetailsButton.setLabel("...");
098: // user code begin {1}
099: // user code end
100: } catch (java.lang.Throwable ivjExc) {
101: // user code begin {2}
102: // user code end
103: handleException(ivjExc);
104: }
105: }
106: ;
107: return ivjDetailsButton;
108: }
109:
110: /**
111: * Return the FillLevelBar property value.
112: * @return org.jacorb.poa.gui.beans.FillLevelBar
113: */
114: /* WARNING: THIS METHOD WILL BE REGENERATED. */
115: private org.jacorb.poa.gui.beans.FillLevelBar getFillLevelBar() {
116: if (ivjFillLevelBar == null) {
117: try {
118: ivjFillLevelBar = new org.jacorb.poa.gui.beans.FillLevelBar();
119: ivjFillLevelBar.setName("FillLevelBar");
120: ivjFillLevelBar.setLocation(32, 35);
121: ivjFillLevelBar
122: .setBackground(java.awt.SystemColor.control);
123: ivjFillLevelBar.setSize(50, 130);
124: // user code begin {1}
125: // user code end
126: } catch (java.lang.Throwable ivjExc) {
127: // user code begin {2}
128: // user code end
129: handleException(ivjExc);
130: }
131: }
132: ;
133: return ivjFillLevelBar;
134: }
135:
136: /**
137: * Return the Label1 property value.
138: * @return java.awt.Label
139: */
140: /* WARNING: THIS METHOD WILL BE REGENERATED. */
141: private java.awt.Label getLabel1() {
142: if (ivjLabel1 == null) {
143: try {
144: ivjLabel1 = new java.awt.Label();
145: ivjLabel1.setName("Label1");
146: ivjLabel1.setLocation(10, 10);
147: ivjLabel1.setText("Queue");
148: ivjLabel1.setBackground(java.awt.SystemColor.control);
149: ivjLabel1.setSize(70, 12);
150: ivjLabel1.setForeground(java.awt.Color.black);
151: ivjLabel1.setFont(new java.awt.Font("dialog", 2, 10));
152: ivjLabel1.setAlignment(1);
153: // user code begin {1}
154: // user code end
155: } catch (java.lang.Throwable ivjExc) {
156: // user code begin {2}
157: // user code end
158: handleException(ivjExc);
159: }
160: }
161: ;
162: return ivjLabel1;
163: }
164:
165: /**
166: * Return the Label2 property value.
167: * @return java.awt.Label
168: */
169: /* WARNING: THIS METHOD WILL BE REGENERATED. */
170: private java.awt.Label getLabel2() {
171: if (ivjLabel2 == null) {
172: try {
173: ivjLabel2 = new java.awt.Label();
174: ivjLabel2.setName("Label2");
175: ivjLabel2.setLocation(10, 22);
176: ivjLabel2.setText("");
177: ivjLabel2.setBackground(java.awt.SystemColor.control);
178: ivjLabel2.setSize(70, 12);
179: ivjLabel2.setForeground(java.awt.Color.black);
180: ivjLabel2.setFont(new java.awt.Font("dialog", 2, 10));
181: ivjLabel2.setAlignment(1);
182: // user code begin {1}
183: // user code end
184: } catch (java.lang.Throwable ivjExc) {
185: // user code begin {2}
186: // user code end
187: handleException(ivjExc);
188: }
189: }
190: ;
191: return ivjLabel2;
192: }
193:
194: FillLevelBar _getQueueBar() {
195: return getFillLevelBar();
196: }
197:
198: /**
199: * Called whenever the part throws an exception.
200: * @param exception java.lang.Throwable
201: */
202: private void handleException(Throwable exception) {
203:
204: /* Uncomment the following lines to print uncaught exceptions to stdout */
205: // System.out.println("--------- UNCAUGHT EXCEPTION ---------");
206: // exception.printStackTrace(System.out);
207: }
208:
209: /**
210: * Initializes connections
211: */
212: /* WARNING: THIS METHOD WILL BE REGENERATED. */
213: private void initConnections() {
214: // user code begin {1}
215: // user code end
216: getDetailsButton().addActionListener(this );
217: }
218:
219: /**
220: * Initialize the class.
221: */
222: /* WARNING: THIS METHOD WILL BE REGENERATED. */
223: private void initialize() {
224: // user code begin {1}
225: // user code end
226: setName("QueuePanel");
227: setLayout(null);
228: setBackground(java.awt.SystemColor.control);
229: setSize(90, 200);
230: add(getLabel1(), getLabel1().getName());
231: add(getLabel2(), getLabel2().getName());
232: add(getFillLevelBar(), getFillLevelBar().getName());
233: add(getDetailsButton(), getDetailsButton().getName());
234: initConnections();
235: // user code begin {2}
236: // user code end
237: }
238:
239: void _init(DetailsButtonController _controller) {
240: controller = _controller;
241: }
242:
243: /**
244: * AOMPanel constructor comment.
245: * @param layout java.awt.LayoutManager
246: */
247: public QueuePanel(java.awt.LayoutManager layout) {
248: super (layout);
249: }
250:
251: /**
252: * main entrypoint - starts the part when it is run as an application
253: * @param args java.lang.String[]
254: */
255: public static void main(java.lang.String[] args) {
256: try {
257: java.awt.Frame frame;
258: try {
259: Class aFrameClass = Class
260: .forName("com.ibm.uvm.abt.edit.TestFrame");
261: frame = (java.awt.Frame) aFrameClass.newInstance();
262: } catch (java.lang.Throwable ivjExc) {
263: frame = new java.awt.Frame();
264: }
265: QueuePanel aQueuePanel;
266: aQueuePanel = new QueuePanel();
267: frame.add("Center", aQueuePanel);
268: frame.setSize(aQueuePanel.getSize());
269: frame.setVisible(true);
270: } catch (Throwable exception) {
271: System.err
272: .println("Exception occurred in main() of java.awt.Panel");
273: exception.printStackTrace(System.out);
274: }
275: }
276:
277: public void paint(java.awt.Graphics g) {
278: g.setColor(getBackground());
279: g.fill3DRect(0, 0, getBounds().width, getBounds().height, true);
280: }
281:
282: /**
283: * Constructor
284: */
285: /* WARNING: THIS METHOD WILL BE REGENERATED. */
286: public QueuePanel() {
287: super();
288: initialize();
289: }
290: }
|