1 26 27 package org.objectweb.ccm.demo1.monolithic; 28 29 import org.objectweb.ccm.demo1.*; 30 31 43 44 public class ServerImpl 45 extends org.omg.CORBA.LocalObject 46 implements CCM_Server, 47 CCM_Display, 48 org.omg.Components.SessionComponent 49 { 50 56 57 private String name_; 58 59 60 private javax.swing.JFrame frame_; 61 62 63 private javax.swing.JTextArea textArea_; 64 65 66 private CCM_Server_Context the_context_; 67 68 74 75 public 76 ServerImpl() 77 { 78 } 79 80 86 92 98 104 public void 105 configuration_complete () 106 throws org.omg.Components.InvalidConfiguration 107 { 108 if(name_ == null) 110 throw new org.omg.Components.InvalidConfiguration(); 111 112 114 frame_ = new javax.swing.JFrame (name_ + "'s Server GUI"); 116 frame_.setSize(400, 300); 118 119 textArea_ = new javax.swing.JTextArea (40, 20); 121 textArea_.setEditable(false); 122 123 javax.swing.JPanel panel = new javax.swing.JPanel ( 125 new java.awt.BorderLayout () 126 ); 127 frame_.getContentPane().add(panel); 128 panel.add(new javax.swing.JScrollPane (textArea_), 129 java.awt.BorderLayout.CENTER); 130 frame_.pack(); 131 frame_.show(); 132 } 133 134 140 147 public void 148 set_session_context(org.omg.Components.SessionContext context) 149 throws org.omg.Components.CCMException 150 { 151 the_context_ = (CCM_Server_Context)context; 152 } 153 154 159 public void 160 ccm_activate() 161 throws org.omg.Components.CCMException 162 { 163 } 165 166 171 public void 172 ccm_passivate() 173 throws org.omg.Components.CCMException 174 { 175 } 177 178 183 public void 184 ccm_remove() 185 throws org.omg.Components.CCMException 186 { 187 frame_.dispose(); 189 frame_ = null; 190 } 191 192 198 203 public void 204 print(String text) 205 { 206 textArea_.append(text + "\n"); 208 } 209 210 216 221 public CCM_Display 222 get_for_clients() 223 { 224 return this; 225 } 226 227 232 public void 233 the_name(String n) 234 { 235 name_ = n; 236 237 if (frame_ != null) 238 frame_.setTitle(name_ + "'s Server GUI"); 239 } 240 241 246 public String 247 the_name() 248 { 249 return name_; 250 } 251 } 252 253 254 | Popular Tags |