1 26 27 package org.objectweb.ccm.filetransfer.cif; 28 29 import org.objectweb.ccm.filetransfer.*; 30 31 import java.awt.*; 32 33 44 45 public class TVPDAImpl 46 extends org.objectweb.ccm.filetransfer.TVSessionComposition.ComponentImpl { 47 53 54 private String name_; 55 56 57 private java.awt.Frame frame_; 58 59 FileTransfertPDA_impl FileTransfertImpl = null; 60 61 62 private Canvas screen; 63 64 static Button channel; 65 static Button welcome; 66 static Choice choice; 67 68 74 75 public TVPDAImpl() { 76 77 79 frame_ = new java.awt.Frame (name_ + "'s TV"); 81 82 84 GridBagLayout gridbag = new GridBagLayout(); 85 GridBagConstraints c = new GridBagConstraints(); 86 87 frame_.setLayout(gridbag); 88 89 c.fill = GridBagConstraints.BOTH; 90 c.weightx = 1.0; 91 c.gridwidth = GridBagConstraints.REMAINDER; 92 welcome = new Button("...Receiving...."); 93 gridbag.setConstraints(welcome, c); 94 frame_.add(welcome); 95 96 c.gridwidth = GridBagConstraints.REMAINDER; 97 c.weighty = 1.0; 98 screen = new Canvas(); 99 screen.setSize(202,149); 100 gridbag.setConstraints(screen, c); 101 frame_.add(screen); 102 103 c.gridwidth = GridBagConstraints.REMAINDER; 104 c.weighty = 0.0; 105 channel = new Button("...Waiting for signal...."); 106 gridbag.setConstraints(channel, c); 107 frame_.add(channel); 108 109 frame_.pack(); 110 frame_.show(); 111 112 FileTransfertImpl = 113 new FileTransfertPDA_impl(screen, channel, welcome); 114 115 116 117 118 } 119 120 126 132 138 144 public void configuration_complete() 145 throws org.omg.Components.InvalidConfiguration { 146 if (name_ == null) 148 throw new org.omg.Components.InvalidConfiguration(); 149 150 151 } 152 153 159 164 public void ccm_remove() throws org.omg.Components.CCMException { 165 frame_.dispose(); 167 frame_ = null; 168 } 169 170 176 181 public void the_name(String n) { 182 name_ = n; 183 184 if (frame_ != null) 185 frame_.setTitle(name_ + "'s TV"); 186 } 187 188 193 public String the_name() { 194 return name_; 195 } 196 197 203 208 public void push(Images event) { 209 210 if (event.datafile != null) { 211 FileTransfertImpl.display_image(event.datafile, event.filename); 213 System.out.println(event.filename + " received by TV component"); 214 } 215 216 217 } 218 219 } 220 | Popular Tags |