1 Clazz.declarePackage ("jssun.swing");
2 Clazz.load (null, "jssun.swing.ImageCache", ["java.util.LinkedList"], function () {
3 c$ = Clazz.decorateAsClass (function () {
6 Clazz.instantialize (this, arguments);
7 }, jssun.swing, "ImageCache");
8 Clazz.makeConstructor (c$,
10 this.maxCount = maxCount;
11 this.entries = new java.util.LinkedList ();
13 Clazz.defineMethod (c$, "setMaxCount",
15 this.maxCount = maxCount;
17 Clazz.defineMethod (c$, "flush",
19 this.entries.clear ();
21 Clazz.defineMethod (c$, "getEntry",
22 function (key, config, w, h, args) {
24 var iter = this.entries.listIterator ();
25 while (iter.hasNext ()) {
26 var ref = iter.next ();
30 } else if (entry.equals (config, w, h, args)) {
32 this.entries.addFirst (ref);
35 entry = new jssun.swing.ImageCache.Entry (config, w, h, args);
36 if (this.entries.size () >= this.maxCount) {
37 this.entries.removeLast ();
38 }this.entries.addFirst (entry);
40 }, "~O,java.awt.GraphicsConfiguration,~N,~N,~A");
41 Clazz.defineMethod (c$, "getImage",
42 function (key, config, w, h, args) {
43 var entry = this.getEntry (key, config, w, h, args);
44 return entry.getImage ();
45 }, "~O,java.awt.GraphicsConfiguration,~N,~N,~A");
46 Clazz.defineMethod (c$, "setImage",
47 function (key, config, w, h, args, image) {
48 var entry = this.getEntry (key, config, w, h, args);
49 entry.setImage (image);
50 }, "~O,java.awt.GraphicsConfiguration,~N,~N,~A,java.awt.Image");
52 c$ = Clazz.decorateAsClass (function () {
58 Clazz.instantialize (this, arguments);
59 }, jssun.swing.ImageCache, "Entry");
60 Clazz.makeConstructor (c$,
61 function (a, b, c, d) {
66 }, "java.awt.GraphicsConfiguration,~N,~N,~A");
67 Clazz.defineMethod (c$, "setImage",
71 Clazz.defineMethod (c$, "getImage",
75 Clazz.defineMethod (c$, "toString",
77 var a = Clazz.superCall (this, jssun.swing.ImageCache.Entry, "toString", []) + "[ graphicsConfig=" + this.config + ", image=" + this.image + ", w=" + this.w + ", h=" + this.h;
78 if (this.args != null) {
79 for (var b = 0; b < this.args.length; b++) {
80 a += ", " + this.args[b];
85 Clazz.defineMethod (c$, "equals",
86 function (a, b, c, d) {
87 if (this.w == b && this.h == c && ((this.config != null && this.config.equals (a)) || (this.config == null && a == null))) {
88 if (this.args == null && d == null) {
90 }if (this.args != null && d != null && this.args.length == d.length) {
91 for (var e = d.length - 1; e >= 0; e--) {
94 if ((f == null && g != null) || (f != null && !f.equals (g))) {
99 }, "java.awt.GraphicsConfiguration,~N,~N,~A");