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