Merge branch 'master' of https://source.jalview.org/git/jalviewjs.git
[jalviewjs.git] / site / swingjs / j2s / jssun / swing / CachedPainter.js
index 46d21f3..cb82955 100644 (file)
@@ -1,78 +1,78 @@
-Clazz.declarePackage ("jssun.swing");\r
-Clazz.load (["java.util.HashMap"], "jssun.swing.CachedPainter", ["java.awt.image.BufferedImage", "$.VolatileImage", "jssun.swing.ImageCache"], function () {\r
-c$ = Clazz.declareType (jssun.swing, "CachedPainter");\r
-c$.getCache = Clazz.defineMethod (c$, "getCache", \r
- function (key) {\r
-{\r
-var cache = jssun.swing.CachedPainter.cacheMap.get (key);\r
-if (cache == null) {\r
-cache =  new jssun.swing.ImageCache (1);\r
-jssun.swing.CachedPainter.cacheMap.put (key, cache);\r
-}return cache;\r
-}}, "~O");\r
-Clazz.makeConstructor (c$, \r
-function (cacheCount) {\r
-jssun.swing.CachedPainter.getCache (this.getClass ()).setMaxCount (cacheCount);\r
-}, "~N");\r
-Clazz.defineMethod (c$, "paint", \r
-function (c, g, x, y, w, h, args) {\r
-if (w <= 0 || h <= 0) {\r
-return;\r
-}if (c != null) {\r
-this.paint0 (c, g, x, y, w, h, args);\r
-} else {\r
-this.paint0 (c, g, x, y, w, h, args);\r
-}}, "java.awt.Component,java.awt.Graphics,~N,~N,~N,~N,~A");\r
-Clazz.defineMethod (c$, "paint0", \r
- function (c, g, x, y, w, h, args) {\r
-var key = this.getClass ();\r
-var config = this.getGraphicsConfiguration (c);\r
-var cache = jssun.swing.CachedPainter.getCache (key);\r
-var image = cache.getImage (key, config, w, h, args);\r
-var attempts = 0;\r
-do {\r
-var draw = false;\r
-if (Clazz.instanceOf (image, java.awt.image.VolatileImage)) {\r
-switch ((image).validate (config)) {\r
-case 2:\r
-(image).flush ();\r
-image = null;\r
-break;\r
-case 1:\r
-draw = true;\r
-break;\r
-}\r
-}if (image == null) {\r
-image = this.createImage (c, w, h, config, args);\r
-cache.setImage (key, config, w, h, args, image);\r
-draw = true;\r
-}if (draw) {\r
-var g2 = image.getGraphics ();\r
-this.paintToImage (c, image, g2, w, h, args);\r
-g2.dispose ();\r
-}this.paintImage (c, g, x, y, w, h, image, args);\r
-} while ((Clazz.instanceOf (image, java.awt.image.VolatileImage)) && (image).contentsLost () && ++attempts < 3);\r
-}, "java.awt.Component,java.awt.Graphics,~N,~N,~N,~N,~A");\r
-Clazz.defineMethod (c$, "paintImage", \r
-function (c, g, x, y, w, h, image, args) {\r
-g.drawImage (image, x, y, null);\r
-}, "java.awt.Component,java.awt.Graphics,~N,~N,~N,~N,java.awt.Image,~A");\r
-Clazz.defineMethod (c$, "createImage", \r
-function (c, w, h, config, args) {\r
-if (config == null) {\r
-return  new java.awt.image.BufferedImage (w, h, 1);\r
-}return config.createCompatibleVolatileImage (w, h);\r
-}, "java.awt.Component,~N,~N,java.awt.GraphicsConfiguration,~A");\r
-Clazz.defineMethod (c$, "flush", \r
-function () {\r
-{\r
-jssun.swing.CachedPainter.getCache (this.getClass ()).flush ();\r
-}});\r
-Clazz.defineMethod (c$, "getGraphicsConfiguration", \r
- function (c) {\r
-if (c == null) {\r
-return null;\r
-}return c.getGraphicsConfiguration ();\r
-}, "java.awt.Component");\r
-c$.cacheMap = c$.prototype.cacheMap =  new java.util.HashMap ();\r
-});\r
+Clazz.declarePackage ("jssun.swing");
+Clazz.load (["java.util.HashMap"], "jssun.swing.CachedPainter", ["java.awt.image.BufferedImage", "$.VolatileImage", "jssun.swing.ImageCache"], function () {
+c$ = Clazz.declareType (jssun.swing, "CachedPainter");
+c$.getCache = Clazz.defineMethod (c$, "getCache", 
+ function (key) {
+{
+var cache = jssun.swing.CachedPainter.cacheMap.get (key);
+if (cache == null) {
+cache =  new jssun.swing.ImageCache (1);
+jssun.swing.CachedPainter.cacheMap.put (key, cache);
+}return cache;
+}}, "~O");
+Clazz.makeConstructor (c$, 
+function (cacheCount) {
+jssun.swing.CachedPainter.getCache (this.getClass ()).setMaxCount (cacheCount);
+}, "~N");
+Clazz.defineMethod (c$, "paint", 
+function (c, g, x, y, w, h, args) {
+if (w <= 0 || h <= 0) {
+return;
+}if (c != null) {
+this.paint0 (c, g, x, y, w, h, args);
+} else {
+this.paint0 (c, g, x, y, w, h, args);
+}}, "java.awt.Component,java.awt.Graphics,~N,~N,~N,~N,~A");
+Clazz.defineMethod (c$, "paint0", 
+ function (c, g, x, y, w, h, args) {
+var key = this.getClass ();
+var config = this.getGraphicsConfiguration (c);
+var cache = jssun.swing.CachedPainter.getCache (key);
+var image = cache.getImage (key, config, w, h, args);
+var attempts = 0;
+do {
+var draw = false;
+if (Clazz.instanceOf (image, java.awt.image.VolatileImage)) {
+switch ((image).validate (config)) {
+case 2:
+(image).flush ();
+image = null;
+break;
+case 1:
+draw = true;
+break;
+}
+}if (image == null) {
+image = this.createImage (c, w, h, config, args);
+cache.setImage (key, config, w, h, args, image);
+draw = true;
+}if (draw) {
+var g2 = image.getGraphics ();
+this.paintToImage (c, image, g2, w, h, args);
+g2.dispose ();
+}this.paintImage (c, g, x, y, w, h, image, args);
+} while ((Clazz.instanceOf (image, java.awt.image.VolatileImage)) && (image).contentsLost () && ++attempts < 3);
+}, "java.awt.Component,java.awt.Graphics,~N,~N,~N,~N,~A");
+Clazz.defineMethod (c$, "paintImage", 
+function (c, g, x, y, w, h, image, args) {
+g.drawImage (image, x, y, null);
+}, "java.awt.Component,java.awt.Graphics,~N,~N,~N,~N,java.awt.Image,~A");
+Clazz.defineMethod (c$, "createImage", 
+function (c, w, h, config, args) {
+if (config == null) {
+return  new java.awt.image.BufferedImage (w, h, 1);
+}return config.createCompatibleVolatileImage (w, h);
+}, "java.awt.Component,~N,~N,java.awt.GraphicsConfiguration,~A");
+Clazz.defineMethod (c$, "flush", 
+function () {
+{
+jssun.swing.CachedPainter.getCache (this.getClass ()).flush ();
+}});
+Clazz.defineMethod (c$, "getGraphicsConfiguration", 
+ function (c) {
+if (c == null) {
+return null;
+}return c.getGraphicsConfiguration ();
+}, "java.awt.Component");
+c$.cacheMap = c$.prototype.cacheMap =  new java.util.HashMap ();
+});