1 Clazz.declarePackage ("javax.swing");
\r
2 Clazz.load (["javax.swing.Icon", "java.lang.StringBuilder"], "javax.swing.ImageIcon", ["java.awt.Toolkit"], function () {
\r
3 c$ = Clazz.decorateAsClass (function () {
\r
4 this.filename = null;
\r
5 this.location = null;
\r
8 this.imageObserver = null;
\r
9 this.description = null;
\r
12 Clazz.instantialize (this, arguments);
\r
13 }, javax.swing, "ImageIcon", null, javax.swing.Icon);
\r
14 Clazz.makeConstructor (c$,
\r
15 function (filename, description) {
\r
16 this.image = java.awt.Toolkit.getDefaultToolkit ().getImage (filename);
\r
17 if (this.image == null) {
\r
19 }this.filename = filename;
\r
20 this.description = description;
\r
21 this.loadImage (this.image);
\r
23 Clazz.makeConstructor (c$,
\r
24 function (filename) {
\r
25 this.construct (filename, filename);
\r
27 Clazz.makeConstructor (c$,
\r
28 function (location, description) {
\r
29 this.image = java.awt.Toolkit.getDefaultToolkit ().getImage (location);
\r
30 if (this.image == null) {
\r
32 }this.location = location;
\r
33 this.description = description;
\r
34 this.loadImage (this.image);
\r
35 }, "java.net.URL,~S");
\r
36 Clazz.makeConstructor (c$,
\r
37 function (location) {
\r
38 this.construct (location, location.toExternalForm ());
\r
40 Clazz.makeConstructor (c$,
\r
41 function (image, description) {
\r
42 this.construct (image);
\r
43 this.description = description;
\r
44 }, "java.awt.Image,~S");
\r
45 Clazz.makeConstructor (c$,
\r
48 var o = image.getProperty ("comment", this.imageObserver);
\r
49 if (Clazz.instanceOf (o, String)) {
\r
50 this.description = o;
\r
51 }this.loadImage (image);
\r
52 }, "java.awt.Image");
\r
53 Clazz.makeConstructor (c$,
\r
54 function (imageData, description) {
\r
55 this.image = java.awt.Toolkit.getDefaultToolkit ().createImage (imageData);
\r
56 if (this.image == null) {
\r
58 }this.description = description;
\r
59 this.loadImage (this.image);
\r
61 Clazz.makeConstructor (c$,
\r
62 function (imageData) {
\r
63 this.image = java.awt.Toolkit.getDefaultToolkit ().createImage (imageData);
\r
64 if (this.image == null) {
\r
66 }var o = this.image.getProperty ("comment", this.imageObserver);
\r
67 if (Clazz.instanceOf (o, String)) {
\r
68 this.description = o;
\r
69 }this.loadImage (this.image);
\r
71 Clazz.makeConstructor (c$,
\r
74 Clazz.defineMethod (c$, "loadImage",
\r
76 this.width = image.getWidth (this.imageObserver);
\r
77 this.height = image.getHeight (this.imageObserver);
\r
78 }, "java.awt.Image");
\r
79 Clazz.defineMethod (c$, "getImageLoadStatus",
\r
81 return this.loadStatus;
\r
83 Clazz.defineMethod (c$, "getImage",
\r
87 Clazz.defineMethod (c$, "setImage",
\r
90 this.loadImage (image);
\r
91 }, "java.awt.Image");
\r
92 Clazz.defineMethod (c$, "getDescription",
\r
94 return this.description;
\r
96 Clazz.defineMethod (c$, "setDescription",
\r
97 function (description) {
\r
98 this.description = description;
\r
100 Clazz.overrideMethod (c$, "paintIcon",
\r
101 function (c, g, x, y) {
\r
102 if (this.imageObserver == null) {
\r
103 g.drawImage (this.image, x, y, c);
\r
105 g.drawImage (this.image, x, y, this.imageObserver);
\r
106 }}, "java.awt.Component,java.awt.Graphics,~N,~N");
\r
107 Clazz.overrideMethod (c$, "getIconWidth",
\r
111 Clazz.overrideMethod (c$, "getIconHeight",
\r
113 return this.height;
\r
115 Clazz.defineMethod (c$, "setImageObserver",
\r
116 function (observer) {
\r
117 this.imageObserver = observer;
\r
118 }, "java.awt.image.ImageObserver");
\r
119 Clazz.defineMethod (c$, "getImageObserver",
\r
121 return this.imageObserver;
\r
123 Clazz.defineMethod (c$, "toString",
\r
125 if (this.description != null) {
\r
126 return this.description;
\r
127 }return Clazz.superCall (this, javax.swing.ImageIcon, "toString", []);
\r
129 Clazz.defineStatics (c$,
\r
130 "mediaTrackerID", 0);
\r
131 c$.TRACKER_KEY = c$.prototype.TRACKER_KEY = new StringBuilder ("TRACKER_KEY");
\r