Merge branch 'master' of https://source.jalview.org/git/jalviewjs.git
[jalviewjs.git] / site / j2s / swingjs / JSWindowPeer.js
1 Clazz.declarePackage ("swingjs");
2 Clazz.load (["java.awt.peer.FramePeer"], "swingjs.JSWindowPeer", ["java.lang.Thread", "java.awt.GraphicsEnvironment", "$.Insets", "$.Point", "$.Toolkit"], function () {
3 c$ = Clazz.decorateAsClass (function () {
4 this.window = null;
5 this.isFrame = false;
6 this.applet = null;
7 this.graphics = null;
8 this.font = null;
9 Clazz.instantialize (this, arguments);
10 }, swingjs, "JSWindowPeer", null, java.awt.peer.FramePeer);
11 Clazz.overrideMethod (c$, "setFrame", 
12 function (target, isFrame) {
13 this.isFrame = isFrame;
14 this.window = target;
15 var jc = this;
16 jc.myThread = Thread.currentThread ();
17 jc.threadGroup = jc.myThread.getThreadGroup ();
18 this.applet = (jc.threadGroup).getHtmlApplet ();
19 this.graphics = (java.awt.GraphicsEnvironment.getLocalGraphicsEnvironment ()).createGraphicsSized (target, 500, 300);
20 return this;
21 }, "java.awt.Window,~B");
22 Clazz.overrideMethod (c$, "getGraphics", 
23 function () {
24 this.graphics.setFont (this.window.getFont ());
25 return this.graphics;
26 });
27 Clazz.overrideMethod (c$, "getToolkit", 
28 function () {
29 return java.awt.Toolkit.getDefaultToolkit ();
30 });
31 Clazz.overrideMethod (c$, "getFontMetrics", 
32 function (font) {
33 if (!font.equals (this.font)) this.window.setFont (this.font = font);
34 return this.graphics.getFontMetrics (font);
35 }, "java.awt.Font");
36 Clazz.overrideMethod (c$, "getInsets", 
37 function () {
38 return  new java.awt.Insets (0, 0, 0, 0);
39 });
40 Clazz.overrideMethod (c$, "beginValidate", 
41 function () {
42 });
43 Clazz.overrideMethod (c$, "endValidate", 
44 function () {
45 });
46 Clazz.overrideMethod (c$, "beginLayout", 
47 function () {
48 });
49 Clazz.overrideMethod (c$, "endLayout", 
50 function () {
51 });
52 Clazz.overrideMethod (c$, "isObscured", 
53 function () {
54 return false;
55 });
56 Clazz.overrideMethod (c$, "canDetermineObscurity", 
57 function () {
58 return false;
59 });
60 Clazz.overrideMethod (c$, "setVisible", 
61 function (b) {
62 }, "~B");
63 Clazz.overrideMethod (c$, "setEnabled", 
64 function (b) {
65 }, "~B");
66 Clazz.overrideMethod (c$, "paint", 
67 function (g) {
68 }, "java.awt.Graphics");
69 Clazz.overrideMethod (c$, "repaint", 
70 function (tm, x, y, width, height) {
71 }, "~N,~N,~N,~N,~N");
72 Clazz.overrideMethod (c$, "print", 
73 function (g) {
74 }, "java.awt.Graphics");
75 Clazz.overrideMethod (c$, "setBounds", 
76 function (x, y, width, height, op) {
77 }, "~N,~N,~N,~N,~N");
78 Clazz.overrideMethod (c$, "handleEvent", 
79 function (e) {
80 }, "java.awt.AWTEvent");
81 Clazz.overrideMethod (c$, "coalescePaintEvent", 
82 function (e) {
83 }, "java.awt.event.PaintEvent");
84 Clazz.overrideMethod (c$, "getLocationOnScreen", 
85 function () {
86 return  new java.awt.Point ();
87 });
88 Clazz.overrideMethod (c$, "getPreferredSize", 
89 function () {
90 return null;
91 });
92 Clazz.overrideMethod (c$, "getMinimumSize", 
93 function () {
94 return null;
95 });
96 Clazz.overrideMethod (c$, "getColorModel", 
97 function () {
98 return null;
99 });
100 Clazz.overrideMethod (c$, "dispose", 
101 function () {
102 });
103 Clazz.overrideMethod (c$, "setForeground", 
104 function (c) {
105 }, "java.awt.Color");
106 Clazz.overrideMethod (c$, "setBackground", 
107 function (c) {
108 }, "java.awt.Color");
109 Clazz.overrideMethod (c$, "setFont", 
110 function (f) {
111 this.font = f;
112 }, "java.awt.Font");
113 Clazz.overrideMethod (c$, "updateCursorImmediately", 
114 function () {
115 });
116 Clazz.overrideMethod (c$, "requestFocus", 
117 function (lightweightChild, temporary, focusedWindowChangeAllowed, time, cause) {
118 return false;
119 }, "java.awt.Component,~B,~B,~N,jssun.awt.CausedFocusEvent.Cause");
120 Clazz.overrideMethod (c$, "isFocusable", 
121 function () {
122 return false;
123 });
124 Clazz.defineMethod (c$, "createImage", 
125 function (producer) {
126 return null;
127 }, "java.awt.image.ImageProducer");
128 Clazz.defineMethod (c$, "createImage", 
129 function (width, height) {
130 return null;
131 }, "~N,~N");
132 Clazz.overrideMethod (c$, "createVolatileImage", 
133 function (width, height) {
134 return null;
135 }, "~N,~N");
136 Clazz.overrideMethod (c$, "prepareImage", 
137 function (img, w, h, o) {
138 return false;
139 }, "java.awt.Image,~N,~N,java.awt.image.ImageObserver");
140 Clazz.overrideMethod (c$, "checkImage", 
141 function (img, w, h, o) {
142 return 0;
143 }, "java.awt.Image,~N,~N,java.awt.image.ImageObserver");
144 Clazz.overrideMethod (c$, "getGraphicsConfiguration", 
145 function () {
146 return null;
147 });
148 Clazz.overrideMethod (c$, "handlesWheelScrolling", 
149 function () {
150 return false;
151 });
152 Clazz.overrideMethod (c$, "getBackBuffer", 
153 function () {
154 return null;
155 });
156 Clazz.overrideMethod (c$, "destroyBuffers", 
157 function () {
158 });
159 Clazz.overrideMethod (c$, "reparent", 
160 function (newContainer) {
161 }, "java.awt.peer.ContainerPeer");
162 Clazz.overrideMethod (c$, "isReparentSupported", 
163 function () {
164 return false;
165 });
166 Clazz.overrideMethod (c$, "layout", 
167 function () {
168 });
169 Clazz.overrideMethod (c$, "getBounds", 
170 function () {
171 return null;
172 });
173 Clazz.overrideMethod (c$, "toFront", 
174 function () {
175 });
176 Clazz.overrideMethod (c$, "toBack", 
177 function () {
178 });
179 Clazz.overrideMethod (c$, "updateAlwaysOnTopState", 
180 function () {
181 });
182 Clazz.overrideMethod (c$, "updateFocusableWindowState", 
183 function () {
184 });
185 Clazz.overrideMethod (c$, "requestWindowFocus", 
186 function () {
187 return false;
188 });
189 Clazz.overrideMethod (c$, "setModalBlocked", 
190 function (blocker, blocked) {
191 }, "java.awt.Dialog,~B");
192 Clazz.overrideMethod (c$, "updateMinimumSize", 
193 function () {
194 });
195 Clazz.overrideMethod (c$, "updateIconImages", 
196 function () {
197 });
198 Clazz.overrideMethod (c$, "setOpacity", 
199 function (opacity) {
200 }, "~N");
201 Clazz.overrideMethod (c$, "setOpaque", 
202 function (isOpaque) {
203 }, "~B");
204 Clazz.overrideMethod (c$, "updateWindow", 
205 function (backBuffer) {
206 }, "java.awt.image.BufferedImage");
207 Clazz.overrideMethod (c$, "repositionSecurityWarning", 
208 function () {
209 });
210 Clazz.overrideMethod (c$, "setTitle", 
211 function (title) {
212 }, "~S");
213 Clazz.overrideMethod (c$, "setMenuBar", 
214 function (mb) {
215 }, "~O");
216 Clazz.overrideMethod (c$, "setResizable", 
217 function (resizeable) {
218 }, "~B");
219 Clazz.overrideMethod (c$, "setState", 
220 function (state) {
221 }, "~N");
222 Clazz.overrideMethod (c$, "getState", 
223 function () {
224 return 0;
225 });
226 Clazz.overrideMethod (c$, "setMaximizedBounds", 
227 function (bounds) {
228 }, "java.awt.Rectangle");
229 Clazz.overrideMethod (c$, "setBoundsPrivate", 
230 function (x, y, width, height) {
231 }, "~N,~N,~N,~N");
232 Clazz.overrideMethod (c$, "getBoundsPrivate", 
233 function () {
234 return null;
235 });
236 });