JAL-1807 Bob
[jalviewjs.git] / site / j2s / swingjs / JSGraphicsConfiguration.js
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$, 
5 function () {
6 Clazz.superConstructor (this, swingjs.JSGraphicsConfiguration, []);
7 System.out.println ("JSGraphicsConfiguration initialized");
8 });
9 Clazz.overrideMethod (c$, "getDevice", 
10 function () {
11 return java.awt.GraphicsEnvironment.getLocalGraphicsEnvironment ().getDefaultScreenDevice ();
12 });
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);
18 }, "~N,~N");
19 Clazz.defineMethod (c$, "getColorModel", 
20 function () {
21 return java.awt.image.ColorModel.getRGBdefault ();
22 });
23 Clazz.defineMethod (c$, "getColorModel", 
24 function (transparency) {
25 return java.awt.image.ColorModel.getRGBdefault ();
26 }, "~N");
27 Clazz.overrideMethod (c$, "getDefaultTransform", 
28 function () {
29 return  new java.awt.geom.AffineTransform ();
30 });
31 Clazz.overrideMethod (c$, "getNormalizingTransform", 
32 function () {
33 return  new java.awt.geom.AffineTransform ();
34 });
35 Clazz.overrideMethod (c$, "getBounds", 
36 function () {
37 var doc = null;
38 {
39 doc = document;
40 }var d = swingjs.JSToolkit.getJQuery ().$ (doc);
41 return  new java.awt.Rectangle (d.width (), d.height ());
42 });
43 });