1 Clazz.declarePackage ("swingjs");
2 Clazz.load (["java.awt.GraphicsConfiguration"], "swingjs.JSGraphicsConfiguration", ["java.awt.GraphicsEnvironment", "$.Rectangle", "java.awt.geom.AffineTransform", "java.awt.image.BufferedImage", "$.ColorModel", "swingjs.JSToolkit"], function () {
3 c$ = Clazz.declareType (swingjs, "JSGraphicsConfiguration", java.awt.GraphicsConfiguration);
4 Clazz.makeConstructor (c$,
6 Clazz.superConstructor (this, swingjs.JSGraphicsConfiguration, []);
7 System.out.println ("JSGraphicsConfiguration initialized");
9 Clazz.overrideMethod (c$, "getDevice",
11 return java.awt.GraphicsEnvironment.getLocalGraphicsEnvironment ().getDefaultScreenDevice ();
13 Clazz.defineMethod (c$, "createCompatibleImage",
14 function (width, height) {
15 var cm = this.getColorModel ();
16 var wr = cm.createCompatibleWritableRaster (width, height);
17 return new java.awt.image.BufferedImage (cm, wr, false, null);
19 Clazz.defineMethod (c$, "getColorModel",
21 return java.awt.image.ColorModel.getRGBdefault ();
23 Clazz.defineMethod (c$, "getColorModel",
24 function (transparency) {
25 return java.awt.image.ColorModel.getRGBdefault ();
27 Clazz.overrideMethod (c$, "getDefaultTransform",
29 return new java.awt.geom.AffineTransform ();
31 Clazz.overrideMethod (c$, "getNormalizingTransform",
33 return new java.awt.geom.AffineTransform ();
35 Clazz.overrideMethod (c$, "getBounds",
40 }var d = swingjs.JSToolkit.getJQuery ().$ (doc);
41 return new java.awt.Rectangle (d.width (), d.height ());