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 java.awt.Label;
024:
025: /**
026: * @author Reimo Tiedemann, FU Berlin
027: * @version 1.0, 05/03/99, RT
028: */
029: public class StatePanel extends java.awt.Panel {
030: private java.awt.Label ivjNameLabel = null;
031: private java.awt.Label ivjValueLabel = null;
032:
033: /**
034: * Return the NameLabel property value.
035: * @return java.awt.Label
036: */
037: /* WARNING: THIS METHOD WILL BE REGENERATED. */
038: private java.awt.Label getNameLabel() {
039: if (ivjNameLabel == null) {
040: try {
041: ivjNameLabel = new java.awt.Label();
042: ivjNameLabel.setName("NameLabel");
043: ivjNameLabel.setText("State:");
044: ivjNameLabel.setBounds(10, 10, 50, 23);
045: ivjNameLabel.setForeground(java.awt.Color.black);
046: // user code begin {1}
047: // user code end
048: } catch (java.lang.Throwable ivjExc) {
049: // user code begin {2}
050: // user code end
051: handleException(ivjExc);
052: }
053: }
054: ;
055: return ivjNameLabel;
056: }
057:
058: Label _getStateLabel() {
059: return getValueLabel();
060: }
061:
062: /**
063: * Return the ValueLabel property value.
064: * @return java.awt.Label
065: */
066: /* WARNING: THIS METHOD WILL BE REGENERATED. */
067: private java.awt.Label getValueLabel() {
068: if (ivjValueLabel == null) {
069: try {
070: ivjValueLabel = new java.awt.Label();
071: ivjValueLabel.setName("ValueLabel");
072: ivjValueLabel
073: .setFont(new java.awt.Font("dialog", 2, 12));
074: ivjValueLabel.setText("active");
075: ivjValueLabel.setBounds(60, 10, 230, 23);
076: // user code begin {1}
077: // user code end
078: } catch (java.lang.Throwable ivjExc) {
079: // user code begin {2}
080: // user code end
081: handleException(ivjExc);
082: }
083: }
084: ;
085: return ivjValueLabel;
086: }
087:
088: /**
089: * Called whenever the part throws an exception.
090: * @param exception java.lang.Throwable
091: */
092: private void handleException(Throwable exception) {
093:
094: /* Uncomment the following lines to print uncaught exceptions to stdout */
095: // System.out.println("--------- UNCAUGHT EXCEPTION ---------");
096: // exception.printStackTrace(System.out);
097: }
098:
099: /**
100: * Initialize the class.
101: */
102: /* WARNING: THIS METHOD WILL BE REGENERATED. */
103: private void initialize() {
104: // user code begin {1}
105: // user code end
106: setName("StatePanel");
107: setLayout(null);
108: setBackground(java.awt.SystemColor.control);
109: setSize(300, 43);
110: add(getNameLabel(), getNameLabel().getName());
111: add(getValueLabel(), getValueLabel().getName());
112: // user code begin {2}
113: // user code end
114: }
115:
116: /**
117: * StatePanel constructor comment.
118: * @param layout java.awt.LayoutManager
119: */
120: public StatePanel(java.awt.LayoutManager layout) {
121: super (layout);
122: }
123:
124: /**
125: * main entrypoint - starts the part when it is run as an application
126: * @param args java.lang.String[]
127: */
128: public static void main(java.lang.String[] args) {
129: try {
130: java.awt.Frame frame;
131: try {
132: Class aFrameClass = Class
133: .forName("com.ibm.uvm.abt.edit.TestFrame");
134: frame = (java.awt.Frame) aFrameClass.newInstance();
135: } catch (java.lang.Throwable ivjExc) {
136: frame = new java.awt.Frame();
137: }
138: StatePanel aStatePanel;
139: aStatePanel = new StatePanel();
140: frame.add("Center", aStatePanel);
141: frame.setSize(aStatePanel.getSize());
142: frame.setVisible(true);
143: } catch (Throwable exception) {
144: System.err
145: .println("Exception occurred in main() of java.awt.Panel");
146: exception.printStackTrace(System.out);
147: }
148: }
149:
150: public void paint(java.awt.Graphics g) {
151: g.setColor(getBackground());
152: g.fill3DRect(0, 0, getBounds().width, getBounds().height, true);
153: }
154:
155: /**
156: * Constructor
157: */
158: /* WARNING: THIS METHOD WILL BE REGENERATED. */
159: public StatePanel() {
160: super();
161: initialize();
162: }
163: }
|