1 Clazz.declarePackage ("swingjs");
2 Clazz.load (["java.awt.GraphicsEnvironment"], "swingjs.JSGraphicsEnvironment", ["swingjs.JSGraphics2D", "$.JSToolkit", "swingjs.api.DOMNode"], function () {
3 c$ = Clazz.declareType (swingjs, "JSGraphicsEnvironment", java.awt.GraphicsEnvironment);
4 Clazz.makeConstructor (c$,
6 Clazz.superConstructor (this, swingjs.JSGraphicsEnvironment, []);
7 System.out.println ("JSGraphicsEnvironment initialized");
9 Clazz.overrideMethod (c$, "createGraphics",
11 return this.createGraphicsSized (img, img.getWidth (), img.getHeight ());
12 }, "java.awt.image.BufferedImage");
13 Clazz.defineMethod (c$, "createGraphicsSized",
14 function (img, width, height) {
19 var canvas = swingjs.api.DOMNode.createElement ("canvas", "img" + System.currentTimeMillis ());
22 canvas.height = height;
24 }g = new swingjs.JSGraphics2D (canvas);
29 Clazz.overrideMethod (c$, "getAllFonts",
33 Clazz.defineMethod (c$, "getAvailableFontFamilyNames",
37 Clazz.defineMethod (c$, "getAvailableFontFamilyNames",
40 }, "java.util.Locale");
41 Clazz.overrideMethod (c$, "getDefaultScreenDevice",
43 if (swingjs.JSGraphicsEnvironment.device == null) swingjs.JSGraphicsEnvironment.device = swingjs.JSToolkit.getInstance ("swingjs.JSScreenDevice");
44 return swingjs.JSGraphicsEnvironment.device;
46 Clazz.defineStatics (c$,