1 Clazz.declarePackage ("java.awt.image");
2 Clazz.load (null, "java.awt.image.Kernel", ["java.lang.IllegalArgumentException", "$.InternalError"], function () {
3 c$ = Clazz.decorateAsClass (function () {
9 Clazz.instantialize (this, arguments);
10 }, java.awt.image, "Kernel", null, Cloneable);
11 Clazz.makeConstructor (c$,
12 function (width, height, data) {
15 this.xOrigin = (width - 1) >> 1;
16 this.yOrigin = (height - 1) >> 1;
17 var len = width * height;
18 if (data.length < len) {
19 throw new IllegalArgumentException ("Data array too small (is " + data.length + " and should be " + len);
20 }this.data = Clazz.newFloatArray (len, 0);
21 System.arraycopy (data, 0, this.data, 0, len);
23 Clazz.defineMethod (c$, "getXOrigin",
27 Clazz.defineMethod (c$, "getYOrigin",
31 Clazz.defineMethod (c$, "getWidth",
35 Clazz.defineMethod (c$, "getHeight",
39 Clazz.defineMethod (c$, "getKernelData",
42 data = Clazz.newFloatArray (this.data.length, 0);
43 } else if (data.length < this.data.length) {
44 throw new IllegalArgumentException ("Data array too small (should be " + this.data.length + " but is " + data.length + " )");
45 }System.arraycopy (this.data, 0, data, 0, this.data.length);
48 Clazz.defineMethod (c$, "clone",
51 return Clazz.superCall (this, java.awt.image.Kernel, "clone", []);
53 if (Clazz.exceptionOf (e, CloneNotSupportedException)) {
54 throw new InternalError ();