1 Clazz.declarePackage ("java.awt");
\r
2 Clazz.load (null, "java.awt.Insets", ["java.lang.InternalError"], function () {
\r
3 c$ = Clazz.decorateAsClass (function () {
\r
8 Clazz.instantialize (this, arguments);
\r
9 }, java.awt, "Insets", null, [Cloneable, java.io.Serializable]);
\r
10 Clazz.makeConstructor (c$,
\r
11 function (top, left, bottom, right) {
\r
14 this.bottom = bottom;
\r
17 Clazz.defineMethod (c$, "set",
\r
18 function (top, left, bottom, right) {
\r
21 this.bottom = bottom;
\r
24 Clazz.overrideMethod (c$, "equals",
\r
26 if (Clazz.instanceOf (obj, java.awt.Insets)) {
\r
28 return ((this.top == insets.top) && (this.left == insets.left) && (this.bottom == insets.bottom) && (this.right == insets.right));
\r
31 Clazz.overrideMethod (c$, "hashCode",
\r
33 var sum1 = this.left + this.bottom;
\r
34 var sum2 = this.right + this.top;
\r
35 var val1 = Clazz.doubleToInt (sum1 * (sum1 + 1) / 2) + this.left;
\r
36 var val2 = Clazz.doubleToInt (sum2 * (sum2 + 1) / 2) + this.top;
\r
37 var sum3 = val1 + val2;
\r
38 return Clazz.doubleToInt (sum3 * (sum3 + 1) / 2) + val2;
\r
40 Clazz.overrideMethod (c$, "toString",
\r
42 return this.getClass ().getName () + "[top=" + this.top + ",left=" + this.left + ",bottom=" + this.bottom + ",right=" + this.right + "]";
\r
44 Clazz.defineMethod (c$, "clone",
\r
47 return Clazz.superCall (this, java.awt.Insets, "clone", []);
\r
49 if (Clazz.exceptionOf (e, CloneNotSupportedException)) {
\r
50 throw new InternalError ();
\r