1 Clazz.declarePackage ("javax.swing");
\r
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 () {
\r
3 c$ = Clazz.decorateAsClass (function () {
\r
4 this.tabPlacement = 1;
\r
5 this.tabLayoutPolicy = 0;
\r
7 this.haveRegistered = false;
\r
8 this.changeListener = null;
\r
10 this.visComp = null;
\r
11 this.changeEvent = null;
\r
12 if (!Clazz.isClassDefined ("javax.swing.JTabbedPane.ModelListener")) {
\r
13 javax.swing.JTabbedPane.$JTabbedPane$ModelListener$ ();
\r
15 if (!Clazz.isClassDefined ("javax.swing.JTabbedPane.Page")) {
\r
16 javax.swing.JTabbedPane.$JTabbedPane$Page$ ();
\r
18 Clazz.instantialize (this, arguments);
\r
19 }, javax.swing, "JTabbedPane", javax.swing.JComponent, javax.swing.SwingConstants);
\r
20 Clazz.makeConstructor (c$,
\r
22 this.construct (1, 0);
\r
24 Clazz.makeConstructor (c$,
\r
25 function (tabPlacement) {
\r
26 this.construct (tabPlacement, 0);
\r
28 Clazz.makeConstructor (c$,
\r
29 function (tabPlacement, tabLayoutPolicy) {
\r
30 Clazz.superConstructor (this, javax.swing.JTabbedPane, []);
\r
31 this.setTabPlacement (tabPlacement);
\r
32 this.setTabLayoutPolicy (tabLayoutPolicy);
\r
33 this.pages = new java.util.ArrayList (1);
\r
34 this.setModel ( new javax.swing.DefaultSingleSelectionModel ());
\r
37 Clazz.overrideMethod (c$, "getUI",
\r
41 Clazz.defineMethod (c$, "setUI",
\r
43 Clazz.superCall (this, javax.swing.JTabbedPane, "setUI", [ui]);
\r
44 for (var i = 0; i < this.getTabCount (); i++) {
\r
45 var icon = this.pages.get (i).disabledIcon;
\r
46 if (Clazz.instanceOf (icon, javax.swing.plaf.UIResource)) {
\r
47 this.setDisabledIconAt (i, null);
\r
49 }, "javax.swing.plaf.TabbedPaneUI");
\r
50 Clazz.overrideMethod (c$, "updateUI",
\r
52 this.setUI (javax.swing.UIManager.getUI (this));
\r
54 Clazz.overrideMethod (c$, "getUIClassID",
\r
56 return "TabbedPaneUI";
\r
58 Clazz.defineMethod (c$, "createChangeListener",
\r
60 return Clazz.innerTypeInstance (javax.swing.JTabbedPane.ModelListener, this, null);
\r
62 Clazz.defineMethod (c$, "addChangeListener",
\r
64 this.listenerList.add (javax.swing.event.ChangeListener, l);
\r
65 }, "javax.swing.event.ChangeListener");
\r
66 Clazz.defineMethod (c$, "removeChangeListener",
\r
68 this.listenerList.remove (javax.swing.event.ChangeListener, l);
\r
69 }, "javax.swing.event.ChangeListener");
\r
70 Clazz.defineMethod (c$, "getChangeListeners",
\r
72 return this.listenerList.getListeners (javax.swing.event.ChangeListener);
\r
74 Clazz.defineMethod (c$, "fireStateChanged",
\r
76 var selIndex = this.getSelectedIndex ();
\r
78 if (this.visComp != null && this.visComp.isVisible ()) {
\r
79 this.visComp.setVisible (false);
\r
80 }this.visComp = null;
\r
82 var newComp = this.getComponentAt (selIndex);
\r
83 if (newComp != null && newComp !== this.visComp) {
\r
84 if (this.visComp != null) {
\r
85 if (this.visComp.isVisible ()) {
\r
86 this.visComp.setVisible (false);
\r
87 }}if (!newComp.isVisible ()) {
\r
88 newComp.setVisible (true);
\r
89 }this.visComp = newComp;
\r
90 }}var listeners = this.listenerList.getListenerList ();
\r
91 for (var i = listeners.length - 2; i >= 0; i -= 2) {
\r
92 if (listeners[i] === javax.swing.event.ChangeListener) {
\r
93 if (this.changeEvent == null) this.changeEvent = new javax.swing.event.ChangeEvent (this);
\r
94 (listeners[i + 1]).stateChanged (this.changeEvent);
\r
97 Clazz.defineMethod (c$, "getModel",
\r
101 Clazz.defineMethod (c$, "setModel",
\r
103 var oldModel = this.getModel ();
\r
104 if (oldModel != null) {
\r
105 oldModel.removeChangeListener (this.changeListener);
\r
106 this.changeListener = null;
\r
107 }this.model = model;
\r
108 if (model != null) {
\r
109 this.changeListener = this.createChangeListener ();
\r
110 model.addChangeListener (this.changeListener);
\r
111 }this.firePropertyChangeObject ("model", oldModel, model);
\r
113 }, "javax.swing.SingleSelectionModel");
\r
114 Clazz.defineMethod (c$, "getTabPlacement",
\r
116 return this.tabPlacement;
\r
118 Clazz.defineMethod (c$, "setTabPlacement",
\r
119 function (tabPlacement) {
\r
120 if (tabPlacement != 1 && tabPlacement != 2 && tabPlacement != 3 && tabPlacement != 4) {
\r
121 throw new IllegalArgumentException ("illegal tab placement: must be TOP, BOTTOM, LEFT, or RIGHT");
\r
122 }if (this.tabPlacement != tabPlacement) {
\r
123 var oldValue = this.tabPlacement;
\r
124 this.tabPlacement = tabPlacement;
\r
125 this.firePropertyChangeInt ("tabPlacement", oldValue, tabPlacement);
\r
126 this.revalidate ();
\r
129 Clazz.defineMethod (c$, "getTabLayoutPolicy",
\r
131 return this.tabLayoutPolicy;
\r
133 Clazz.defineMethod (c$, "setTabLayoutPolicy",
\r
134 function (tabLayoutPolicy) {
\r
135 if (tabLayoutPolicy != 0 && tabLayoutPolicy != 1) {
\r
136 throw new IllegalArgumentException ("illegal tab layout policy: must be WRAP_TAB_LAYOUT or SCROLL_TAB_LAYOUT");
\r
137 }if (this.tabLayoutPolicy != tabLayoutPolicy) {
\r
138 var oldValue = this.tabLayoutPolicy;
\r
139 this.tabLayoutPolicy = tabLayoutPolicy;
\r
140 this.firePropertyChangeInt ("tabLayoutPolicy", oldValue, tabLayoutPolicy);
\r
141 this.revalidate ();
\r
144 Clazz.defineMethod (c$, "getSelectedIndex",
\r
146 return this.model.getSelectedIndex ();
\r
148 Clazz.defineMethod (c$, "setSelectedIndex",
\r
151 this.checkIndex (index);
\r
152 }this.setSelectedIndexImpl (index, true);
\r
154 Clazz.defineMethod (c$, "setSelectedIndexImpl",
\r
155 function (index, doAccessibleChanges) {
\r
156 this.model.setSelectedIndex (index);
\r
158 Clazz.defineMethod (c$, "getSelectedComponent",
\r
160 var index = this.getSelectedIndex ();
\r
163 }return this.getComponentAt (index);
\r
165 Clazz.defineMethod (c$, "setSelectedComponent",
\r
167 var index = this.indexOfComponent (c);
\r
169 this.setSelectedIndex (index);
\r
171 throw new IllegalArgumentException ("component not found in tabbed pane");
\r
172 }}, "java.awt.Component");
\r
173 Clazz.defineMethod (c$, "insertTab",
\r
174 function (title, icon, component, tip, index) {
\r
175 var newIndex = index;
\r
176 var removeIndex = this.indexOfComponent (component);
\r
177 if (component != null && removeIndex != -1) {
\r
178 this.removeTabAt (removeIndex);
\r
179 if (newIndex > removeIndex) {
\r
181 }}var selectedIndex = this.getSelectedIndex ();
\r
182 this.pages.add (newIndex, Clazz.innerTypeInstance (javax.swing.JTabbedPane.Page, this, null, this, title != null ? title : "", icon, null, component, tip));
\r
183 if (component != null) {
\r
184 this.addImplSAEM (component, null, -1);
\r
185 component.setVisible (false);
\r
187 this.firePropertyChangeInt ("indexForNullComponent", -1, index);
\r
188 }if (this.pages.size () == 1) {
\r
189 this.setSelectedIndex (0);
\r
190 }if (selectedIndex >= newIndex) {
\r
191 this.setSelectedIndexImpl (selectedIndex + 1, false);
\r
192 }this.revalidate ();
\r
194 }, "~S,javax.swing.Icon,java.awt.Component,~S,~N");
\r
195 Clazz.defineMethod (c$, "addTab",
\r
196 function (title, icon, component, tip) {
\r
197 this.insertTab (title, icon, component, tip, this.pages.size ());
\r
198 }, "~S,javax.swing.Icon,java.awt.Component,~S");
\r
199 Clazz.defineMethod (c$, "addTab",
\r
200 function (title, icon, component) {
\r
201 this.insertTab (title, icon, component, null, this.pages.size ());
\r
202 }, "~S,javax.swing.Icon,java.awt.Component");
\r
203 Clazz.defineMethod (c$, "addTab",
\r
204 function (title, component) {
\r
205 this.insertTab (title, null, component, null, this.pages.size ());
\r
206 }, "~S,java.awt.Component");
\r
207 Clazz.defineMethod (c$, "add",
\r
208 function (component) {
\r
209 if (!(Clazz.instanceOf (component, javax.swing.plaf.UIResource))) {
\r
210 this.addTab (component.getName (), component);
\r
212 Clazz.superCall (this, javax.swing.JTabbedPane, "add", [component]);
\r
214 }, "java.awt.Component");
\r
215 Clazz.defineMethod (c$, "add",
\r
216 function (title, component) {
\r
217 if (!(Clazz.instanceOf (component, javax.swing.plaf.UIResource))) {
\r
218 this.addTab (title, component);
\r
220 Clazz.superCall (this, javax.swing.JTabbedPane, "add", [title, component]);
\r
222 }, "~S,java.awt.Component");
\r
223 Clazz.defineMethod (c$, "add",
\r
224 function (component, index) {
\r
225 if (!(Clazz.instanceOf (component, javax.swing.plaf.UIResource))) {
\r
226 this.insertTab (component.getName (), null, component, null, index == -1 ? this.getTabCount () : index);
\r
228 Clazz.superCall (this, javax.swing.JTabbedPane, "add", [component, index]);
\r
230 }, "java.awt.Component,~N");
\r
231 Clazz.defineMethod (c$, "add",
\r
232 function (component, constraints) {
\r
233 if (!(Clazz.instanceOf (component, javax.swing.plaf.UIResource))) {
\r
234 if (Clazz.instanceOf (constraints, String)) {
\r
235 this.addTab (constraints, component);
\r
236 } else if (Clazz.instanceOf (constraints, javax.swing.Icon)) {
\r
237 this.addTab (null, constraints, component);
\r
239 this.add (component);
\r
241 Clazz.superCall (this, javax.swing.JTabbedPane, "add", [component, constraints]);
\r
242 }}, "java.awt.Component,~O");
\r
243 Clazz.defineMethod (c$, "add",
\r
244 function (component, constraints, index) {
\r
245 if (!(Clazz.instanceOf (component, javax.swing.plaf.UIResource))) {
\r
246 var icon = Clazz.instanceOf (constraints, javax.swing.Icon) ? constraints : null;
\r
247 var title = Clazz.instanceOf (constraints, String) ? constraints : null;
\r
248 this.insertTab (title, icon, component, null, index == -1 ? this.getTabCount () : index);
\r
250 this.addImpl (component, constraints, index);
\r
252 }, "java.awt.Component,~O,~N");
\r
253 Clazz.defineMethod (c$, "removeTabAt",
\r
255 this.checkIndex (index);
\r
256 var component = this.getComponentAt (index);
\r
257 var selected = this.getSelectedIndex ();
\r
258 if (component === this.visComp) {
\r
259 this.visComp = null;
\r
260 }this.setTabComponentAt (index, null);
\r
261 this.pages.remove (index);
\r
262 this.putClientProperty ("__index_to_remove__", new Integer (index));
\r
263 if (selected > index) {
\r
264 this.setSelectedIndexImpl (selected - 1, false);
\r
265 } else if (selected >= this.getTabCount ()) {
\r
266 this.setSelectedIndexImpl (selected - 1, false);
\r
267 } else if (index == selected) {
\r
268 this.fireStateChanged ();
\r
269 }if (component != null) {
\r
270 var components = this.getComponents ();
\r
271 for (var i = components.length; --i >= 0; ) {
\r
272 if (components[i] === component) {
\r
273 Clazz.superCall (this, javax.swing.JTabbedPane, "remove", [i]);
\r
274 component.setVisible (true);
\r
277 }this.revalidate ();
\r
280 Clazz.defineMethod (c$, "remove",
\r
281 function (component) {
\r
282 var index = this.indexOfComponent (component);
\r
284 this.removeTabAt (index);
\r
286 var children = this.getComponents ();
\r
287 for (var i = 0; i < children.length; i++) {
\r
288 if (component === children[i]) {
\r
289 Clazz.superCall (this, javax.swing.JTabbedPane, "remove", [i]);
\r
292 }}, "java.awt.Component");
\r
293 Clazz.defineMethod (c$, "remove",
\r
295 this.removeTabAt (index);
\r
297 Clazz.overrideMethod (c$, "removeAll",
\r
299 this.setSelectedIndexImpl (-1, true);
\r
300 var tabCount = this.getTabCount ();
\r
301 while (tabCount-- > 0) {
\r
302 this.removeTabAt (tabCount);
\r
305 Clazz.defineMethod (c$, "getTabCount",
\r
307 return this.pages.size ();
\r
309 Clazz.defineMethod (c$, "getTabRunCount",
\r
311 if (this.ui != null) {
\r
312 return (this.ui).getTabRunCount (this);
\r
315 Clazz.defineMethod (c$, "getTitleAt",
\r
317 return this.pages.get (index).title;
\r
319 Clazz.defineMethod (c$, "getIconAt",
\r
321 return this.pages.get (index).icon;
\r
323 Clazz.defineMethod (c$, "getDisabledIconAt",
\r
325 var page = this.pages.get (index);
\r
326 if (page.disabledIcon == null) {
\r
327 page.disabledIcon = javax.swing.UIManager.getLookAndFeel ().getDisabledIcon (this, page.icon);
\r
328 }return page.disabledIcon;
\r
330 Clazz.defineMethod (c$, "getToolTipTextAt",
\r
332 return this.pages.get (index).tip;
\r
334 Clazz.defineMethod (c$, "getBackgroundAt",
\r
336 return this.pages.get (index).getBackground ();
\r
338 Clazz.defineMethod (c$, "getForegroundAt",
\r
340 return this.pages.get (index).getForeground ();
\r
342 Clazz.defineMethod (c$, "isEnabledAt",
\r
344 return this.pages.get (index).isEnabled ();
\r
346 Clazz.defineMethod (c$, "getComponentAt",
\r
348 return this.pages.get (index).component;
\r
350 Clazz.defineMethod (c$, "getMnemonicAt",
\r
351 function (tabIndex) {
\r
352 this.checkIndex (tabIndex);
\r
353 var page = this.pages.get (tabIndex);
\r
354 return page.getMnemonic ();
\r
356 Clazz.defineMethod (c$, "getDisplayedMnemonicIndexAt",
\r
357 function (tabIndex) {
\r
358 this.checkIndex (tabIndex);
\r
359 var page = this.pages.get (tabIndex);
\r
360 return page.getDisplayedMnemonicIndex ();
\r
362 Clazz.defineMethod (c$, "getBoundsAt",
\r
364 this.checkIndex (index);
\r
365 if (this.ui != null) {
\r
366 return (this.ui).getTabBounds (this, index);
\r
369 Clazz.defineMethod (c$, "setTitleAt",
\r
370 function (index, title) {
\r
371 var page = this.pages.get (index);
\r
372 var oldTitle = page.title;
\r
373 page.title = title;
\r
374 if (oldTitle !== title) {
\r
375 this.firePropertyChangeInt ("indexForTitle", -1, index);
\r
376 }page.updateDisplayedMnemonicIndex ();
\r
377 if (title == null || oldTitle == null || !title.equals (oldTitle)) {
\r
378 this.revalidate ();
\r
381 Clazz.defineMethod (c$, "setIconAt",
\r
382 function (index, icon) {
\r
383 var page = this.pages.get (index);
\r
384 var oldIcon = page.icon;
\r
385 if (icon !== oldIcon) {
\r
387 if (Clazz.instanceOf (page.disabledIcon, javax.swing.plaf.UIResource)) {
\r
388 page.disabledIcon = null;
\r
389 }this.revalidate ();
\r
391 }}, "~N,javax.swing.Icon");
\r
392 Clazz.defineMethod (c$, "setDisabledIconAt",
\r
393 function (index, disabledIcon) {
\r
394 var oldIcon = this.pages.get (index).disabledIcon;
\r
395 this.pages.get (index).disabledIcon = disabledIcon;
\r
396 if (disabledIcon !== oldIcon && !this.isEnabledAt (index)) {
\r
397 this.revalidate ();
\r
399 }}, "~N,javax.swing.Icon");
\r
400 Clazz.defineMethod (c$, "setToolTipTextAt",
\r
401 function (index, toolTipText) {
\r
402 this.pages.get (index).tip = toolTipText;
\r
404 Clazz.defineMethod (c$, "setBackgroundAt",
\r
405 function (index, background) {
\r
406 var oldBg = this.pages.get (index).background;
\r
407 this.pages.get (index).setBackground (background);
\r
408 if (background == null || oldBg == null || !background.equals (oldBg)) {
\r
409 var tabBounds = this.getBoundsAt (index);
\r
410 if (tabBounds != null) {
\r
411 this.repaint (tabBounds);
\r
412 }}}, "~N,java.awt.Color");
\r
413 Clazz.defineMethod (c$, "setForegroundAt",
\r
414 function (index, foreground) {
\r
415 var oldFg = this.pages.get (index).foreground;
\r
416 this.pages.get (index).setForeground (foreground);
\r
417 if (foreground == null || oldFg == null || !foreground.equals (oldFg)) {
\r
418 var tabBounds = this.getBoundsAt (index);
\r
419 if (tabBounds != null) {
\r
420 this.repaint (tabBounds);
\r
421 }}}, "~N,java.awt.Color");
\r
422 Clazz.defineMethod (c$, "setEnabledAt",
\r
423 function (index, enabled) {
\r
424 var oldEnabled = this.pages.get (index).isEnabled ();
\r
425 this.pages.get (index).setEnabled (enabled);
\r
426 if (enabled != oldEnabled) {
\r
427 this.revalidate ();
\r
430 Clazz.defineMethod (c$, "setComponentAt",
\r
431 function (index, component) {
\r
432 var page = this.pages.get (index);
\r
433 if (component !== page.component) {
\r
434 if (page.component != null) {
\r
436 var count = this.getComponentCount ();
\r
437 var children = this.getComponents ();
\r
438 for (var i = 0; i < count; i++) {
\r
439 if (children[i] === page.component) {
\r
440 Clazz.superCall (this, javax.swing.JTabbedPane, "remove", [i]);
\r
442 }}page.component = component;
\r
443 var selectedPage = (this.getSelectedIndex () == index);
\r
444 if (selectedPage) {
\r
445 this.visComp = component;
\r
446 }if (component != null) {
\r
447 component.setVisible (selectedPage);
\r
448 this.addImplSAEM (component, null, -1);
\r
451 }this.revalidate ();
\r
452 }}, "~N,java.awt.Component");
\r
453 Clazz.defineMethod (c$, "setDisplayedMnemonicIndexAt",
\r
454 function (tabIndex, mnemonicIndex) {
\r
455 this.checkIndex (tabIndex);
\r
456 var page = this.pages.get (tabIndex);
\r
457 page.setDisplayedMnemonicIndex (mnemonicIndex);
\r
459 Clazz.defineMethod (c$, "setMnemonicAt",
\r
460 function (tabIndex, mnemonic) {
\r
461 this.checkIndex (tabIndex);
\r
462 var page = this.pages.get (tabIndex);
\r
463 page.setMnemonic (mnemonic);
\r
464 this.firePropertyChangeObject ("mnemonicAt", null, null);
\r
466 Clazz.defineMethod (c$, "indexOfTab",
\r
468 for (var i = 0; i < this.getTabCount (); i++) {
\r
469 if (this.getTitleAt (i).equals (title == null ? "" : title)) {
\r
474 Clazz.defineMethod (c$, "indexOfTab",
\r
476 for (var i = 0; i < this.getTabCount (); i++) {
\r
477 var tabIcon = this.getIconAt (i);
\r
478 if ((tabIcon != null && tabIcon.equals (icon)) || (tabIcon == null && tabIcon === icon)) {
\r
482 }, "javax.swing.Icon");
\r
483 Clazz.defineMethod (c$, "indexOfComponent",
\r
484 function (component) {
\r
485 for (var i = 0; i < this.getTabCount (); i++) {
\r
486 var c = this.getComponentAt (i);
\r
487 if ((c != null && c.equals (component)) || (c == null && c === component)) {
\r
491 }, "java.awt.Component");
\r
492 Clazz.defineMethod (c$, "indexAtLocation",
\r
494 if (this.ui != null) {
\r
495 return (this.ui).tabForCoordinate (this, x, y);
\r
498 Clazz.defineMethod (c$, "getToolTipText",
\r
500 if (this.ui != null) {
\r
501 var index = (this.ui).tabForCoordinate (this, event.getX (), event.getY ());
\r
503 return this.pages.get (index).tip;
\r
504 }}return Clazz.superCall (this, javax.swing.JTabbedPane, "getToolTipText", [event]);
\r
505 }, "java.awt.event.MouseEvent");
\r
506 Clazz.defineMethod (c$, "checkIndex",
\r
508 if (index < 0 || index >= this.pages.size ()) {
\r
509 throw new IndexOutOfBoundsException ("Index: " + index + ", Tab count: " + this.pages.size ());
\r
511 Clazz.defineMethod (c$, "paramString",
\r
513 var tabPlacementString;
\r
514 if (this.tabPlacement == 1) {
\r
515 tabPlacementString = "TOP";
\r
516 } else if (this.tabPlacement == 3) {
\r
517 tabPlacementString = "BOTTOM";
\r
518 } else if (this.tabPlacement == 2) {
\r
519 tabPlacementString = "LEFT";
\r
520 } else if (this.tabPlacement == 4) {
\r
521 tabPlacementString = "RIGHT";
\r
522 } else tabPlacementString = "";
\r
523 var haveRegisteredString = (this.haveRegistered ? "true" : "false");
\r
524 return Clazz.superCall (this, javax.swing.JTabbedPane, "paramString", []) + ",haveRegistered=" + haveRegisteredString + ",tabPlacement=" + tabPlacementString;
\r
526 Clazz.defineMethod (c$, "setTabComponentAt",
\r
527 function (index, component) {
\r
528 if (component != null && this.indexOfComponent (component) != -1) {
\r
529 throw new IllegalArgumentException ("Component is already added to this JTabbedPane");
\r
530 }var oldValue = this.getTabComponentAt (index);
\r
531 if (component !== oldValue) {
\r
532 var tabComponentIndex = this.indexOfTabComponent (component);
\r
533 if (tabComponentIndex != -1) {
\r
534 this.setTabComponentAt (tabComponentIndex, null);
\r
535 }this.pages.get (index).tabComponent = component;
\r
536 this.firePropertyChangeInt ("indexForTabComponent", -1, index);
\r
537 }}, "~N,java.awt.Component");
\r
538 Clazz.defineMethod (c$, "getTabComponentAt",
\r
540 return this.pages.get (index).tabComponent;
\r
542 Clazz.defineMethod (c$, "indexOfTabComponent",
\r
543 function (tabComponent) {
\r
544 for (var i = 0; i < this.getTabCount (); i++) {
\r
545 var c = this.getTabComponentAt (i);
\r
546 if (c === tabComponent) {
\r
550 }, "java.awt.Component");
\r
551 c$.$JTabbedPane$ModelListener$ = function () {
\r
552 Clazz.pu$h(self.c$);
\r
553 c$ = Clazz.decorateAsClass (function () {
\r
554 Clazz.prepareCallback (this, arguments);
\r
555 Clazz.instantialize (this, arguments);
\r
556 }, javax.swing.JTabbedPane, "ModelListener", null, javax.swing.event.ChangeListener);
\r
557 Clazz.overrideMethod (c$, "stateChanged",
\r
559 this.b$["javax.swing.JTabbedPane"].fireStateChanged ();
\r
560 }, "javax.swing.event.ChangeEvent");
\r
563 c$.$JTabbedPane$Page$ = function () {
\r
564 Clazz.pu$h(self.c$);
\r
565 c$ = Clazz.decorateAsClass (function () {
\r
566 Clazz.prepareCallback (this, arguments);
\r
568 this.background = null;
\r
569 this.foreground = null;
\r
571 this.disabledIcon = null;
\r
572 this.parent = null;
\r
573 this.component = null;
\r
575 this.enabled = true;
\r
576 this.mnemonic = -1;
\r
577 this.mnemonicIndex = -1;
\r
578 this.tabComponent = null;
\r
579 Clazz.instantialize (this, arguments);
\r
580 }, javax.swing.JTabbedPane, "Page");
\r
581 Clazz.makeConstructor (c$,
\r
582 function (a, b, c, d, e, f) {
\r
585 this.disabledIcon = d;
\r
587 this.component = e;
\r
589 }, "javax.swing.JTabbedPane,~S,javax.swing.Icon,javax.swing.Icon,java.awt.Component,~S");
\r
590 Clazz.defineMethod (c$, "setMnemonic",
\r
593 this.updateDisplayedMnemonicIndex ();
\r
595 Clazz.defineMethod (c$, "getMnemonic",
\r
597 return this.mnemonic;
\r
599 Clazz.defineMethod (c$, "setDisplayedMnemonicIndex",
\r
601 if (this.mnemonicIndex != a) {
\r
602 if (a != -1 && (this.title == null || a < 0 || a >= this.title.length)) {
\r
603 throw new IllegalArgumentException ("Invalid mnemonic index: " + a);
\r
604 }this.mnemonicIndex = a;
\r
605 this.b$["javax.swing.JTabbedPane"].firePropertyChangeObject ("displayedMnemonicIndexAt", null, null);
\r
607 Clazz.defineMethod (c$, "getDisplayedMnemonicIndex",
\r
609 return this.mnemonicIndex;
\r
611 Clazz.defineMethod (c$, "updateDisplayedMnemonicIndex",
\r
613 this.setDisplayedMnemonicIndex (javax.swing.SwingUtilities.findDisplayedMnemonicIndex (this.title, this.mnemonic));
\r
615 Clazz.defineMethod (c$, "getBackground",
\r
617 return this.background != null ? this.background : this.parent.getBackground ();
\r
619 Clazz.defineMethod (c$, "setBackground",
\r
621 this.background = a;
\r
622 }, "java.awt.Color");
\r
623 Clazz.defineMethod (c$, "getForeground",
\r
625 return this.foreground != null ? this.foreground : this.parent.getForeground ();
\r
627 Clazz.defineMethod (c$, "setForeground",
\r
629 this.foreground = a;
\r
630 }, "java.awt.Color");
\r
631 Clazz.defineMethod (c$, "isEnabled",
\r
633 return this.enabled;
\r
635 Clazz.defineMethod (c$, "setEnabled",
\r
639 Clazz.defineMethod (c$, "isVisible",
\r
641 return this.parent.isVisible ();
\r
643 Clazz.defineMethod (c$, "setVisible",
\r
645 this.parent.setVisible (a);
\r
647 Clazz.defineMethod (c$, "isShowing",
\r
649 return this.parent.isShowing ();
\r
651 Clazz.defineMethod (c$, "contains",
\r
653 var b = this.getBounds ();
\r
654 return b.contains (a);
\r
655 }, "java.awt.Point");
\r
656 Clazz.defineMethod (c$, "getLocationOnScreen",
\r
658 var a = this.parent.getLocationOnScreen ();
\r
659 var b = this.getLocation ();
\r
660 b.translate (a.x, a.y);
\r
663 Clazz.defineMethod (c$, "getLocation",
\r
665 var a = this.getBounds ();
\r
666 return new java.awt.Point (a.x, a.y);
\r
668 Clazz.defineMethod (c$, "getBounds",
\r
670 return this.parent.getUI ().getTabBounds (this.parent, this.parent.indexOfTab (this.title));
\r
674 Clazz.defineStatics (c$,
\r
675 "WRAP_TAB_LAYOUT", 0,
\r
676 "SCROLL_TAB_LAYOUT", 1,
\r
677 "$uiClassID", "TabbedPaneUI");
\r