1 package org.jacorb.poa.gui.pm; 2 3 22 23 27 public class StatePanel extends java.awt.Panel implements java.awt.event.ItemListener { 28 private StatePanelController controller = null; 29 private java.awt.Choice ivjStateChoice = null; 30 private java.awt.Label ivjStateLabel = null; 31 private java.awt.Checkbox ivjWaitCheckbox = null; 32 private java.awt.Panel ivjChoicePanel = null; 33 private java.awt.BorderLayout ivjStatePanelBorderLayout = null; 34 private java.awt.Checkbox ivjEtherializeCheckbox = null; 35 38 39 public StatePanel() { 40 super(); 41 initialize(); 42 } 43 47 public StatePanel(java.awt.LayoutManager layout) { 48 super(layout); 49 } 50 java.awt.Checkbox _getEtherializeCheckbox() { 51 return getEtherializeCheckbox(); 52 } 53 java.awt.Choice _getStateChoice() { 54 return getStateChoice(); 55 } 56 java.awt.Checkbox _getWaitCheckbox() { 57 return getWaitCheckbox(); 58 } 59 void _init(StatePanelController _controller) { 60 controller = _controller; 61 } 62 private void _stateItemChanged(String item, boolean wait, boolean etherialize) { 63 if (controller != null) { 64 controller._stateItemChanged(item, wait, etherialize); 65 } 66 } 67 71 72 private void connEtoC1(java.awt.event.ItemEvent arg1) { 73 try { 74 this._stateItemChanged(getStateChoice().getSelectedItem(), getWaitCheckbox().getState(), getEtherializeCheckbox().getState()); 77 } catch (java.lang.Throwable ivjExc) { 80 handleException(ivjExc); 83 } 84 } 85 89 90 private java.awt.Panel getChoicePanel() { 91 java.awt.GridBagConstraints constraintsStateChoice = new java.awt.GridBagConstraints (); 92 java.awt.GridBagConstraints constraintsWaitCheckbox = new java.awt.GridBagConstraints (); 93 java.awt.GridBagConstraints constraintsEtherializeCheckbox = new java.awt.GridBagConstraints (); 94 if (ivjChoicePanel == null) { 95 try { 96 ivjChoicePanel = new java.awt.Panel (); 97 ivjChoicePanel.setName("ChoicePanel"); 98 ivjChoicePanel.setLayout(new java.awt.GridBagLayout ()); 99 100 constraintsStateChoice.gridx = 0; constraintsStateChoice.gridy = 0; 101 constraintsStateChoice.gridwidth = 1; constraintsStateChoice.gridheight = 1; 102 constraintsStateChoice.fill = java.awt.GridBagConstraints.HORIZONTAL; 103 constraintsStateChoice.anchor = java.awt.GridBagConstraints.WEST; 104 constraintsStateChoice.weightx = 1.0; 105 constraintsStateChoice.weighty = 0.0; 106 constraintsStateChoice.insets = new java.awt.Insets (0, 10, 0, 0); 107 getChoicePanel().add(getStateChoice(), constraintsStateChoice); 108 109 constraintsWaitCheckbox.gridx = 0; constraintsWaitCheckbox.gridy = 1; 110 constraintsWaitCheckbox.gridwidth = 1; constraintsWaitCheckbox.gridheight = 1; 111 constraintsWaitCheckbox.fill = java.awt.GridBagConstraints.HORIZONTAL; 112 constraintsWaitCheckbox.anchor = java.awt.GridBagConstraints.WEST; 113 constraintsWaitCheckbox.weightx = 0.0; 114 constraintsWaitCheckbox.weighty = 0.0; 115 constraintsWaitCheckbox.insets = new java.awt.Insets (5, 10, 0, 0); 116 getChoicePanel().add(getWaitCheckbox(), constraintsWaitCheckbox); 117 118 constraintsEtherializeCheckbox.gridx = 0; constraintsEtherializeCheckbox.gridy = 2; 119 constraintsEtherializeCheckbox.gridwidth = 1; constraintsEtherializeCheckbox.gridheight = 1; 120 constraintsEtherializeCheckbox.fill = java.awt.GridBagConstraints.HORIZONTAL; 121 constraintsEtherializeCheckbox.anchor = java.awt.GridBagConstraints.WEST; 122 constraintsEtherializeCheckbox.weightx = 1.0; 123 constraintsEtherializeCheckbox.weighty = 0.0; 124 constraintsEtherializeCheckbox.insets = new java.awt.Insets (0, 10, 0, 0); 125 getChoicePanel().add(getEtherializeCheckbox(), constraintsEtherializeCheckbox); 126 } catch (java.lang.Throwable ivjExc) { 129 handleException(ivjExc); 132 } 133 }; 134 return ivjChoicePanel; 135 } 136 140 141 private java.awt.Checkbox getEtherializeCheckbox() { 142 if (ivjEtherializeCheckbox == null) { 143 try { 144 ivjEtherializeCheckbox = new java.awt.Checkbox (); 145 ivjEtherializeCheckbox.setName("EtherializeCheckbox"); 146 ivjEtherializeCheckbox.setFont(new java.awt.Font ("dialog", 2, 10)); 147 ivjEtherializeCheckbox.setLabel("etherialize_objects"); 148 } catch (java.lang.Throwable ivjExc) { 151 handleException(ivjExc); 154 } 155 }; 156 return ivjEtherializeCheckbox; 157 } 158 162 163 private java.awt.Choice getStateChoice() { 164 if (ivjStateChoice == null) { 165 try { 166 ivjStateChoice = new java.awt.Choice (); 167 ivjStateChoice.setName("StateChoice"); 168 ivjStateChoice.setBackground(java.awt.SystemColor.window); 169 } catch (java.lang.Throwable ivjExc) { 172 handleException(ivjExc); 175 } 176 }; 177 return ivjStateChoice; 178 } 179 183 184 private java.awt.Label getStateLabel() { 185 if (ivjStateLabel == null) { 186 try { 187 ivjStateLabel = new java.awt.Label (); 188 ivjStateLabel.setName("StateLabel"); 189 ivjStateLabel.setText(" State:"); 190 ivjStateLabel.setForeground(java.awt.Color.black); 191 } catch (java.lang.Throwable ivjExc) { 194 handleException(ivjExc); 197 } 198 }; 199 return ivjStateLabel; 200 } 201 205 206 private java.awt.BorderLayout getStatePanelBorderLayout() { 207 java.awt.BorderLayout ivjStatePanelBorderLayout = null; 208 try { 209 210 ivjStatePanelBorderLayout = new java.awt.BorderLayout (); 211 ivjStatePanelBorderLayout.setVgap(0); 212 } catch (java.lang.Throwable ivjExc) { 213 handleException(ivjExc); 214 }; 215 return ivjStatePanelBorderLayout; 216 } 217 221 222 private java.awt.Checkbox getWaitCheckbox() { 223 if (ivjWaitCheckbox == null) { 224 try { 225 ivjWaitCheckbox = new java.awt.Checkbox (); 226 ivjWaitCheckbox.setName("WaitCheckbox"); 227 ivjWaitCheckbox.setFont(new java.awt.Font ("dialog", 2, 10)); 228 ivjWaitCheckbox.setLabel("wait_for_completion"); 229 } catch (java.lang.Throwable ivjExc) { 232 handleException(ivjExc); 235 } 236 }; 237 return ivjWaitCheckbox; 238 } 239 243 private void handleException(Throwable exception) { 244 245 246 } 249 252 253 private void initConnections() { 254 getStateChoice().addItemListener(this); 257 } 258 261 262 private void initialize() { 263 setName("StatePanel"); 266 setLayout(getStatePanelBorderLayout()); 267 setBackground(java.awt.SystemColor.control); 268 setSize(125, 90); 269 add(getStateLabel(), "North"); 270 add(getChoicePanel(), "Center"); 271 initConnections(); 272 } 275 279 280 public void itemStateChanged(java.awt.event.ItemEvent e) { 281 if ((e.getSource() == getStateChoice()) ) { 284 connEtoC1(e); 285 } 286 } 289 293 public static void main(java.lang.String [] args) { 294 try { 295 java.awt.Frame frame; 296 try { 297 Class aFrameClass = Class.forName("com.ibm.uvm.abt.edit.TestFrame"); 298 frame = (java.awt.Frame )aFrameClass.newInstance(); 299 } catch (java.lang.Throwable ivjExc) { 300 frame = new java.awt.Frame (); 301 } 302 StatePanel aStatePanel; 303 aStatePanel = new StatePanel(); 304 frame.add("Center", aStatePanel); 305 frame.setSize(aStatePanel.getSize()); 306 frame.setVisible(true); 307 } catch (Throwable exception) { 308 System.err.println("Exception occurred in main() of java.awt.Panel"); 309 exception.printStackTrace(System.out); 310 } 311 } 312 313 } 314 315 316 317 318 319 320 321 322 323 324 325 326 327 328 329 | Popular Tags |