1 26 27 package org.objectweb.ccm.demo1.cif; 28 29 43 44 public class ServerImpl 45 extends org.objectweb.ccm.demo1.ServerSessionComposition.ComponentImpl 46 { 47 53 54 private String name_; 55 56 57 private javax.swing.JFrame frame_; 58 59 60 private javax.swing.JTextArea textArea_; 61 62 68 69 public 70 ServerImpl() 71 { 72 } 73 74 80 86 92 98 public void 99 configuration_complete () 100 throws org.omg.Components.InvalidConfiguration 101 { 102 if(name_ == null) 104 throw new org.omg.Components.InvalidConfiguration(); 105 106 108 frame_ = new javax.swing.JFrame (name_ + "'s Server GUI"); 110 frame_.setSize(400, 300); 112 113 textArea_ = new javax.swing.JTextArea (40, 20); 115 textArea_.setEditable(false); 116 117 javax.swing.JPanel panel = new javax.swing.JPanel ( 119 new java.awt.BorderLayout () 120 ); 121 frame_.getContentPane().add(panel); 122 panel.add(new javax.swing.JScrollPane (textArea_), 123 java.awt.BorderLayout.CENTER); 124 frame_.pack(); 125 frame_.show(); 126 } 127 128 134 139 public void 140 ccm_remove() 141 throws org.omg.Components.CCMException 142 { 143 frame_.dispose(); 145 frame_ = null; 146 } 147 148 154 159 public void 160 the_name(String n) 161 { 162 name_ = n; 163 164 if (frame_ != null) 165 frame_.setTitle(name_ + "'s Server GUI"); 166 } 167 168 173 public String 174 the_name() 175 { 176 return name_; 177 } 178 179 185 190 public void 191 print(String text) 192 { 193 textArea_.append(text + "\n"); 195 } 196 } 197 | Popular Tags |