6f36048a6d6b1c69552a18555c39627bf208bd9a
[jalviewjs.git] / site / j2s / javax / swing / JMenu.js
1 Clazz.declarePackage ("javax.swing");\r
2 Clazz.load (["java.awt.event.WindowAdapter", "javax.swing.JMenuItem", "$.MenuElement", "javax.swing.event.ChangeListener"], "javax.swing.JMenu", ["java.lang.Error", "$.IllegalArgumentException", "java.util.Vector", "java.awt.Point", "$.Rectangle", "$.Toolkit", "javax.swing.JMenuBar", "$.JPopupMenu", "$.MenuSelectionManager", "$.SwingUtilities", "$.UIManager", "javax.swing.event.MenuEvent", "$.MenuListener"], function () {\r
3 c$ = Clazz.decorateAsClass (function () {\r
4 this.$popupMenu = null;\r
5 this.menuChangeListener = null;\r
6 this.menuEvent = null;\r
7 this.delay = 0;\r
8 this.customMenuLocation = null;\r
9 this.popupListener = null;\r
10 if (!Clazz.isClassDefined ("javax.swing.JMenu.MenuChangeListener")) {\r
11 javax.swing.JMenu.$JMenu$MenuChangeListener$ ();\r
12 }\r
13 if (!Clazz.isClassDefined ("javax.swing.JMenu.WinListener")) {\r
14 javax.swing.JMenu.$JMenu$WinListener$ ();\r
15 }\r
16 Clazz.instantialize (this, arguments);\r
17 }, javax.swing, "JMenu", javax.swing.JMenuItem, javax.swing.MenuElement);\r
18 Clazz.makeConstructor (c$, \r
19 function () {\r
20 Clazz.superConstructor (this, javax.swing.JMenu, []);\r
21 this.init0 ("", null, -2147483648);\r
22 });\r
23 Clazz.makeConstructor (c$, \r
24 function (s) {\r
25 Clazz.superConstructor (this, javax.swing.JMenu, []);\r
26 this.init0 (s, null, -2147483648);\r
27 }, "~S");\r
28 Clazz.makeConstructor (c$, \r
29 function (a) {\r
30 Clazz.superConstructor (this, javax.swing.JMenu, []);\r
31 this.init0 ("", null, -2147483648);\r
32 this.setAction (a);\r
33 }, "javax.swing.Action");\r
34 Clazz.makeConstructor (c$, \r
35 function (s, b) {\r
36 Clazz.superConstructor (this, javax.swing.JMenu, []);\r
37 this.init0 (s, null, -2147483648);\r
38 }, "~S,~B");\r
39 Clazz.overrideMethod (c$, "initFocusability", \r
40 function () {\r
41 });\r
42 Clazz.overrideMethod (c$, "updateUI", \r
43 function () {\r
44 this.setUI (javax.swing.UIManager.getUI (this));\r
45 if (this.$popupMenu != null) {\r
46 this.$popupMenu.setUI (javax.swing.UIManager.getUI (this.$popupMenu));\r
47 }});\r
48 Clazz.overrideMethod (c$, "getUIClassID", \r
49 function () {\r
50 return "MenuUI";\r
51 });\r
52 Clazz.defineMethod (c$, "setModel", \r
53 function (newModel) {\r
54 var oldModel = this.getModel ();\r
55 Clazz.superCall (this, javax.swing.JMenu, "setModel", [newModel]);\r
56 if (oldModel != null && this.menuChangeListener != null) {\r
57 oldModel.removeChangeListener (this.menuChangeListener);\r
58 this.menuChangeListener = null;\r
59 }this.model = newModel;\r
60 if (newModel != null) {\r
61 this.menuChangeListener = this.createMenuChangeListener ();\r
62 newModel.addChangeListener (this.menuChangeListener);\r
63 }}, "javax.swing.ButtonModel");\r
64 Clazz.overrideMethod (c$, "isSelected", \r
65 function () {\r
66 return this.getModel ().isSelected ();\r
67 });\r
68 Clazz.overrideMethod (c$, "setSelected", \r
69 function (b) {\r
70 var model = this.getModel ();\r
71 if (b != model.isSelected ()) {\r
72 this.getModel ().setSelected (b);\r
73 }}, "~B");\r
74 Clazz.defineMethod (c$, "isPopupMenuVisible", \r
75 function () {\r
76 this.ensurePopupMenuCreated ();\r
77 return this.$popupMenu.isVisible ();\r
78 });\r
79 Clazz.defineMethod (c$, "setPopupMenuVisible", \r
80 function (b) {\r
81 var isVisible = this.isPopupMenuVisible ();\r
82 if (b != isVisible && (this.isEnabled () || !b)) {\r
83 this.ensurePopupMenuCreated ();\r
84 if ((b == true) && this.isShowing ()) {\r
85 var p = this.getCustomMenuLocation ();\r
86 if (p == null) {\r
87 p = this.getPopupMenuOrigin ();\r
88 }this.getPopupMenu ().show (this, p.x, p.y);\r
89 } else {\r
90 this.getPopupMenu ().setVisible (false);\r
91 }}}, "~B");\r
92 Clazz.defineMethod (c$, "getPopupMenuOrigin", \r
93 function () {\r
94 var x = 0;\r
95 var y = 0;\r
96 var pm = this.getPopupMenu ();\r
97 var s = this.getSize ();\r
98 var pmSize = pm.getSize ();\r
99 if (pmSize.width == 0) {\r
100 pmSize = pm.getPreferredSize ();\r
101 }var position = this.getLocationOnScreen ();\r
102 var toolkit = java.awt.Toolkit.getDefaultToolkit ();\r
103 var gc = this.getGraphicsConfiguration ();\r
104 var screenBounds =  new java.awt.Rectangle (toolkit.getScreenSize ());\r
105 if (gc != null) {\r
106 screenBounds = gc.getBounds ();\r
107 var screenInsets = toolkit.getScreenInsets (gc);\r
108 screenBounds.width -= Math.abs (screenInsets.left + screenInsets.right);\r
109 screenBounds.height -= Math.abs (screenInsets.top + screenInsets.bottom);\r
110 position.x -= Math.abs (screenInsets.left);\r
111 position.y -= Math.abs (screenInsets.top);\r
112 }var parent = this.getParent ();\r
113 if (Clazz.instanceOf (parent, javax.swing.JPopupMenu)) {\r
114 var xOffset = javax.swing.UIManager.getInt ("Menu.submenuPopupOffsetX");\r
115 var yOffset = javax.swing.UIManager.getInt ("Menu.submenuPopupOffsetY");\r
116 if (javax.swing.SwingUtilities.isLeftToRight (this)) {\r
117 x = s.width + xOffset;\r
118 if (position.x + x + pmSize.width >= screenBounds.width + screenBounds.x && screenBounds.width - s.width < 2 * (position.x - screenBounds.x)) {\r
119 x = 0 - xOffset - pmSize.width;\r
120 }} else {\r
121 x = 0 - xOffset - pmSize.width;\r
122 if (position.x + x < screenBounds.x && screenBounds.width - s.width > 2 * (position.x - screenBounds.x)) {\r
123 x = s.width + xOffset;\r
124 }}y = yOffset;\r
125 if (position.y + y + pmSize.height >= screenBounds.height + screenBounds.y && screenBounds.height - s.height < 2 * (position.y - screenBounds.y)) {\r
126 y = s.height - yOffset - pmSize.height;\r
127 }} else {\r
128 var xOffset = javax.swing.UIManager.getInt ("Menu.menuPopupOffsetX");\r
129 var yOffset = javax.swing.UIManager.getInt ("Menu.menuPopupOffsetY");\r
130 if (javax.swing.SwingUtilities.isLeftToRight (this)) {\r
131 x = xOffset;\r
132 if (position.x + x + pmSize.width >= screenBounds.width + screenBounds.x && screenBounds.width - s.width < 2 * (position.x - screenBounds.x)) {\r
133 x = s.width - xOffset - pmSize.width;\r
134 }} else {\r
135 x = s.width - xOffset - pmSize.width;\r
136 if (position.x + x < screenBounds.x && screenBounds.width - s.width > 2 * (position.x - screenBounds.x)) {\r
137 x = xOffset;\r
138 }}y = s.height + yOffset;\r
139 if (position.y + y + pmSize.height >= screenBounds.height && screenBounds.height - s.height < 2 * (position.y - screenBounds.y)) {\r
140 y = 0 - yOffset - pmSize.height;\r
141 }}return  new java.awt.Point (x, y);\r
142 });\r
143 Clazz.defineMethod (c$, "getDelay", \r
144 function () {\r
145 return this.delay;\r
146 });\r
147 Clazz.defineMethod (c$, "setDelay", \r
148 function (d) {\r
149 if (d < 0) throw  new IllegalArgumentException ("Delay must be a positive integer");\r
150 this.delay = d;\r
151 }, "~N");\r
152 Clazz.defineMethod (c$, "ensurePopupMenuCreated", \r
153  function () {\r
154 if (this.$popupMenu == null) {\r
155 this.$popupMenu =  new javax.swing.JPopupMenu ();\r
156 this.$popupMenu.setInvoker (this);\r
157 this.popupListener = this.createWinListener (this.$popupMenu);\r
158 }});\r
159 Clazz.defineMethod (c$, "getCustomMenuLocation", \r
160  function () {\r
161 return this.customMenuLocation;\r
162 });\r
163 Clazz.defineMethod (c$, "setMenuLocation", \r
164 function (x, y) {\r
165 this.customMenuLocation =  new java.awt.Point (x, y);\r
166 if (this.$popupMenu != null) this.$popupMenu.setLocation (x, y);\r
167 }, "~N,~N");\r
168 Clazz.defineMethod (c$, "add", \r
169 function (menuItem) {\r
170 this.ensurePopupMenuCreated ();\r
171 return this.$popupMenu.add (menuItem);\r
172 }, "javax.swing.JMenuItem");\r
173 Clazz.defineMethod (c$, "add", \r
174 function (c) {\r
175 this.ensurePopupMenuCreated ();\r
176 this.$popupMenu.add (c);\r
177 return c;\r
178 }, "java.awt.Component");\r
179 Clazz.defineMethod (c$, "add", \r
180 function (c, index) {\r
181 this.ensurePopupMenuCreated ();\r
182 this.$popupMenu.add (c, index);\r
183 return c;\r
184 }, "java.awt.Component,~N");\r
185 Clazz.defineMethod (c$, "add", \r
186 function (s) {\r
187 return this.add ( new javax.swing.JMenuItem (s));\r
188 }, "~S");\r
189 Clazz.defineMethod (c$, "add", \r
190 function (a) {\r
191 var mi = this.createActionComponent (a);\r
192 mi.setAction (a);\r
193 this.add (mi);\r
194 return mi;\r
195 }, "javax.swing.Action");\r
196 Clazz.defineMethod (c$, "createActionComponent", \r
197 function (a) {\r
198 var mi = ((Clazz.isClassDefined ("javax.swing.JMenu$1") ? 0 : javax.swing.JMenu.$JMenu$1$ ()), Clazz.innerTypeInstance (javax.swing.JMenu$1, this, null));\r
199 mi.setHorizontalTextPosition (11);\r
200 mi.setVerticalTextPosition (0);\r
201 return mi;\r
202 }, "javax.swing.Action");\r
203 Clazz.defineMethod (c$, "createActionChangeListener", \r
204 function (b) {\r
205 return b.createActionPropertyChangeListener0 (b.getAction ());\r
206 }, "javax.swing.JMenuItem");\r
207 Clazz.defineMethod (c$, "addSeparator", \r
208 function () {\r
209 this.ensurePopupMenuCreated ();\r
210 this.$popupMenu.addSeparator ();\r
211 });\r
212 Clazz.defineMethod (c$, "insert", \r
213 function (s, pos) {\r
214 if (pos < 0) {\r
215 throw  new IllegalArgumentException ("index less than zero.");\r
216 }this.ensurePopupMenuCreated ();\r
217 this.$popupMenu.insert ( new javax.swing.JMenuItem (s), pos);\r
218 }, "~S,~N");\r
219 Clazz.defineMethod (c$, "insert", \r
220 function (mi, pos) {\r
221 if (pos < 0) {\r
222 throw  new IllegalArgumentException ("index less than zero.");\r
223 }this.ensurePopupMenuCreated ();\r
224 this.$popupMenu.insert (mi, pos);\r
225 return mi;\r
226 }, "javax.swing.JMenuItem,~N");\r
227 Clazz.defineMethod (c$, "insert", \r
228 function (a, pos) {\r
229 if (pos < 0) {\r
230 throw  new IllegalArgumentException ("index less than zero.");\r
231 }this.ensurePopupMenuCreated ();\r
232 var mi =  new javax.swing.JMenuItem (a);\r
233 mi.setHorizontalTextPosition (11);\r
234 mi.setVerticalTextPosition (0);\r
235 this.$popupMenu.insert (mi, pos);\r
236 return mi;\r
237 }, "javax.swing.Action,~N");\r
238 Clazz.defineMethod (c$, "insertSeparator", \r
239 function (index) {\r
240 if (index < 0) {\r
241 throw  new IllegalArgumentException ("index less than zero.");\r
242 }this.ensurePopupMenuCreated ();\r
243 this.$popupMenu.insert ( new javax.swing.JPopupMenu.Separator (), index);\r
244 }, "~N");\r
245 Clazz.defineMethod (c$, "getItem", \r
246 function (pos) {\r
247 if (pos < 0) {\r
248 throw  new IllegalArgumentException ("index less than zero.");\r
249 }var c = this.getMenuComponent (pos);\r
250 if (Clazz.instanceOf (c, javax.swing.JMenuItem)) {\r
251 var mi = c;\r
252 return mi;\r
253 }return null;\r
254 }, "~N");\r
255 Clazz.defineMethod (c$, "getItemCount", \r
256 function () {\r
257 return this.getMenuComponentCount ();\r
258 });\r
259 Clazz.defineMethod (c$, "isTearOff", \r
260 function () {\r
261 throw  new Error ("boolean isTearOff() {} not yet implemented");\r
262 });\r
263 Clazz.defineMethod (c$, "remove", \r
264 function (pos) {\r
265 if (pos < 0) {\r
266 throw  new IllegalArgumentException ("index less than zero.");\r
267 }if (pos > this.getItemCount ()) {\r
268 throw  new IllegalArgumentException ("index greater than the number of items.");\r
269 }if (this.$popupMenu != null) this.$popupMenu.remove (pos);\r
270 }, "~N");\r
271 Clazz.defineMethod (c$, "remove", \r
272 function (c) {\r
273 if (Clazz.instanceOf (c, javax.swing.JMenuItem)) if (this.$popupMenu != null) this.$popupMenu.remove (c);\r
274 if (this.$popupMenu != null) this.$popupMenu.remove (c);\r
275 }, "java.awt.Component");\r
276 Clazz.defineMethod (c$, "removeAll", \r
277 function () {\r
278 if (this.$popupMenu != null) this.$popupMenu.removeAll ();\r
279 });\r
280 Clazz.defineMethod (c$, "getMenuComponentCount", \r
281 function () {\r
282 var componentCount = 0;\r
283 if (this.$popupMenu != null) componentCount = this.$popupMenu.getComponentCount ();\r
284 return componentCount;\r
285 });\r
286 Clazz.defineMethod (c$, "getMenuComponent", \r
287 function (n) {\r
288 if (this.$popupMenu != null) return this.$popupMenu.getComponent (n);\r
289 return null;\r
290 }, "~N");\r
291 Clazz.defineMethod (c$, "getMenuComponents", \r
292 function () {\r
293 if (this.$popupMenu != null) return this.$popupMenu.getComponents ();\r
294 return  new Array (0);\r
295 });\r
296 Clazz.defineMethod (c$, "isTopLevelMenu", \r
297 function () {\r
298 if (Clazz.instanceOf (this.getParent (), javax.swing.JMenuBar)) return true;\r
299 return false;\r
300 });\r
301 Clazz.defineMethod (c$, "isMenuComponent", \r
302 function (c) {\r
303 if (c === this) return true;\r
304 if (Clazz.instanceOf (c, javax.swing.JPopupMenu)) {\r
305 var comp = c;\r
306 if (comp === this.getPopupMenu ()) return true;\r
307 }var ncomponents = this.getMenuComponentCount ();\r
308 var component = this.getMenuComponents ();\r
309 for (var i = 0; i < ncomponents; i++) {\r
310 var comp = component[i];\r
311 if (comp === c) return true;\r
312 if (Clazz.instanceOf (comp, javax.swing.JMenu)) {\r
313 var subMenu = comp;\r
314 if (subMenu.isMenuComponent (c)) return true;\r
315 }}\r
316 return false;\r
317 }, "java.awt.Component");\r
318 Clazz.defineMethod (c$, "getPopupMenu", \r
319 function () {\r
320 this.ensurePopupMenuCreated ();\r
321 return this.$popupMenu;\r
322 });\r
323 Clazz.defineMethod (c$, "addMenuListener", \r
324 function (l) {\r
325 this.listenerList.add (javax.swing.event.MenuListener, l);\r
326 }, "javax.swing.event.MenuListener");\r
327 Clazz.defineMethod (c$, "removeMenuListener", \r
328 function (l) {\r
329 this.listenerList.remove (javax.swing.event.MenuListener, l);\r
330 }, "javax.swing.event.MenuListener");\r
331 Clazz.defineMethod (c$, "getMenuListeners", \r
332 function () {\r
333 return this.listenerList.getListeners (javax.swing.event.MenuListener);\r
334 });\r
335 Clazz.defineMethod (c$, "fireMenuSelected", \r
336 function () {\r
337 var listeners = this.listenerList.getListenerList ();\r
338 for (var i = listeners.length - 2; i >= 0; i -= 2) {\r
339 if (listeners[i] === javax.swing.event.MenuListener) {\r
340 if (listeners[i + 1] == null) {\r
341 throw  new Error (this.getText () + " has a NULL Listener!! " + i);\r
342 } else {\r
343 if (this.menuEvent == null) this.menuEvent =  new javax.swing.event.MenuEvent (this);\r
344 (listeners[i + 1]).menuSelected (this.menuEvent);\r
345 }}}\r
346 });\r
347 Clazz.defineMethod (c$, "fireMenuDeselected", \r
348 function () {\r
349 var listeners = this.listenerList.getListenerList ();\r
350 for (var i = listeners.length - 2; i >= 0; i -= 2) {\r
351 if (listeners[i] === javax.swing.event.MenuListener) {\r
352 if (listeners[i + 1] == null) {\r
353 throw  new Error (this.getText () + " has a NULL Listener!! " + i);\r
354 } else {\r
355 if (this.menuEvent == null) this.menuEvent =  new javax.swing.event.MenuEvent (this);\r
356 (listeners[i + 1]).menuDeselected (this.menuEvent);\r
357 }}}\r
358 });\r
359 Clazz.defineMethod (c$, "fireMenuCanceled", \r
360 function () {\r
361 var listeners = this.listenerList.getListenerList ();\r
362 for (var i = listeners.length - 2; i >= 0; i -= 2) {\r
363 if (listeners[i] === javax.swing.event.MenuListener) {\r
364 if (listeners[i + 1] == null) {\r
365 throw  new Error (this.getText () + " has a NULL Listener!! " + i);\r
366 } else {\r
367 if (this.menuEvent == null) this.menuEvent =  new javax.swing.event.MenuEvent (this);\r
368 (listeners[i + 1]).menuCanceled (this.menuEvent);\r
369 }}}\r
370 });\r
371 Clazz.overrideMethod (c$, "configureAcceleratorFromAction", \r
372 function (a) {\r
373 }, "javax.swing.Action");\r
374 Clazz.defineMethod (c$, "createMenuChangeListener", \r
375  function () {\r
376 return Clazz.innerTypeInstance (javax.swing.JMenu.MenuChangeListener, this, null);\r
377 });\r
378 Clazz.defineMethod (c$, "createWinListener", \r
379 function (p) {\r
380 return Clazz.innerTypeInstance (javax.swing.JMenu.WinListener, this, null, p);\r
381 }, "javax.swing.JPopupMenu");\r
382 Clazz.overrideMethod (c$, "menuSelectionChanged", \r
383 function (isIncluded) {\r
384 this.setSelected (isIncluded);\r
385 }, "~B");\r
386 Clazz.overrideMethod (c$, "getSubElements", \r
387 function () {\r
388 if (this.$popupMenu == null) return  new Array (0);\r
389  else {\r
390 var result =  new Array (1);\r
391 result[0] = this.$popupMenu;\r
392 return result;\r
393 }});\r
394 Clazz.defineMethod (c$, "getComponent", \r
395 function () {\r
396 return this;\r
397 });\r
398 Clazz.defineMethod (c$, "applyComponentOrientation", \r
399 function (o) {\r
400 Clazz.superCall (this, javax.swing.JMenu, "applyComponentOrientation", [o]);\r
401 if (this.$popupMenu != null) {\r
402 var ncomponents = this.getMenuComponentCount ();\r
403 for (var i = 0; i < ncomponents; ++i) {\r
404 this.getMenuComponent (i).applyComponentOrientation (o);\r
405 }\r
406 this.$popupMenu.setComponentOrientation (o);\r
407 }}, "java.awt.ComponentOrientation");\r
408 Clazz.defineMethod (c$, "setComponentOrientation", \r
409 function (o) {\r
410 Clazz.superCall (this, javax.swing.JMenu, "setComponentOrientation", [o]);\r
411 if (this.$popupMenu != null) {\r
412 this.$popupMenu.setComponentOrientation (o);\r
413 }}, "java.awt.ComponentOrientation");\r
414 Clazz.overrideMethod (c$, "setAccelerator", \r
415 function (keyStroke) {\r
416 throw  new Error ("setAccelerator() is not defined for JMenu.  Use setMnemonic() instead.");\r
417 }, "javax.swing.KeyStroke");\r
418 Clazz.defineMethod (c$, "processKeyEvent", \r
419 function (evt) {\r
420 javax.swing.MenuSelectionManager.defaultManager ().processKeyEvent (evt);\r
421 if (evt.isConsumed ()) return;\r
422 Clazz.superCall (this, javax.swing.JMenu, "processKeyEvent", [evt]);\r
423 }, "java.awt.event.KeyEvent");\r
424 Clazz.defineMethod (c$, "doClick", \r
425 function (pressTime) {\r
426 var me = this.buildMenuElementArray (this);\r
427 javax.swing.MenuSelectionManager.defaultManager ().setSelectedPath (me);\r
428 }, "~N");\r
429 Clazz.defineMethod (c$, "buildMenuElementArray", \r
430  function (leaf) {\r
431 var elements =  new java.util.Vector ();\r
432 var current = leaf.getPopupMenu ();\r
433 var pop;\r
434 var menu;\r
435 var bar;\r
436 while (true) {\r
437 if (Clazz.instanceOf (current, javax.swing.JPopupMenu)) {\r
438 pop = current;\r
439 elements.insertElementAt (pop, 0);\r
440 current = pop.getInvoker ();\r
441 } else if (Clazz.instanceOf (current, javax.swing.JMenu)) {\r
442 menu = current;\r
443 elements.insertElementAt (menu, 0);\r
444 current = menu.getParent ();\r
445 } else if (Clazz.instanceOf (current, javax.swing.JMenuBar)) {\r
446 bar = current;\r
447 elements.insertElementAt (bar, 0);\r
448 var me =  new Array (elements.size ());\r
449 elements.copyInto (me);\r
450 return me;\r
451 }}\r
452 }, "javax.swing.JMenu");\r
453 c$.$JMenu$MenuChangeListener$ = function () {\r
454 Clazz.pu$h(self.c$);\r
455 c$ = Clazz.decorateAsClass (function () {\r
456 Clazz.prepareCallback (this, arguments);\r
457 this.isSelected = false;\r
458 Clazz.instantialize (this, arguments);\r
459 }, javax.swing.JMenu, "MenuChangeListener", null, javax.swing.event.ChangeListener);\r
460 Clazz.overrideMethod (c$, "stateChanged", \r
461 function (a) {\r
462 var b = a.getSource ();\r
463 var c = b.isSelected ();\r
464 if (c != this.isSelected) {\r
465 if (c == true) {\r
466 this.b$["javax.swing.JMenu"].fireMenuSelected ();\r
467 } else {\r
468 this.b$["javax.swing.JMenu"].fireMenuDeselected ();\r
469 }this.isSelected = c;\r
470 }}, "javax.swing.event.ChangeEvent");\r
471 c$ = Clazz.p0p ();\r
472 };\r
473 c$.$JMenu$WinListener$ = function () {\r
474 Clazz.pu$h(self.c$);\r
475 c$ = Clazz.decorateAsClass (function () {\r
476 Clazz.prepareCallback (this, arguments);\r
477 this.popupMenu = null;\r
478 Clazz.instantialize (this, arguments);\r
479 }, javax.swing.JMenu, "WinListener", java.awt.event.WindowAdapter);\r
480 Clazz.makeConstructor (c$, \r
481 function (a) {\r
482 Clazz.superConstructor (this, javax.swing.JMenu.WinListener, []);\r
483 this.popupMenu = a;\r
484 }, "javax.swing.JPopupMenu");\r
485 Clazz.overrideMethod (c$, "windowClosing", \r
486 function (a) {\r
487 this.b$["javax.swing.JMenu"].setSelected (false);\r
488 }, "java.awt.event.WindowEvent");\r
489 c$ = Clazz.p0p ();\r
490 };\r
491 c$.$JMenu$1$ = function () {\r
492 Clazz.pu$h(self.c$);\r
493 c$ = Clazz.declareAnonymous (javax.swing, "JMenu$1", javax.swing.JMenuItem);\r
494 Clazz.defineMethod (c$, "createActionPropertyChangeListener", \r
495 function (a) {\r
496 var pcl = this.b$["javax.swing.JMenu"].createActionChangeListener (this);\r
497 if (pcl == null) {\r
498 pcl = Clazz.superCall (this, javax.swing.JMenu$1, "createActionPropertyChangeListener", [a]);\r
499 }return pcl;\r
500 }, "javax.swing.Action");\r
501 c$ = Clazz.p0p ();\r
502 };\r
503 Clazz.defineStatics (c$,\r
504 "$$uiClassID", "MenuUI");\r
505 });\r