1 26 27 package org.objectweb.ccm.filetransfer.cif; 28 29 import org.objectweb.ccm.filetransfer.*; 30 31 import javax.swing.*; 32 33 44 45 public class TVImpl 46 extends org.objectweb.ccm.filetransfer.TVSessionComposition.ComponentImpl { 47 53 54 private String name_; 55 56 57 private javax.swing.JFrame frame_; 58 FileTransfert_impl FileTransfertImpl = null; 59 60 61 private JButton screen; 62 static JButton label; 63 64 65 71 72 public TVImpl() { 73 74 76 frame_ = new javax.swing.JFrame (name_ + "'s TV"); 78 frame_.setSize(215, 204); 79 80 javax.swing.JPanel border = new javax.swing.JPanel (new java.awt.BorderLayout ()); 81 82 screen = new JButton(); 83 label = new JButton("...Waiting for signal...."); 84 85 86 border.add(screen, java.awt.BorderLayout.CENTER); 88 border.add(label, java.awt.BorderLayout.SOUTH); 89 frame_.getContentPane().add(border); 90 91 frame_.show(); 93 94 FileTransfertImpl = 95 new FileTransfert_impl(screen, label); 96 97 98 99 100 } 101 102 108 114 120 126 public void configuration_complete() 127 throws org.omg.Components.InvalidConfiguration { 128 if (name_ == null) 130 throw new org.omg.Components.InvalidConfiguration(); 131 132 133 } 134 135 141 146 public void ccm_remove() throws org.omg.Components.CCMException { 147 frame_.dispose(); 149 frame_ = null; 150 } 151 152 158 163 public void the_name(String n) { 164 name_ = n; 165 166 if (frame_ != null) 167 frame_.setTitle(name_ + "'s TV"); 168 } 169 170 175 public String the_name() { 176 return name_; 177 } 178 179 185 190 public void push(Images event) { 191 192 if (event.datafile != null) { 193 FileTransfertImpl.display_image(event.datafile, event.filename); 196 197 System.out.println(event.filename + " received by TV component"); 198 } 199 200 201 } 202 203 } 204 | Popular Tags |