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