1 26 27 package org.objectweb.ccm.demo3.cif; 28 29 import org.objectweb.ccm.demo3.*; 30 31 41 42 public class ConsumerImpl 43 extends org.objectweb.ccm.demo3.ConsumerSessionComposition.ComponentImpl 44 { 45 51 52 private String name_; 53 54 55 private javax.swing.JFrame frame_; 56 57 58 private javax.swing.JTextArea textArea_; 59 60 66 67 public 68 ConsumerImpl() 69 { 70 } 71 72 78 84 90 96 public void 97 configuration_complete() 98 throws org.omg.Components.InvalidConfiguration 99 { 100 if(name_ == null) 102 throw new org.omg.Components.InvalidConfiguration(); 103 104 106 frame_ = new javax.swing.JFrame (name_ + "'s Consumer GUI"); 108 frame_.setSize(400, 300); 110 111 textArea_ = new javax.swing.JTextArea (40, 20); 113 textArea_.setEditable(false); 114 115 javax.swing.JPanel panel = new javax.swing.JPanel ( 117 new java.awt.BorderLayout ()); 118 frame_.getContentPane().add(panel); 119 panel.add(new javax.swing.JScrollPane (textArea_), 120 java.awt.BorderLayout.CENTER); 121 frame_.pack(); 122 frame_.show(); 123 } 124 125 131 136 public void 137 ccm_remove() 138 throws org.omg.Components.CCMException 139 { 140 frame_.dispose(); 142 frame_ = null; 143 } 144 145 151 156 public void 157 name(String n) 158 { 159 name_ = n; 160 161 if (frame_ != null) 162 frame_.setTitle(name_ + "'s Consumer GUI"); 163 } 164 165 170 public String 171 name() 172 { 173 return name_; 174 } 175 176 182 187 public void 188 push(TextEvent event) 189 { 190 textArea_.append(event.text + "\n"); 192 } 193 } 194 195 | Popular Tags |