9bca49afe57d0d356e4a36e5a8086e35db73d044
[jalviewjs.git] / site / j2s / javax / swing / JTabbedPane.js
1 Clazz.declarePackage ("javax.swing");
2 Clazz.load (["javax.swing.JComponent", "$.SwingConstants", "javax.swing.event.ChangeListener"], "javax.swing.JTabbedPane", ["java.lang.IllegalArgumentException", "$.IndexOutOfBoundsException", "java.util.ArrayList", "java.awt.Point", "javax.swing.DefaultSingleSelectionModel", "$.Icon", "$.SwingUtilities", "$.UIManager", "javax.swing.event.ChangeEvent", "javax.swing.plaf.UIResource"], function () {
3 c$ = Clazz.decorateAsClass (function () {
4 this.tabPlacement = 1;
5 this.tabLayoutPolicy = 0;
6 this.model = null;
7 this.haveRegistered = false;
8 this.changeListener = null;
9 this.pages = null;
10 this.visComp = null;
11 this.changeEvent = null;
12 if (!Clazz.isClassDefined ("javax.swing.JTabbedPane.ModelListener")) {
13 javax.swing.JTabbedPane.$JTabbedPane$ModelListener$ ();
14 }
15 if (!Clazz.isClassDefined ("javax.swing.JTabbedPane.Page")) {
16 javax.swing.JTabbedPane.$JTabbedPane$Page$ ();
17 }
18 Clazz.instantialize (this, arguments);
19 }, javax.swing, "JTabbedPane", javax.swing.JComponent, javax.swing.SwingConstants);
20 Clazz.makeConstructor (c$, 
21 function () {
22 this.construct (1, 0);
23 });
24 Clazz.makeConstructor (c$, 
25 function (tabPlacement) {
26 this.construct (tabPlacement, 0);
27 }, "~N");
28 Clazz.makeConstructor (c$, 
29 function (tabPlacement, tabLayoutPolicy) {
30 Clazz.superConstructor (this, javax.swing.JTabbedPane, []);
31 this.setTabPlacement (tabPlacement);
32 this.setTabLayoutPolicy (tabLayoutPolicy);
33 this.pages =  new java.util.ArrayList (1);
34 this.setModel ( new javax.swing.DefaultSingleSelectionModel ());
35 this.updateUI ();
36 }, "~N,~N");
37 Clazz.overrideMethod (c$, "getUI", 
38 function () {
39 return this.ui;
40 });
41 Clazz.defineMethod (c$, "setUI", 
42 function (ui) {
43 Clazz.superCall (this, javax.swing.JTabbedPane, "setUI", [ui]);
44 for (var i = 0; i < this.getTabCount (); i++) {
45 var icon = this.pages.get (i).disabledIcon;
46 if (Clazz.instanceOf (icon, javax.swing.plaf.UIResource)) {
47 this.setDisabledIconAt (i, null);
48 }}
49 }, "javax.swing.plaf.TabbedPaneUI");
50 Clazz.overrideMethod (c$, "updateUI", 
51 function () {
52 this.setUI (javax.swing.UIManager.getUI (this));
53 });
54 Clazz.overrideMethod (c$, "getUIClassID", 
55 function () {
56 return "TabbedPaneUI";
57 });
58 Clazz.defineMethod (c$, "createChangeListener", 
59 function () {
60 return Clazz.innerTypeInstance (javax.swing.JTabbedPane.ModelListener, this, null);
61 });
62 Clazz.defineMethod (c$, "addChangeListener", 
63 function (l) {
64 this.listenerList.add (javax.swing.event.ChangeListener, l);
65 }, "javax.swing.event.ChangeListener");
66 Clazz.defineMethod (c$, "removeChangeListener", 
67 function (l) {
68 this.listenerList.remove (javax.swing.event.ChangeListener, l);
69 }, "javax.swing.event.ChangeListener");
70 Clazz.defineMethod (c$, "getChangeListeners", 
71 function () {
72 return this.listenerList.getListeners (javax.swing.event.ChangeListener);
73 });
74 Clazz.defineMethod (c$, "fireStateChanged", 
75 function () {
76 var selIndex = this.getSelectedIndex ();
77 if (selIndex < 0) {
78 if (this.visComp != null && this.visComp.isVisible ()) {
79 this.visComp.setVisible (false);
80 }this.visComp = null;
81 } else {
82 var newComp = this.getComponentAt (selIndex);
83 if (newComp != null && newComp !== this.visComp) {
84 if (this.visComp != null) {
85 if (this.visComp.isVisible ()) {
86 this.visComp.setVisible (false);
87 }}if (!newComp.isVisible ()) {
88 newComp.setVisible (true);
89 }this.visComp = newComp;
90 }}var listeners = this.listenerList.getListenerList ();
91 for (var i = listeners.length - 2; i >= 0; i -= 2) {
92 if (listeners[i] === javax.swing.event.ChangeListener) {
93 if (this.changeEvent == null) this.changeEvent =  new javax.swing.event.ChangeEvent (this);
94 (listeners[i + 1]).stateChanged (this.changeEvent);
95 }}
96 });
97 Clazz.defineMethod (c$, "getModel", 
98 function () {
99 return this.model;
100 });
101 Clazz.defineMethod (c$, "setModel", 
102 function (model) {
103 var oldModel = this.getModel ();
104 if (oldModel != null) {
105 oldModel.removeChangeListener (this.changeListener);
106 this.changeListener = null;
107 }this.model = model;
108 if (model != null) {
109 this.changeListener = this.createChangeListener ();
110 model.addChangeListener (this.changeListener);
111 }this.firePropertyChangeObject ("model", oldModel, model);
112 this.repaint ();
113 }, "javax.swing.SingleSelectionModel");
114 Clazz.defineMethod (c$, "getTabPlacement", 
115 function () {
116 return this.tabPlacement;
117 });
118 Clazz.defineMethod (c$, "setTabPlacement", 
119 function (tabPlacement) {
120 if (tabPlacement != 1 && tabPlacement != 2 && tabPlacement != 3 && tabPlacement != 4) {
121 throw  new IllegalArgumentException ("illegal tab placement: must be TOP, BOTTOM, LEFT, or RIGHT");
122 }if (this.tabPlacement != tabPlacement) {
123 var oldValue = this.tabPlacement;
124 this.tabPlacement = tabPlacement;
125 this.firePropertyChangeInt ("tabPlacement", oldValue, tabPlacement);
126 this.revalidate ();
127 this.repaint ();
128 }}, "~N");
129 Clazz.defineMethod (c$, "getTabLayoutPolicy", 
130 function () {
131 return this.tabLayoutPolicy;
132 });
133 Clazz.defineMethod (c$, "setTabLayoutPolicy", 
134 function (tabLayoutPolicy) {
135 if (tabLayoutPolicy != 0 && tabLayoutPolicy != 1) {
136 throw  new IllegalArgumentException ("illegal tab layout policy: must be WRAP_TAB_LAYOUT or SCROLL_TAB_LAYOUT");
137 }if (this.tabLayoutPolicy != tabLayoutPolicy) {
138 var oldValue = this.tabLayoutPolicy;
139 this.tabLayoutPolicy = tabLayoutPolicy;
140 this.firePropertyChangeInt ("tabLayoutPolicy", oldValue, tabLayoutPolicy);
141 this.revalidate ();
142 this.repaint ();
143 }}, "~N");
144 Clazz.defineMethod (c$, "getSelectedIndex", 
145 function () {
146 return this.model.getSelectedIndex ();
147 });
148 Clazz.defineMethod (c$, "setSelectedIndex", 
149 function (index) {
150 if (index != -1) {
151 this.checkIndex (index);
152 }this.setSelectedIndexImpl (index, true);
153 }, "~N");
154 Clazz.defineMethod (c$, "setSelectedIndexImpl", 
155  function (index, doAccessibleChanges) {
156 this.model.setSelectedIndex (index);
157 }, "~N,~B");
158 Clazz.defineMethod (c$, "getSelectedComponent", 
159 function () {
160 var index = this.getSelectedIndex ();
161 if (index == -1) {
162 return null;
163 }return this.getComponentAt (index);
164 });
165 Clazz.defineMethod (c$, "setSelectedComponent", 
166 function (c) {
167 var index = this.indexOfComponent (c);
168 if (index != -1) {
169 this.setSelectedIndex (index);
170 } else {
171 throw  new IllegalArgumentException ("component not found in tabbed pane");
172 }}, "java.awt.Component");
173 Clazz.defineMethod (c$, "insertTab", 
174 function (title, icon, component, tip, index) {
175 var newIndex = index;
176 var removeIndex = this.indexOfComponent (component);
177 if (component != null && removeIndex != -1) {
178 this.removeTabAt (removeIndex);
179 if (newIndex > removeIndex) {
180 newIndex--;
181 }}var selectedIndex = this.getSelectedIndex ();
182 this.pages.add (newIndex, Clazz.innerTypeInstance (javax.swing.JTabbedPane.Page, this, null, this, title != null ? title : "", icon, null, component, tip));
183 if (component != null) {
184 this.addImplSAEM (component, null, -1);
185 component.setVisible (false);
186 } else {
187 this.firePropertyChangeInt ("indexForNullComponent", -1, index);
188 }if (this.pages.size () == 1) {
189 this.setSelectedIndex (0);
190 }if (selectedIndex >= newIndex) {
191 this.setSelectedIndexImpl (selectedIndex + 1, false);
192 }this.revalidate ();
193 this.repaint ();
194 }, "~S,javax.swing.Icon,java.awt.Component,~S,~N");
195 Clazz.defineMethod (c$, "addTab", 
196 function (title, icon, component, tip) {
197 this.insertTab (title, icon, component, tip, this.pages.size ());
198 }, "~S,javax.swing.Icon,java.awt.Component,~S");
199 Clazz.defineMethod (c$, "addTab", 
200 function (title, icon, component) {
201 this.insertTab (title, icon, component, null, this.pages.size ());
202 }, "~S,javax.swing.Icon,java.awt.Component");
203 Clazz.defineMethod (c$, "addTab", 
204 function (title, component) {
205 this.insertTab (title, null, component, null, this.pages.size ());
206 }, "~S,java.awt.Component");
207 Clazz.defineMethod (c$, "add", 
208 function (component) {
209 if (!(Clazz.instanceOf (component, javax.swing.plaf.UIResource))) {
210 this.addTab (component.getName (), component);
211 } else {
212 Clazz.superCall (this, javax.swing.JTabbedPane, "add", [component]);
213 }return component;
214 }, "java.awt.Component");
215 Clazz.defineMethod (c$, "add", 
216 function (title, component) {
217 if (!(Clazz.instanceOf (component, javax.swing.plaf.UIResource))) {
218 this.addTab (title, component);
219 } else {
220 Clazz.superCall (this, javax.swing.JTabbedPane, "add", [title, component]);
221 }return component;
222 }, "~S,java.awt.Component");
223 Clazz.defineMethod (c$, "add", 
224 function (component, index) {
225 if (!(Clazz.instanceOf (component, javax.swing.plaf.UIResource))) {
226 this.insertTab (component.getName (), null, component, null, index == -1 ? this.getTabCount () : index);
227 } else {
228 Clazz.superCall (this, javax.swing.JTabbedPane, "add", [component, index]);
229 }return component;
230 }, "java.awt.Component,~N");
231 Clazz.defineMethod (c$, "add", 
232 function (component, constraints) {
233 if (!(Clazz.instanceOf (component, javax.swing.plaf.UIResource))) {
234 if (Clazz.instanceOf (constraints, String)) {
235 this.addTab (constraints, component);
236 } else if (Clazz.instanceOf (constraints, javax.swing.Icon)) {
237 this.addTab (null, constraints, component);
238 } else {
239 this.add (component);
240 }} else {
241 Clazz.superCall (this, javax.swing.JTabbedPane, "add", [component, constraints]);
242 }}, "java.awt.Component,~O");
243 Clazz.defineMethod (c$, "add", 
244 function (component, constraints, index) {
245 if (!(Clazz.instanceOf (component, javax.swing.plaf.UIResource))) {
246 var icon = Clazz.instanceOf (constraints, javax.swing.Icon) ? constraints : null;
247 var title = Clazz.instanceOf (constraints, String) ? constraints : null;
248 this.insertTab (title, icon, component, null, index == -1 ? this.getTabCount () : index);
249 } else {
250 this.addImpl (component, constraints, index);
251 }return component;
252 }, "java.awt.Component,~O,~N");
253 Clazz.defineMethod (c$, "removeTabAt", 
254 function (index) {
255 this.checkIndex (index);
256 var component = this.getComponentAt (index);
257 var selected = this.getSelectedIndex ();
258 if (component === this.visComp) {
259 this.visComp = null;
260 }this.setTabComponentAt (index, null);
261 this.pages.remove (index);
262 this.putClientProperty ("__index_to_remove__",  new Integer (index));
263 if (selected > index) {
264 this.setSelectedIndexImpl (selected - 1, false);
265 } else if (selected >= this.getTabCount ()) {
266 this.setSelectedIndexImpl (selected - 1, false);
267 } else if (index == selected) {
268 this.fireStateChanged ();
269 }if (component != null) {
270 var components = this.getComponents ();
271 for (var i = components.length; --i >= 0; ) {
272 if (components[i] === component) {
273 Clazz.superCall (this, javax.swing.JTabbedPane, "remove", [i]);
274 component.setVisible (true);
275 break;
276 }}
277 }this.revalidate ();
278 this.repaint ();
279 }, "~N");
280 Clazz.defineMethod (c$, "remove", 
281 function (component) {
282 var index = this.indexOfComponent (component);
283 if (index != -1) {
284 this.removeTabAt (index);
285 } else {
286 var children = this.getComponents ();
287 for (var i = 0; i < children.length; i++) {
288 if (component === children[i]) {
289 Clazz.superCall (this, javax.swing.JTabbedPane, "remove", [i]);
290 break;
291 }}
292 }}, "java.awt.Component");
293 Clazz.defineMethod (c$, "remove", 
294 function (index) {
295 this.removeTabAt (index);
296 }, "~N");
297 Clazz.overrideMethod (c$, "removeAll", 
298 function () {
299 this.setSelectedIndexImpl (-1, true);
300 var tabCount = this.getTabCount ();
301 while (tabCount-- > 0) {
302 this.removeTabAt (tabCount);
303 }
304 });
305 Clazz.defineMethod (c$, "getTabCount", 
306 function () {
307 return this.pages.size ();
308 });
309 Clazz.defineMethod (c$, "getTabRunCount", 
310 function () {
311 if (this.ui != null) {
312 return (this.ui).getTabRunCount (this);
313 }return 0;
314 });
315 Clazz.defineMethod (c$, "getTitleAt", 
316 function (index) {
317 return this.pages.get (index).title;
318 }, "~N");
319 Clazz.defineMethod (c$, "getIconAt", 
320 function (index) {
321 return this.pages.get (index).icon;
322 }, "~N");
323 Clazz.defineMethod (c$, "getDisabledIconAt", 
324 function (index) {
325 var page = this.pages.get (index);
326 if (page.disabledIcon == null) {
327 page.disabledIcon = javax.swing.UIManager.getLookAndFeel ().getDisabledIcon (this, page.icon);
328 }return page.disabledIcon;
329 }, "~N");
330 Clazz.defineMethod (c$, "getToolTipTextAt", 
331 function (index) {
332 return this.pages.get (index).tip;
333 }, "~N");
334 Clazz.defineMethod (c$, "getBackgroundAt", 
335 function (index) {
336 return this.pages.get (index).getBackground ();
337 }, "~N");
338 Clazz.defineMethod (c$, "getForegroundAt", 
339 function (index) {
340 return this.pages.get (index).getForeground ();
341 }, "~N");
342 Clazz.defineMethod (c$, "isEnabledAt", 
343 function (index) {
344 return this.pages.get (index).isEnabled ();
345 }, "~N");
346 Clazz.defineMethod (c$, "getComponentAt", 
347 function (index) {
348 return this.pages.get (index).component;
349 }, "~N");
350 Clazz.defineMethod (c$, "getMnemonicAt", 
351 function (tabIndex) {
352 this.checkIndex (tabIndex);
353 var page = this.pages.get (tabIndex);
354 return page.getMnemonic ();
355 }, "~N");
356 Clazz.defineMethod (c$, "getDisplayedMnemonicIndexAt", 
357 function (tabIndex) {
358 this.checkIndex (tabIndex);
359 var page = this.pages.get (tabIndex);
360 return page.getDisplayedMnemonicIndex ();
361 }, "~N");
362 Clazz.defineMethod (c$, "getBoundsAt", 
363 function (index) {
364 this.checkIndex (index);
365 if (this.ui != null) {
366 return (this.ui).getTabBounds (this, index);
367 }return null;
368 }, "~N");
369 Clazz.defineMethod (c$, "setTitleAt", 
370 function (index, title) {
371 var page = this.pages.get (index);
372 var oldTitle = page.title;
373 page.title = title;
374 if (oldTitle !== title) {
375 this.firePropertyChangeInt ("indexForTitle", -1, index);
376 }page.updateDisplayedMnemonicIndex ();
377 if (title == null || oldTitle == null || !title.equals (oldTitle)) {
378 this.revalidate ();
379 this.repaint ();
380 }}, "~N,~S");
381 Clazz.defineMethod (c$, "setIconAt", 
382 function (index, icon) {
383 var page = this.pages.get (index);
384 var oldIcon = page.icon;
385 if (icon !== oldIcon) {
386 page.icon = icon;
387 if (Clazz.instanceOf (page.disabledIcon, javax.swing.plaf.UIResource)) {
388 page.disabledIcon = null;
389 }this.revalidate ();
390 this.repaint ();
391 }}, "~N,javax.swing.Icon");
392 Clazz.defineMethod (c$, "setDisabledIconAt", 
393 function (index, disabledIcon) {
394 var oldIcon = this.pages.get (index).disabledIcon;
395 this.pages.get (index).disabledIcon = disabledIcon;
396 if (disabledIcon !== oldIcon && !this.isEnabledAt (index)) {
397 this.revalidate ();
398 this.repaint ();
399 }}, "~N,javax.swing.Icon");
400 Clazz.defineMethod (c$, "setToolTipTextAt", 
401 function (index, toolTipText) {
402 this.pages.get (index).tip = toolTipText;
403 }, "~N,~S");
404 Clazz.defineMethod (c$, "setBackgroundAt", 
405 function (index, background) {
406 var oldBg = this.pages.get (index).background;
407 this.pages.get (index).setBackground (background);
408 if (background == null || oldBg == null || !background.equals (oldBg)) {
409 var tabBounds = this.getBoundsAt (index);
410 if (tabBounds != null) {
411 this.repaint (tabBounds);
412 }}}, "~N,java.awt.Color");
413 Clazz.defineMethod (c$, "setForegroundAt", 
414 function (index, foreground) {
415 var oldFg = this.pages.get (index).foreground;
416 this.pages.get (index).setForeground (foreground);
417 if (foreground == null || oldFg == null || !foreground.equals (oldFg)) {
418 var tabBounds = this.getBoundsAt (index);
419 if (tabBounds != null) {
420 this.repaint (tabBounds);
421 }}}, "~N,java.awt.Color");
422 Clazz.defineMethod (c$, "setEnabledAt", 
423 function (index, enabled) {
424 var oldEnabled = this.pages.get (index).isEnabled ();
425 this.pages.get (index).setEnabled (enabled);
426 if (enabled != oldEnabled) {
427 this.revalidate ();
428 this.repaint ();
429 }}, "~N,~B");
430 Clazz.defineMethod (c$, "setComponentAt", 
431 function (index, component) {
432 var page = this.pages.get (index);
433 if (component !== page.component) {
434 if (page.component != null) {
435 {
436 var count = this.getComponentCount ();
437 var children = this.getComponents ();
438 for (var i = 0; i < count; i++) {
439 if (children[i] === page.component) {
440 Clazz.superCall (this, javax.swing.JTabbedPane, "remove", [i]);
441 }}
442 }}page.component = component;
443 var selectedPage = (this.getSelectedIndex () == index);
444 if (selectedPage) {
445 this.visComp = component;
446 }if (component != null) {
447 component.setVisible (selectedPage);
448 this.addImplSAEM (component, null, -1);
449 } else {
450 this.repaint ();
451 }this.revalidate ();
452 }}, "~N,java.awt.Component");
453 Clazz.defineMethod (c$, "setDisplayedMnemonicIndexAt", 
454 function (tabIndex, mnemonicIndex) {
455 this.checkIndex (tabIndex);
456 var page = this.pages.get (tabIndex);
457 page.setDisplayedMnemonicIndex (mnemonicIndex);
458 }, "~N,~N");
459 Clazz.defineMethod (c$, "setMnemonicAt", 
460 function (tabIndex, mnemonic) {
461 this.checkIndex (tabIndex);
462 var page = this.pages.get (tabIndex);
463 page.setMnemonic (mnemonic);
464 this.firePropertyChangeObject ("mnemonicAt", null, null);
465 }, "~N,~N");
466 Clazz.defineMethod (c$, "indexOfTab", 
467 function (title) {
468 for (var i = 0; i < this.getTabCount (); i++) {
469 if (this.getTitleAt (i).equals (title == null ? "" : title)) {
470 return i;
471 }}
472 return -1;
473 }, "~S");
474 Clazz.defineMethod (c$, "indexOfTab", 
475 function (icon) {
476 for (var i = 0; i < this.getTabCount (); i++) {
477 var tabIcon = this.getIconAt (i);
478 if ((tabIcon != null && tabIcon.equals (icon)) || (tabIcon == null && tabIcon === icon)) {
479 return i;
480 }}
481 return -1;
482 }, "javax.swing.Icon");
483 Clazz.defineMethod (c$, "indexOfComponent", 
484 function (component) {
485 for (var i = 0; i < this.getTabCount (); i++) {
486 var c = this.getComponentAt (i);
487 if ((c != null && c.equals (component)) || (c == null && c === component)) {
488 return i;
489 }}
490 return -1;
491 }, "java.awt.Component");
492 Clazz.defineMethod (c$, "indexAtLocation", 
493 function (x, y) {
494 if (this.ui != null) {
495 return (this.ui).tabForCoordinate (this, x, y);
496 }return -1;
497 }, "~N,~N");
498 Clazz.defineMethod (c$, "getToolTipText", 
499 function (event) {
500 if (this.ui != null) {
501 var index = (this.ui).tabForCoordinate (this, event.getX (), event.getY ());
502 if (index != -1) {
503 return this.pages.get (index).tip;
504 }}return Clazz.superCall (this, javax.swing.JTabbedPane, "getToolTipText", [event]);
505 }, "java.awt.event.MouseEvent");
506 Clazz.defineMethod (c$, "checkIndex", 
507  function (index) {
508 if (index < 0 || index >= this.pages.size ()) {
509 throw  new IndexOutOfBoundsException ("Index: " + index + ", Tab count: " + this.pages.size ());
510 }}, "~N");
511 Clazz.defineMethod (c$, "paramString", 
512 function () {
513 var tabPlacementString;
514 if (this.tabPlacement == 1) {
515 tabPlacementString = "TOP";
516 } else if (this.tabPlacement == 3) {
517 tabPlacementString = "BOTTOM";
518 } else if (this.tabPlacement == 2) {
519 tabPlacementString = "LEFT";
520 } else if (this.tabPlacement == 4) {
521 tabPlacementString = "RIGHT";
522 } else tabPlacementString = "";
523 var haveRegisteredString = (this.haveRegistered ? "true" : "false");
524 return Clazz.superCall (this, javax.swing.JTabbedPane, "paramString", []) + ",haveRegistered=" + haveRegisteredString + ",tabPlacement=" + tabPlacementString;
525 });
526 Clazz.defineMethod (c$, "setTabComponentAt", 
527 function (index, component) {
528 if (component != null && this.indexOfComponent (component) != -1) {
529 throw  new IllegalArgumentException ("Component is already added to this JTabbedPane");
530 }var oldValue = this.getTabComponentAt (index);
531 if (component !== oldValue) {
532 var tabComponentIndex = this.indexOfTabComponent (component);
533 if (tabComponentIndex != -1) {
534 this.setTabComponentAt (tabComponentIndex, null);
535 }this.pages.get (index).tabComponent = component;
536 this.firePropertyChangeInt ("indexForTabComponent", -1, index);
537 }}, "~N,java.awt.Component");
538 Clazz.defineMethod (c$, "getTabComponentAt", 
539 function (index) {
540 return this.pages.get (index).tabComponent;
541 }, "~N");
542 Clazz.defineMethod (c$, "indexOfTabComponent", 
543 function (tabComponent) {
544 for (var i = 0; i < this.getTabCount (); i++) {
545 var c = this.getTabComponentAt (i);
546 if (c === tabComponent) {
547 return i;
548 }}
549 return -1;
550 }, "java.awt.Component");
551 c$.$JTabbedPane$ModelListener$ = function () {
552 Clazz.pu$h(self.c$);
553 c$ = Clazz.decorateAsClass (function () {
554 Clazz.prepareCallback (this, arguments);
555 Clazz.instantialize (this, arguments);
556 }, javax.swing.JTabbedPane, "ModelListener", null, javax.swing.event.ChangeListener);
557 Clazz.overrideMethod (c$, "stateChanged", 
558 function (a) {
559 this.b$["javax.swing.JTabbedPane"].fireStateChanged ();
560 }, "javax.swing.event.ChangeEvent");
561 c$ = Clazz.p0p ();
562 };
563 c$.$JTabbedPane$Page$ = function () {
564 Clazz.pu$h(self.c$);
565 c$ = Clazz.decorateAsClass (function () {
566 Clazz.prepareCallback (this, arguments);
567 this.title = null;
568 this.background = null;
569 this.foreground = null;
570 this.icon = null;
571 this.disabledIcon = null;
572 this.parent = null;
573 this.component = null;
574 this.tip = null;
575 this.enabled = true;
576 this.mnemonic = -1;
577 this.mnemonicIndex = -1;
578 this.tabComponent = null;
579 Clazz.instantialize (this, arguments);
580 }, javax.swing.JTabbedPane, "Page");
581 Clazz.makeConstructor (c$, 
582 function (a, b, c, d, e, f) {
583 this.title = b;
584 this.icon = c;
585 this.disabledIcon = d;
586 this.parent = a;
587 this.component = e;
588 this.tip = f;
589 }, "javax.swing.JTabbedPane,~S,javax.swing.Icon,javax.swing.Icon,java.awt.Component,~S");
590 Clazz.defineMethod (c$, "setMnemonic", 
591 function (a) {
592 this.mnemonic = a;
593 this.updateDisplayedMnemonicIndex ();
594 }, "~N");
595 Clazz.defineMethod (c$, "getMnemonic", 
596 function () {
597 return this.mnemonic;
598 });
599 Clazz.defineMethod (c$, "setDisplayedMnemonicIndex", 
600 function (a) {
601 if (this.mnemonicIndex != a) {
602 if (a != -1 && (this.title == null || a < 0 || a >= this.title.length)) {
603 throw  new IllegalArgumentException ("Invalid mnemonic index: " + a);
604 }this.mnemonicIndex = a;
605 this.b$["javax.swing.JTabbedPane"].firePropertyChangeObject ("displayedMnemonicIndexAt", null, null);
606 }}, "~N");
607 Clazz.defineMethod (c$, "getDisplayedMnemonicIndex", 
608 function () {
609 return this.mnemonicIndex;
610 });
611 Clazz.defineMethod (c$, "updateDisplayedMnemonicIndex", 
612 function () {
613 this.setDisplayedMnemonicIndex (javax.swing.SwingUtilities.findDisplayedMnemonicIndex (this.title, this.mnemonic));
614 });
615 Clazz.defineMethod (c$, "getBackground", 
616 function () {
617 return this.background != null ? this.background : this.parent.getBackground ();
618 });
619 Clazz.defineMethod (c$, "setBackground", 
620 function (a) {
621 this.background = a;
622 }, "java.awt.Color");
623 Clazz.defineMethod (c$, "getForeground", 
624 function () {
625 return this.foreground != null ? this.foreground : this.parent.getForeground ();
626 });
627 Clazz.defineMethod (c$, "setForeground", 
628 function (a) {
629 this.foreground = a;
630 }, "java.awt.Color");
631 Clazz.defineMethod (c$, "isEnabled", 
632 function () {
633 return this.enabled;
634 });
635 Clazz.defineMethod (c$, "setEnabled", 
636 function (a) {
637 this.enabled = a;
638 }, "~B");
639 Clazz.defineMethod (c$, "isVisible", 
640 function () {
641 return this.parent.isVisible ();
642 });
643 Clazz.defineMethod (c$, "setVisible", 
644 function (a) {
645 this.parent.setVisible (a);
646 }, "~B");
647 Clazz.defineMethod (c$, "isShowing", 
648 function () {
649 return this.parent.isShowing ();
650 });
651 Clazz.defineMethod (c$, "contains", 
652 function (a) {
653 var b = this.getBounds ();
654 return b.contains (a);
655 }, "java.awt.Point");
656 Clazz.defineMethod (c$, "getLocationOnScreen", 
657 function () {
658 var a = this.parent.getLocationOnScreen ();
659 var b = this.getLocation ();
660 b.translate (a.x, a.y);
661 return b;
662 });
663 Clazz.defineMethod (c$, "getLocation", 
664 function () {
665 var a = this.getBounds ();
666 return  new java.awt.Point (a.x, a.y);
667 });
668 Clazz.defineMethod (c$, "getBounds", 
669 function () {
670 return this.parent.getUI ().getTabBounds (this.parent, this.parent.indexOfTab (this.title));
671 });
672 c$ = Clazz.p0p ();
673 };
674 Clazz.defineStatics (c$,
675 "WRAP_TAB_LAYOUT", 0,
676 "SCROLL_TAB_LAYOUT", 1,
677 "$uiClassID", "TabbedPaneUI");
678 });