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/ImageByteCounter.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/ImageByteCounter.java')
-rw-r--r-- | java/ImageProcessing/framework/ImageByteCounter.java | 94 |
1 files changed, 0 insertions, 94 deletions
diff --git a/java/ImageProcessing/framework/ImageByteCounter.java b/java/ImageProcessing/framework/ImageByteCounter.java deleted file mode 100644 index c907c9f1c92..00000000000 --- a/java/ImageProcessing/framework/ImageByteCounter.java +++ /dev/null @@ -1,94 +0,0 @@ -package imaging.framework; - -import java.io.*; -import java.awt.*; -import java.applet.*; -import java.net.*; -import JACE.OS.*; - -public class ImageByteCounter -{ - public ImageByteCounter (String title, Image image, Applet parent) - { - this.image_ = image; - this.parent_ = parent; - - Image im = null; - try - { - im = this.parent_.getImage (new URL (this.parent_.getCodeBase () + - "../ImageProcessing/framework/" + - "10.gif")); - } - catch (MalformedURLException e) - { - ACE.ERROR (e); - } - - indicator_ = new StatusIndicator ("", im); - } - - public int count () - { - int length = 0; - try - { - GIFOutputStream ostream = new GIFOutputStream (indicator_); - // GIFOutputStream ostream = new GIFOutputStream (null); - 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"); - } - indicator_.dispose (); - return length; - } - - Image image_ = null; - StatusIndicator indicator_ = null; - boolean done_ = false; - Applet parent_; -} - -class GIFOutputStream extends OutputStream -{ - public GIFOutputStream (StatusIndicator indicator) - { - super (); - this.indicator_ = indicator; - } - - public synchronized void write (int b) throws IOException - { - bytesWritten_++; - if (this.indicator_ != null) - this.indicator_.update (bytesWritten_); - } - - public synchronized void write (byte buf[]) throws IOException - { - bytesWritten_ += buf.length; - if (this.indicator_ != null) - this.indicator_.update (bytesWritten_); - } - - public synchronized void write (byte buf[], int offset, int length) throws IOException - { - bytesWritten_ += length; - if (this.indicator_ != null) - this.indicator_.update (bytesWritten_); - } - - public int count () - { - return this.bytesWritten_; - } - - private int bytesWritten_ = 0; - private StatusIndicator indicator_ = null; -} |