1 package org.jacorb.poa.gui.poa; 2 3 22 23 import org.jacorb.poa.gui.beans.DoubleListDialog; 24 25 29 public class QueueListItem 30 extends java.awt.Panel 31 implements org.jacorb.poa.gui.beans.DoubleListItem, java.awt.event.ActionListener , java.awt.event.MouseListener 32 { 33 private DoubleListDialog container; 34 private QueueListItemController controller; 35 private String ridStr; 36 private java.awt.Panel ivjInnerPanel = null; 37 private java.awt.Label ivjRequestLabel = null; 38 private java.awt.Label ivjObjectLabel = null; 39 private java.awt.MenuItem ivjInspectionMenuItem = null; 40 private org.jacorb.poa.gui.beans.PopupMenu ivjPopupMenu = null; 41 private java.awt.MenuItem ivjRemoveMenuItem = null; 42 45 private void _actionInspectRequest() { 46 if (controller != null) { 47 controller._inspectRequest(ridStr); 48 } 49 } 50 53 private void _actionMousePressed(java.awt.event.MouseEvent e) { 54 if (container != null) { 55 container._setSelectedItem(this); 56 } 57 } 58 61 private void _actionMouseReleased(java.awt.event.MouseEvent e) { 62 int mods = e.getModifiers(); 63 if ((mods & java.awt.event.MouseEvent.BUTTON3_MASK) != 0) { 64 65 getPopupMenu()._show(e); 66 } else if ((mods & java.awt.event.MouseEvent.BUTTON2_MASK) != 0) { 67 68 } else { 69 70 if (e.getClickCount() > 1) { 71 72 } 73 } 74 } 75 79 80 public void actionPerformed(java.awt.event.ActionEvent e) { 81 if ((e.getSource() == getRemoveMenuItem()) ) { 84 connEtoC7(e); 85 } 86 if ((e.getSource() == getInspectionMenuItem()) ) { 87 connEtoC8(e); 88 } 89 } 92 95 private void _actionRemoveRequest() { 96 if (controller != null) { 97 controller._removeRequest(ridStr); 98 } 99 } 100 104 105 private void connEtoC1(java.awt.event.MouseEvent arg1) { 106 try { 107 this._actionMousePressed(arg1); 110 } catch (java.lang.Throwable ivjExc) { 113 handleException(ivjExc); 116 } 117 } 118 122 123 private void connEtoC2(java.awt.event.MouseEvent arg1) { 124 try { 125 this._actionMousePressed(arg1); 128 } catch (java.lang.Throwable ivjExc) { 131 handleException(ivjExc); 134 } 135 } 136 140 141 private void connEtoC3(java.awt.event.MouseEvent arg1) { 142 try { 143 this._actionMousePressed(arg1); 146 } catch (java.lang.Throwable ivjExc) { 149 handleException(ivjExc); 152 } 153 } 154 158 159 private void connEtoC4(java.awt.event.MouseEvent arg1) { 160 try { 161 this._actionMouseReleased(arg1); 164 } catch (java.lang.Throwable ivjExc) { 167 handleException(ivjExc); 170 } 171 } 172 176 177 private void connEtoC5(java.awt.event.MouseEvent arg1) { 178 try { 179 this._actionMouseReleased(arg1); 182 } catch (java.lang.Throwable ivjExc) { 185 handleException(ivjExc); 188 } 189 } 190 194 195 private void connEtoC6(java.awt.event.MouseEvent arg1) { 196 try { 197 this._actionMouseReleased(arg1); 200 } catch (java.lang.Throwable ivjExc) { 203 handleException(ivjExc); 206 } 207 } 208 212 213 private void connEtoC7(java.awt.event.ActionEvent arg1) { 214 try { 215 this._actionRemoveRequest(); 218 } catch (java.lang.Throwable ivjExc) { 221 handleException(ivjExc); 224 } 225 } 226 230 231 private void connEtoC8(java.awt.event.ActionEvent arg1) { 232 try { 233 this._actionInspectRequest(); 236 } catch (java.lang.Throwable ivjExc) { 239 handleException(ivjExc); 242 } 243 } 244 public void _correctWidth(int diff_width) { 245 } 246 java.awt.Label _getFirstLabel() { 247 return getRequestLabel(); 248 } 249 253 254 private java.awt.Panel getInnerPanel() { 255 if (ivjInnerPanel == null) { 256 try { 257 ivjInnerPanel = new java.awt.Panel (); 258 ivjInnerPanel.setName("InnerPanel"); 259 ivjInnerPanel.setLayout(null); 260 ivjInnerPanel.setBackground(java.awt.Color.lightGray); 261 ivjInnerPanel.setBounds(0, 1, 1200, 13); 262 getInnerPanel().add(getRequestLabel(), getRequestLabel().getName()); 263 getInnerPanel().add(getObjectLabel(), getObjectLabel().getName()); 264 } catch (java.lang.Throwable ivjExc) { 267 handleException(ivjExc); 270 } 271 }; 272 return ivjInnerPanel; 273 } 274 278 279 private java.awt.MenuItem getInspectionMenuItem() { 280 if (ivjInspectionMenuItem == null) { 281 try { 282 ivjInspectionMenuItem = new java.awt.MenuItem (); 283 ivjInspectionMenuItem.setEnabled(true); 284 ivjInspectionMenuItem.setLabel("Inspect Request Object"); 285 } catch (java.lang.Throwable ivjExc) { 288 handleException(ivjExc); 291 } 292 }; 293 return ivjInspectionMenuItem; 294 } 295 299 300 private java.awt.Label getObjectLabel() { 301 if (ivjObjectLabel == null) { 302 try { 303 ivjObjectLabel = new java.awt.Label (); 304 ivjObjectLabel.setName("ObjectLabel"); 305 ivjObjectLabel.setFont(new java.awt.Font ("dialog", 0, 10)); 306 ivjObjectLabel.setText("Label2"); 307 ivjObjectLabel.setBounds(200, 0, 990, 13); 308 } catch (java.lang.Throwable ivjExc) { 311 handleException(ivjExc); 314 } 315 }; 316 return ivjObjectLabel; 317 } 318 322 323 private org.jacorb.poa.gui.beans.PopupMenu getPopupMenu() { 324 if (ivjPopupMenu == null) { 325 try { 326 ivjPopupMenu = new org.jacorb.poa.gui.beans.PopupMenu(); 327 ivjPopupMenu.setLabel("Request Actions"); 328 ivjPopupMenu.add(getRemoveMenuItem()); 329 ivjPopupMenu.add(getInspectionMenuItem()); 330 } catch (java.lang.Throwable ivjExc) { 333 handleException(ivjExc); 336 } 337 }; 338 return ivjPopupMenu; 339 } 340 344 345 private java.awt.MenuItem getRemoveMenuItem() { 346 if (ivjRemoveMenuItem == null) { 347 try { 348 ivjRemoveMenuItem = new java.awt.MenuItem (); 349 ivjRemoveMenuItem.setLabel("Remove Request from Queue"); 350 } catch (java.lang.Throwable ivjExc) { 353 handleException(ivjExc); 356 } 357 }; 358 return ivjRemoveMenuItem; 359 } 360 364 365 private java.awt.Label getRequestLabel() { 366 if (ivjRequestLabel == null) { 367 try { 368 ivjRequestLabel = new java.awt.Label (); 369 ivjRequestLabel.setName("RequestLabel"); 370 ivjRequestLabel.setFont(new java.awt.Font ("dialog", 0, 10)); 371 ivjRequestLabel.setText("Label1"); 372 ivjRequestLabel.setBounds(10, 0, 180, 13); 373 } catch (java.lang.Throwable ivjExc) { 376 handleException(ivjExc); 379 } 380 }; 381 return ivjRequestLabel; 382 } 383 java.awt.Label _getSecondLabel() { 384 return getObjectLabel(); 385 } 386 390 private void handleException(Throwable exception) { 391 392 393 } 396 399 400 private void initConnections() { 401 getInnerPanel().addMouseListener(this); 404 getRequestLabel().addMouseListener(this); 405 getObjectLabel().addMouseListener(this); 406 getRemoveMenuItem().addActionListener(this); 407 getInspectionMenuItem().addActionListener(this); 408 } 409 412 413 private void initialize() { 414 setName("QueueListItem"); 417 setLayout(null); 418 setBackground(java.awt.Color.black); 419 setSize(1200, 15); 420 add(getInnerPanel(), getInnerPanel().getName()); 421 initConnections(); 422 } 425 void _init(QueueListItemController _controller, String _ridStr) { 426 controller = _controller; 427 ridStr = _ridStr; 428 } 429 433 public QueueListItem(java.awt.LayoutManager layout) { 434 super(layout); 435 } 436 440 public static void main(java.lang.String [] args) { 441 try { 442 java.awt.Frame frame; 443 try { 444 Class aFrameClass = Class.forName("com.ibm.uvm.abt.edit.TestFrame"); 445 frame = (java.awt.Frame )aFrameClass.newInstance(); 446 } catch (java.lang.Throwable ivjExc) { 447 frame = new java.awt.Frame (); 448 } 449 QueueListItem aQueueListItem; 450 aQueueListItem = new QueueListItem(); 451 frame.add("Center", aQueueListItem); 452 frame.setSize(aQueueListItem.getSize()); 453 frame.setVisible(true); 454 } catch (Throwable exception) { 455 System.err.println("Exception occurred in main() of java.awt.Panel"); 456 exception.printStackTrace(System.out); 457 } 458 } 459 463 464 public void mouseClicked(java.awt.event.MouseEvent e) { 465 } 470 474 475 public void mouseEntered(java.awt.event.MouseEvent e) { 476 } 481 485 486 public void mouseExited(java.awt.event.MouseEvent e) { 487 } 492 496 497 public void mousePressed(java.awt.event.MouseEvent e) { 498 if ((e.getSource() == getInnerPanel()) ) { 501 connEtoC1(e); 502 } 503 if ((e.getSource() == getRequestLabel()) ) { 504 connEtoC2(e); 505 } 506 if ((e.getSource() == getObjectLabel()) ) { 507 connEtoC3(e); 508 } 509 } 512 516 517 public void mouseReleased(java.awt.event.MouseEvent e) { 518 if ((e.getSource() == getInnerPanel()) ) { 521 connEtoC4(e); 522 } 523 if ((e.getSource() == getRequestLabel()) ) { 524 connEtoC5(e); 525 } 526 if ((e.getSource() == getObjectLabel()) ) { 527 connEtoC6(e); 528 } 529 } 532 public void _setContainer(DoubleListDialog _container) { 533 container = _container; 534 } 535 public void _setSelected(boolean selected) { 536 if (selected) { 537 getInnerPanel().setBackground(java.awt.Color.darkGray); 538 getRequestLabel().setBackground(java.awt.Color.darkGray); 539 getObjectLabel().setBackground(java.awt.Color.darkGray); 540 getRequestLabel().setForeground(java.awt.Color.white); 541 getObjectLabel().setForeground(java.awt.Color.white); 542 543 } else { 544 getInnerPanel().setBackground(java.awt.Color.lightGray); 545 getRequestLabel().setBackground(java.awt.Color.lightGray); 546 getObjectLabel().setBackground(java.awt.Color.lightGray); 547 getRequestLabel().setForeground(java.awt.Color.black); 548 getObjectLabel().setForeground(java.awt.Color.black); 549 } 550 } 551 void _setWidth(int w1, int w2) { 552 getRequestLabel().setSize(w1, 13); 553 getObjectLabel().setBounds(20+w1, 0, 1200-(w1+20), 13); 554 } 555 558 559 public QueueListItem() { 560 super(); 561 initialize(); 562 } 563 } 564 565 566 567 568 569 570 571 572 573 574 575 576 577 578 579 580 | Popular Tags |