X-Git-Url: http://source.jalview.org/gitweb/?a=blobdiff_plain;f=site%2Fswingjs%2Fj2s%2Fjavax%2Fswing%2FProgressMonitorInputStream.js;h=e5857ce73fad305c808a739c1007ca47e942b28e;hb=b9b7a352eee79b7764c3b09c9d19663075061d8c;hp=64ec5bc44f1f6a7c700943add1a0f3fb06f4cb64;hpb=6154cb57a6eac3bb1344b8342495f5bb701ee921;p=jalviewjs.git diff --git a/site/swingjs/j2s/javax/swing/ProgressMonitorInputStream.js b/site/swingjs/j2s/javax/swing/ProgressMonitorInputStream.js index 64ec5bc..e5857ce 100644 --- a/site/swingjs/j2s/javax/swing/ProgressMonitorInputStream.js +++ b/site/swingjs/j2s/javax/swing/ProgressMonitorInputStream.js @@ -1,74 +1,74 @@ -Clazz.declarePackage ("javax.swing"); -Clazz.load (["java.io.FilterInputStream"], "javax.swing.ProgressMonitorInputStream", ["java.io.InterruptedIOException", "javax.swing.ProgressMonitor"], function () { -c$ = Clazz.decorateAsClass (function () { -this.monitor = null; -this.nread = 0; -this.size = 0; -Clazz.instantialize (this, arguments); -}, javax.swing, "ProgressMonitorInputStream", java.io.FilterInputStream); -Clazz.makeConstructor (c$, -function (parentComponent, message, $in) { -Clazz.superConstructor (this, javax.swing.ProgressMonitorInputStream, [$in]); -try { -this.size = $in.available (); -} catch (ioe) { -if (Clazz.exceptionOf (ioe, java.io.IOException)) { -this.size = 0; -} else { -throw ioe; -} -} -this.monitor = new javax.swing.ProgressMonitor (parentComponent, message, null, 0, this.size); -}, "java.awt.Component,~O,java.io.InputStream"); -Clazz.defineMethod (c$, "getProgressMonitor", -function () { -return this.monitor; -}); -Clazz.defineMethod (c$, "read", -function () { -var c = this.$in.read (); -if (c >= 0) this.monitor.setProgress (++this.nread); -if (this.monitor.isCanceled ()) { -var exc = new java.io.InterruptedIOException ("progress"); -exc.bytesTransferred = this.nread; -throw exc; -}return c; -}); -Clazz.defineMethod (c$, "read", -function (b) { -var nr = this.$in.read (b); -if (nr > 0) this.monitor.setProgress (this.nread += nr); -if (this.monitor.isCanceled ()) { -var exc = new java.io.InterruptedIOException ("progress"); -exc.bytesTransferred = this.nread; -throw exc; -}return nr; -}, "~A"); -Clazz.defineMethod (c$, "read", -function (b, off, len) { -var nr = this.$in.read (b, off, len); -if (nr > 0) this.monitor.setProgress (this.nread += nr); -if (this.monitor.isCanceled ()) { -var exc = new java.io.InterruptedIOException ("progress"); -exc.bytesTransferred = this.nread; -throw exc; -}return nr; -}, "~A,~N,~N"); -Clazz.overrideMethod (c$, "skip", -function (n) { -var nr = this.$in.skip (n); -if (nr > 0) this.monitor.setProgress (this.nread += nr); -return nr; -}, "~N"); -Clazz.overrideMethod (c$, "close", -function () { -this.$in.close (); -this.monitor.close (); -}); -Clazz.overrideMethod (c$, "reset", -function () { -this.$in.reset (); -this.nread = this.size - this.$in.available (); -this.monitor.setProgress (this.nread); -}); -}); +Clazz.declarePackage ("javax.swing"); +Clazz.load (["java.io.FilterInputStream"], "javax.swing.ProgressMonitorInputStream", ["java.io.InterruptedIOException", "javax.swing.ProgressMonitor"], function () { +c$ = Clazz.decorateAsClass (function () { +this.monitor = null; +this.nread = 0; +this.size = 0; +Clazz.instantialize (this, arguments); +}, javax.swing, "ProgressMonitorInputStream", java.io.FilterInputStream); +Clazz.makeConstructor (c$, +function (parentComponent, message, $in) { +Clazz.superConstructor (this, javax.swing.ProgressMonitorInputStream, [$in]); +try { +this.size = $in.available (); +} catch (ioe) { +if (Clazz.exceptionOf (ioe, java.io.IOException)) { +this.size = 0; +} else { +throw ioe; +} +} +this.monitor = new javax.swing.ProgressMonitor (parentComponent, message, null, 0, this.size); +}, "java.awt.Component,~O,java.io.InputStream"); +Clazz.defineMethod (c$, "getProgressMonitor", +function () { +return this.monitor; +}); +Clazz.defineMethod (c$, "read", +function () { +var c = this.$in.read (); +if (c >= 0) this.monitor.setProgress (++this.nread); +if (this.monitor.isCanceled ()) { +var exc = new java.io.InterruptedIOException ("progress"); +exc.bytesTransferred = this.nread; +throw exc; +}return c; +}); +Clazz.defineMethod (c$, "read", +function (b) { +var nr = this.$in.read (b); +if (nr > 0) this.monitor.setProgress (this.nread += nr); +if (this.monitor.isCanceled ()) { +var exc = new java.io.InterruptedIOException ("progress"); +exc.bytesTransferred = this.nread; +throw exc; +}return nr; +}, "~A"); +Clazz.defineMethod (c$, "read", +function (b, off, len) { +var nr = this.$in.read (b, off, len); +if (nr > 0) this.monitor.setProgress (this.nread += nr); +if (this.monitor.isCanceled ()) { +var exc = new java.io.InterruptedIOException ("progress"); +exc.bytesTransferred = this.nread; +throw exc; +}return nr; +}, "~A,~N,~N"); +Clazz.overrideMethod (c$, "skip", +function (n) { +var nr = this.$in.skip (n); +if (nr > 0) this.monitor.setProgress (this.nread += nr); +return nr; +}, "~N"); +Clazz.overrideMethod (c$, "close", +function () { +this.$in.close (); +this.monitor.close (); +}); +Clazz.overrideMethod (c$, "reset", +function () { +this.$in.reset (); +this.nread = this.size - this.$in.available (); +this.monitor.setProgress (this.nread); +}); +});