diff options
author | nobody <nobody@ae88bc3d-4319-0410-8dbf-d08b4c9d3795> | 1997-11-25 22:18:58 +0000 |
---|---|---|
committer | nobody <nobody@ae88bc3d-4319-0410-8dbf-d08b4c9d3795> | 1997-11-25 22:18:58 +0000 |
commit | 7a5fe8ce23ac50450b804cf0183c773565ae7cef (patch) | |
tree | 220a38a6627619d1386897d42757a140b9de448f /java/ImageProcessing/framework/ImageSender.java | |
parent | 87b0987cad99cf45cd5d9e03cd1cefbaaec4ef2a (diff) | |
download | ATCD-ACE-4_4.tar.gz |
This commit was manufactured by cvs2svn to create branch 'ACE-4_4'.ACE-4_4
Diffstat (limited to 'java/ImageProcessing/framework/ImageSender.java')
-rw-r--r-- | java/ImageProcessing/framework/ImageSender.java | 110 |
1 files changed, 0 insertions, 110 deletions
diff --git a/java/ImageProcessing/framework/ImageSender.java b/java/ImageProcessing/framework/ImageSender.java deleted file mode 100644 index 708e39f9fae..00000000000 --- a/java/ImageProcessing/framework/ImageSender.java +++ /dev/null @@ -1,110 +0,0 @@ -package imaging.framework; - -import java.awt.*; -import java.net.*; -import java.io.*; -import java.applet.*; -import JACE.OS.*; -import JACE.Connection.*; - -public class ImageSender -{ - public ImageSender (Applet parent) - { - this.parent_ = parent; - } - - public void open (Image image, String url) - { - this.image_ = image; - - this.hostname_ = url; - if (this.hostname_.startsWith ("http://")) - this.hostname_ = this.hostname_.substring (7); - - int index = -1; - if ((index = this.hostname_.indexOf (":")) != -1) - { - String temp = this.hostname_.substring (index + 1); - int i = -1; - if ((i = temp.indexOf ("/")) != -1) - { - this.port_ = (new Integer (temp.substring (0, i))).intValue (); - this.filename_ = temp.substring (i); - } - this.hostname_ = this.hostname_.substring (0, index); - } - else - { - int i = -1; - if ((i = this.hostname_.indexOf ("/")) != -1) - { - this.filename_ = hostname_.substring (i); - } - this.hostname_ = this.hostname_.substring (0, i); - this.port_ = 80; - } - } - - public int send () - { - ImageByteCounter byteCounter = new ImageByteCounter ("", this.image_, this.parent_); - // StatusIndicator indicator = new StatusIndicator (""); - // ImageByteCounter byteCounter = new ImageByteCounter ("", this.image_, indicator); - int length = byteCounter.count (); - // indicator.dispose (); - // First determine how many bytes we will be sending - /* - try - { - GIFOutputStream ostream = new GIFOutputStream (); - GifEncoder encoder = new GifEncoder (this.image_, ostream); - encoder.encode (); - - length = ostream.count (); - System.out.println ("send: " + length); - } - catch (IOException e) - { - ACE.ERROR ("Exception generating gif"); - } - */ - - GIFHandler gifHandler = new GIFHandler (this.filename_, this.image_, length); - try - { - // Connect to the server and send the image - this.connector_.open (this.hostname_, this.port_); - this.connector_.connect (gifHandler); - } - catch (UnknownHostException e) - { - ACE.ERROR (e); - } - catch (InstantiationException e) - { - ACE.ERROR (e); - } - catch (IllegalAccessException e) - { - ACE.ERROR (e); - } - catch (IOException e) - { - ACE.ERROR (e); - } - - if (gifHandler.returnCode () != -1) - return gifHandler.bytesWritten (); - else - return -1; - } - - private Image image_ = null; - String filename_; - String hostname_; - int port_; - Connector connector_ = new Connector (); - Applet parent_; -} - |