author | peterz |
Tue, 21 Sep 2010 10:04:41 +0400 | |
changeset 6654 | 0fd919eec405 |
parent 6500 | 129126795742 |
child 7007 | 36b01e053bd7 |
permissions | -rw-r--r-- |
2 | 1 |
/* |
6500
129126795742
6915566: Closed swing tests failing with assert errors when run with -ea -esa
malenkov
parents:
5506
diff
changeset
|
2 |
* Copyright (c) 2002, 2010, Oracle and/or its affiliates. All rights reserved. |
2 | 3 |
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. |
4 |
* |
|
5 |
* This code is free software; you can redistribute it and/or modify it |
|
6 |
* under the terms of the GNU General Public License version 2 only, as |
|
5506 | 7 |
* published by the Free Software Foundation. Oracle designates this |
2 | 8 |
* particular file as subject to the "Classpath" exception as provided |
5506 | 9 |
* by Oracle in the LICENSE file that accompanied this code. |
2 | 10 |
* |
11 |
* This code is distributed in the hope that it will be useful, but WITHOUT |
|
12 |
* ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or |
|
13 |
* FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License |
|
14 |
* version 2 for more details (a copy is included in the LICENSE file that |
|
15 |
* accompanied this code). |
|
16 |
* |
|
17 |
* You should have received a copy of the GNU General Public License version |
|
18 |
* 2 along with this work; if not, write to the Free Software Foundation, |
|
19 |
* Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. |
|
20 |
* |
|
5506 | 21 |
* Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA |
22 |
* or visit www.oracle.com if you need additional information or have any |
|
23 |
* questions. |
|
2 | 24 |
*/ |
25 |
||
26 |
package javax.swing.plaf.synth; |
|
27 |
||
28 |
import javax.swing.*; |
|
29 |
import javax.swing.plaf.*; |
|
30 |
import javax.swing.plaf.basic.*; |
|
31 |
import javax.swing.text.View; |
|
32 |
||
33 |
import java.awt.*; |
|
34 |
import java.awt.event.*; |
|
35 |
import java.beans.PropertyChangeListener; |
|
36 |
import java.beans.PropertyChangeEvent; |
|
37 |
import sun.swing.SwingUtilities2; |
|
38 |
||
39 |
/** |
|
4394 | 40 |
* Provides the Synth L&F UI delegate for |
41 |
* {@link javax.swing.JTabbedPane}. |
|
42 |
* |
|
43 |
* <p>Looks up the {@code selectedTabPadInsets} property from the Style, |
|
44 |
* which represents additional insets for the selected tab. |
|
2 | 45 |
* |
46 |
* @author Scott Violet |
|
4394 | 47 |
* @since 1.7 |
2 | 48 |
*/ |
4394 | 49 |
public class SynthTabbedPaneUI extends BasicTabbedPaneUI |
50 |
implements PropertyChangeListener, SynthUI { |
|
51 |
||
2658 | 52 |
/** |
53 |
* <p>If non-zero, tabOverlap indicates the amount that the tab bounds |
|
54 |
* should be altered such that they would overlap with a tab on either the |
|
55 |
* leading or trailing end of a run (ie: in TOP, this would be on the left |
|
56 |
* or right).</p> |
|
57 |
||
58 |
* <p>A positive overlap indicates that tabs should overlap right/down, |
|
59 |
* while a negative overlap indicates tha tabs should overlap left/up.</p> |
|
60 |
* |
|
61 |
* <p>When tabOverlap is specified, it both changes the x position and width |
|
62 |
* of the tab if in TOP or BOTTOM placement, and changes the y position and |
|
63 |
* height if in LEFT or RIGHT placement.</p> |
|
64 |
* |
|
65 |
* <p>This is done for the following reason. Consider a run of 10 tabs. |
|
66 |
* There are 9 gaps between these tabs. If you specified a tabOverlap of |
|
67 |
* "-1", then each of the tabs "x" values will be shifted left. This leaves |
|
68 |
* 9 pixels of space to the right of the right-most tab unpainted. So, each |
|
69 |
* tab's width is also extended by 1 pixel to make up the difference.</p> |
|
70 |
* |
|
71 |
* <p>This property respects the RTL component orientation.</p> |
|
72 |
*/ |
|
73 |
private int tabOverlap = 0; |
|
74 |
||
75 |
/** |
|
76 |
* When a tabbed pane has multiple rows of tabs, this indicates whether |
|
77 |
* the tabs in the upper row(s) should extend to the base of the tab area, |
|
78 |
* or whether they should remain at their normal tab height. This does not |
|
79 |
* affect the bounds of the tabs, only the bounds of area painted by the |
|
80 |
* tabs. The text position does not change. The result is that the bottom |
|
81 |
* border of the upper row of tabs becomes fully obscured by the lower tabs, |
|
82 |
* resulting in a cleaner look. |
|
83 |
*/ |
|
84 |
private boolean extendTabsToBase = false; |
|
85 |
||
2 | 86 |
private SynthContext tabAreaContext; |
87 |
private SynthContext tabContext; |
|
88 |
private SynthContext tabContentContext; |
|
89 |
||
90 |
private SynthStyle style; |
|
91 |
private SynthStyle tabStyle; |
|
92 |
private SynthStyle tabAreaStyle; |
|
93 |
private SynthStyle tabContentStyle; |
|
94 |
||
4848
ffcc849b9351
6912118: Incosistency in several SynthUI classes between inherited specs ofupdate() and paint() methods
peterz
parents:
4394
diff
changeset
|
95 |
private Rectangle textRect = new Rectangle(); |
ffcc849b9351
6912118: Incosistency in several SynthUI classes between inherited specs ofupdate() and paint() methods
peterz
parents:
4394
diff
changeset
|
96 |
private Rectangle iconRect = new Rectangle(); |
2 | 97 |
|
98 |
private Rectangle tabAreaBounds = new Rectangle(); |
|
99 |
||
2658 | 100 |
//added for the Nimbus look and feel, where the tab area is painted differently depending on the |
101 |
//state for the selected tab |
|
102 |
private boolean tabAreaStatesMatchSelectedTab = false; |
|
103 |
//added for the Nimbus LAF to ensure that the labels don't move whether the tab is selected or not |
|
104 |
private boolean nudgeSelectedLabel = true; |
|
105 |
||
106 |
private boolean selectedTabIsPressed = false; |
|
107 |
||
4394 | 108 |
/** |
109 |
* Creates a new UI object for the given component. |
|
110 |
* |
|
111 |
* @param c component to create UI object for |
|
112 |
* @return the UI object |
|
113 |
*/ |
|
2 | 114 |
public static ComponentUI createUI(JComponent c) { |
115 |
return new SynthTabbedPaneUI(); |
|
116 |
} |
|
117 |
||
6654
0fd919eec405
6978052: No appropriate CCC request for listed JDK 7 changes in javax.swing.plaf.synth package (b84)
peterz
parents:
6500
diff
changeset
|
118 |
private SynthTabbedPaneUI() { |
0fd919eec405
6978052: No appropriate CCC request for listed JDK 7 changes in javax.swing.plaf.synth package (b84)
peterz
parents:
6500
diff
changeset
|
119 |
} |
0fd919eec405
6978052: No appropriate CCC request for listed JDK 7 changes in javax.swing.plaf.synth package (b84)
peterz
parents:
6500
diff
changeset
|
120 |
|
2 | 121 |
private boolean scrollableTabLayoutEnabled() { |
122 |
return (tabPane.getTabLayoutPolicy() == JTabbedPane.SCROLL_TAB_LAYOUT); |
|
123 |
} |
|
124 |
||
4394 | 125 |
/** |
126 |
* @inheritDoc |
|
127 |
*/ |
|
128 |
@Override |
|
2 | 129 |
protected void installDefaults() { |
130 |
updateStyle(tabPane); |
|
131 |
} |
|
132 |
||
133 |
private void updateStyle(JTabbedPane c) { |
|
134 |
SynthContext context = getContext(c, ENABLED); |
|
135 |
SynthStyle oldStyle = style; |
|
136 |
style = SynthLookAndFeel.updateStyle(context, this); |
|
137 |
// Add properties other than JComponent colors, Borders and |
|
138 |
// opacity settings here: |
|
139 |
if (style != oldStyle) { |
|
140 |
tabRunOverlay = |
|
141 |
style.getInt(context, "TabbedPane.tabRunOverlay", 0); |
|
2658 | 142 |
tabOverlap = style.getInt(context, "TabbedPane.tabOverlap", 0); |
143 |
extendTabsToBase = style.getBoolean(context, |
|
144 |
"TabbedPane.extendTabsToBase", false); |
|
2 | 145 |
textIconGap = style.getInt(context, "TabbedPane.textIconGap", 0); |
146 |
selectedTabPadInsets = (Insets)style.get(context, |
|
147 |
"TabbedPane.selectedTabPadInsets"); |
|
148 |
if (selectedTabPadInsets == null) { |
|
149 |
selectedTabPadInsets = new Insets(0, 0, 0, 0); |
|
150 |
} |
|
2658 | 151 |
tabAreaStatesMatchSelectedTab = style.getBoolean(context, |
152 |
"TabbedPane.tabAreaStatesMatchSelectedTab", false); |
|
153 |
nudgeSelectedLabel = style.getBoolean(context, |
|
154 |
"TabbedPane.nudgeSelectedLabel", true); |
|
2 | 155 |
if (oldStyle != null) { |
156 |
uninstallKeyboardActions(); |
|
157 |
installKeyboardActions(); |
|
158 |
} |
|
159 |
} |
|
160 |
context.dispose(); |
|
161 |
||
162 |
if (tabContext != null) { |
|
163 |
tabContext.dispose(); |
|
164 |
} |
|
165 |
tabContext = getContext(c, Region.TABBED_PANE_TAB, ENABLED); |
|
166 |
this.tabStyle = SynthLookAndFeel.updateStyle(tabContext, this); |
|
167 |
tabInsets = tabStyle.getInsets(tabContext, null); |
|
168 |
||
169 |
||
170 |
if (tabAreaContext != null) { |
|
171 |
tabAreaContext.dispose(); |
|
172 |
} |
|
173 |
tabAreaContext = getContext(c, Region.TABBED_PANE_TAB_AREA, ENABLED); |
|
174 |
this.tabAreaStyle = SynthLookAndFeel.updateStyle(tabAreaContext, this); |
|
175 |
tabAreaInsets = tabAreaStyle.getInsets(tabAreaContext, null); |
|
176 |
||
177 |
||
178 |
if (tabContentContext != null) { |
|
179 |
tabContentContext.dispose(); |
|
180 |
} |
|
181 |
tabContentContext = getContext(c, Region.TABBED_PANE_CONTENT, ENABLED); |
|
182 |
this.tabContentStyle = SynthLookAndFeel.updateStyle(tabContentContext, |
|
183 |
this); |
|
184 |
contentBorderInsets = |
|
185 |
tabContentStyle.getInsets(tabContentContext, null); |
|
186 |
} |
|
187 |
||
4394 | 188 |
/** |
189 |
* @inheritDoc |
|
190 |
*/ |
|
191 |
@Override |
|
2 | 192 |
protected void installListeners() { |
193 |
super.installListeners(); |
|
194 |
tabPane.addPropertyChangeListener(this); |
|
195 |
} |
|
196 |
||
4394 | 197 |
/** |
198 |
* @inheritDoc |
|
199 |
*/ |
|
200 |
@Override |
|
2 | 201 |
protected void uninstallListeners() { |
202 |
super.uninstallListeners(); |
|
203 |
tabPane.removePropertyChangeListener(this); |
|
204 |
} |
|
205 |
||
4394 | 206 |
/** |
207 |
* @inheritDoc |
|
208 |
*/ |
|
209 |
@Override |
|
2 | 210 |
protected void uninstallDefaults() { |
211 |
SynthContext context = getContext(tabPane, ENABLED); |
|
212 |
style.uninstallDefaults(context); |
|
213 |
context.dispose(); |
|
214 |
style = null; |
|
215 |
||
216 |
tabStyle.uninstallDefaults(tabContext); |
|
217 |
tabContext.dispose(); |
|
218 |
tabContext = null; |
|
219 |
tabStyle = null; |
|
220 |
||
221 |
tabAreaStyle.uninstallDefaults(tabAreaContext); |
|
222 |
tabAreaContext.dispose(); |
|
223 |
tabAreaContext = null; |
|
224 |
tabAreaStyle = null; |
|
225 |
||
226 |
tabContentStyle.uninstallDefaults(tabContentContext); |
|
227 |
tabContentContext.dispose(); |
|
228 |
tabContentContext = null; |
|
229 |
tabContentStyle = null; |
|
230 |
} |
|
231 |
||
4394 | 232 |
/** |
233 |
* @inheritDoc |
|
234 |
*/ |
|
235 |
@Override |
|
2 | 236 |
public SynthContext getContext(JComponent c) { |
4394 | 237 |
return getContext(c, SynthLookAndFeel.getComponentState(c)); |
2 | 238 |
} |
239 |
||
4394 | 240 |
private SynthContext getContext(JComponent c, int state) { |
2 | 241 |
return SynthContext.getContext(SynthContext.class, c, |
242 |
SynthLookAndFeel.getRegion(c),style, state); |
|
243 |
} |
|
244 |
||
245 |
private SynthContext getContext(JComponent c, Region subregion, int state){ |
|
246 |
SynthStyle style = null; |
|
247 |
Class klass = SynthContext.class; |
|
248 |
||
249 |
if (subregion == Region.TABBED_PANE_TAB) { |
|
250 |
style = tabStyle; |
|
251 |
} |
|
252 |
else if (subregion == Region.TABBED_PANE_TAB_AREA) { |
|
253 |
style = tabAreaStyle; |
|
254 |
} |
|
255 |
else if (subregion == Region.TABBED_PANE_CONTENT) { |
|
256 |
style = tabContentStyle; |
|
257 |
} |
|
258 |
return SynthContext.getContext(klass, c, subregion, style, state); |
|
259 |
} |
|
260 |
||
4394 | 261 |
/** |
262 |
* @inheritDoc |
|
263 |
*/ |
|
264 |
@Override |
|
2 | 265 |
protected JButton createScrollButton(int direction) { |
2658 | 266 |
// added for Nimbus LAF so that it can use the basic arrow buttons |
267 |
// UIManager is queried directly here because this is called before |
|
268 |
// updateStyle is called so the style can not be queried directly |
|
269 |
if (UIManager.getBoolean("TabbedPane.useBasicArrows")) { |
|
270 |
JButton btn = super.createScrollButton(direction); |
|
271 |
btn.setBorder(BorderFactory.createEmptyBorder()); |
|
272 |
return btn; |
|
273 |
} |
|
2 | 274 |
return new SynthScrollableTabButton(direction); |
275 |
} |
|
276 |
||
4394 | 277 |
/** |
278 |
* @inheritDoc |
|
279 |
*/ |
|
280 |
@Override |
|
2 | 281 |
public void propertyChange(PropertyChangeEvent e) { |
282 |
if (SynthLookAndFeel.shouldUpdateStyle(e)) { |
|
283 |
updateStyle(tabPane); |
|
284 |
} |
|
285 |
} |
|
286 |
||
2658 | 287 |
/** |
288 |
* @inheritDoc |
|
289 |
* |
|
290 |
* Overridden to keep track of whether the selected tab is also pressed. |
|
291 |
*/ |
|
292 |
@Override |
|
293 |
protected MouseListener createMouseListener() { |
|
294 |
final MouseListener delegate = super.createMouseListener(); |
|
295 |
final MouseMotionListener delegate2 = (MouseMotionListener)delegate; |
|
296 |
return new MouseListener() { |
|
297 |
public void mouseClicked(MouseEvent e) { delegate.mouseClicked(e); } |
|
298 |
public void mouseEntered(MouseEvent e) { delegate.mouseEntered(e); } |
|
299 |
public void mouseExited(MouseEvent e) { delegate.mouseExited(e); } |
|
300 |
||
301 |
public void mousePressed(MouseEvent e) { |
|
302 |
if (!tabPane.isEnabled()) { |
|
303 |
return; |
|
304 |
} |
|
305 |
||
306 |
int tabIndex = tabForCoordinate(tabPane, e.getX(), e.getY()); |
|
307 |
if (tabIndex >= 0 && tabPane.isEnabledAt(tabIndex)) { |
|
308 |
if (tabIndex == tabPane.getSelectedIndex()) { |
|
309 |
// Clicking on selected tab |
|
310 |
selectedTabIsPressed = true; |
|
311 |
//TODO need to just repaint the tab area! |
|
312 |
tabPane.repaint(); |
|
313 |
} |
|
314 |
} |
|
315 |
||
316 |
//forward the event (this will set the selected index, or none at all |
|
317 |
delegate.mousePressed(e); |
|
318 |
} |
|
319 |
||
320 |
public void mouseReleased(MouseEvent e) { |
|
321 |
if (selectedTabIsPressed) { |
|
322 |
selectedTabIsPressed = false; |
|
323 |
//TODO need to just repaint the tab area! |
|
324 |
tabPane.repaint(); |
|
325 |
} |
|
326 |
//forward the event |
|
327 |
delegate.mouseReleased(e); |
|
328 |
||
329 |
//hack: The super method *should* be setting the mouse-over property correctly |
|
330 |
//here, but it doesn't. That is, when the mouse is released, whatever tab is below the |
|
331 |
//released mouse should be in rollover state. But, if you select a tab and don't |
|
332 |
//move the mouse, this doesn't happen. Hence, forwarding the event. |
|
333 |
delegate2.mouseMoved(e); |
|
334 |
} |
|
335 |
}; |
|
336 |
} |
|
337 |
||
4394 | 338 |
/** |
339 |
* @inheritDoc |
|
340 |
*/ |
|
2658 | 341 |
@Override |
342 |
protected int getTabLabelShiftX(int tabPlacement, int tabIndex, boolean isSelected) { |
|
343 |
if (nudgeSelectedLabel) { |
|
344 |
return super.getTabLabelShiftX(tabPlacement, tabIndex, isSelected); |
|
345 |
} else { |
|
346 |
return 0; |
|
347 |
} |
|
348 |
} |
|
349 |
||
4394 | 350 |
/** |
351 |
* @inheritDoc |
|
352 |
*/ |
|
2658 | 353 |
@Override |
354 |
protected int getTabLabelShiftY(int tabPlacement, int tabIndex, boolean isSelected) { |
|
355 |
if (nudgeSelectedLabel) { |
|
356 |
return super.getTabLabelShiftY(tabPlacement, tabIndex, isSelected); |
|
357 |
} else { |
|
358 |
return 0; |
|
359 |
} |
|
360 |
} |
|
361 |
||
4394 | 362 |
/** |
4848
ffcc849b9351
6912118: Incosistency in several SynthUI classes between inherited specs ofupdate() and paint() methods
peterz
parents:
4394
diff
changeset
|
363 |
* Notifies this UI delegate to repaint the specified component. |
ffcc849b9351
6912118: Incosistency in several SynthUI classes between inherited specs ofupdate() and paint() methods
peterz
parents:
4394
diff
changeset
|
364 |
* This method paints the component background, then calls |
ffcc849b9351
6912118: Incosistency in several SynthUI classes between inherited specs ofupdate() and paint() methods
peterz
parents:
4394
diff
changeset
|
365 |
* the {@link #paint(SynthContext,Graphics)} method. |
ffcc849b9351
6912118: Incosistency in several SynthUI classes between inherited specs ofupdate() and paint() methods
peterz
parents:
4394
diff
changeset
|
366 |
* |
ffcc849b9351
6912118: Incosistency in several SynthUI classes between inherited specs ofupdate() and paint() methods
peterz
parents:
4394
diff
changeset
|
367 |
* <p>In general, this method does not need to be overridden by subclasses. |
ffcc849b9351
6912118: Incosistency in several SynthUI classes between inherited specs ofupdate() and paint() methods
peterz
parents:
4394
diff
changeset
|
368 |
* All Look and Feel rendering code should reside in the {@code paint} method. |
ffcc849b9351
6912118: Incosistency in several SynthUI classes between inherited specs ofupdate() and paint() methods
peterz
parents:
4394
diff
changeset
|
369 |
* |
ffcc849b9351
6912118: Incosistency in several SynthUI classes between inherited specs ofupdate() and paint() methods
peterz
parents:
4394
diff
changeset
|
370 |
* @param g the {@code Graphics} object used for painting |
ffcc849b9351
6912118: Incosistency in several SynthUI classes between inherited specs ofupdate() and paint() methods
peterz
parents:
4394
diff
changeset
|
371 |
* @param c the component being painted |
ffcc849b9351
6912118: Incosistency in several SynthUI classes between inherited specs ofupdate() and paint() methods
peterz
parents:
4394
diff
changeset
|
372 |
* @see #paint(SynthContext,Graphics) |
4394 | 373 |
*/ |
374 |
@Override |
|
2 | 375 |
public void update(Graphics g, JComponent c) { |
376 |
SynthContext context = getContext(c); |
|
377 |
||
378 |
SynthLookAndFeel.update(context, g); |
|
379 |
context.getPainter().paintTabbedPaneBackground(context, |
|
380 |
g, 0, 0, c.getWidth(), c.getHeight()); |
|
381 |
paint(context, g); |
|
382 |
context.dispose(); |
|
383 |
} |
|
384 |
||
4394 | 385 |
/** |
386 |
* @inheritDoc |
|
387 |
*/ |
|
388 |
@Override |
|
2 | 389 |
protected int getBaseline(int tab) { |
390 |
if (tabPane.getTabComponentAt(tab) != null || |
|
391 |
getTextViewForTab(tab) != null) { |
|
392 |
return super.getBaseline(tab); |
|
393 |
} |
|
394 |
String title = tabPane.getTitleAt(tab); |
|
395 |
Font font = tabContext.getStyle().getFont(tabContext); |
|
396 |
FontMetrics metrics = getFontMetrics(font); |
|
397 |
Icon icon = getIconForTab(tab); |
|
398 |
textRect.setBounds(0, 0, 0, 0); |
|
399 |
iconRect.setBounds(0, 0, 0, 0); |
|
400 |
calcRect.setBounds(0, 0, Short.MAX_VALUE, maxTabHeight); |
|
401 |
tabContext.getStyle().getGraphicsUtils(tabContext).layoutText( |
|
402 |
tabContext, metrics, title, icon, SwingUtilities.CENTER, |
|
403 |
SwingUtilities.CENTER, SwingUtilities.LEADING, |
|
2490
b460fb94812d
6815767: Bad parameter when calling another method in the class SynthTabbedPaneUI
peterz
parents:
2
diff
changeset
|
404 |
SwingUtilities.CENTER, calcRect, |
2 | 405 |
iconRect, textRect, textIconGap); |
406 |
return textRect.y + metrics.getAscent() + getBaselineOffset(); |
|
407 |
} |
|
408 |
||
4394 | 409 |
/** |
410 |
* @inheritDoc |
|
411 |
*/ |
|
412 |
@Override |
|
2 | 413 |
public void paintBorder(SynthContext context, Graphics g, int x, |
414 |
int y, int w, int h) { |
|
415 |
context.getPainter().paintTabbedPaneBorder(context, g, x, y, w, h); |
|
416 |
} |
|
417 |
||
4394 | 418 |
/** |
4848
ffcc849b9351
6912118: Incosistency in several SynthUI classes between inherited specs ofupdate() and paint() methods
peterz
parents:
4394
diff
changeset
|
419 |
* Paints the specified component according to the Look and Feel. |
ffcc849b9351
6912118: Incosistency in several SynthUI classes between inherited specs ofupdate() and paint() methods
peterz
parents:
4394
diff
changeset
|
420 |
* <p>This method is not used by Synth Look and Feel. |
ffcc849b9351
6912118: Incosistency in several SynthUI classes between inherited specs ofupdate() and paint() methods
peterz
parents:
4394
diff
changeset
|
421 |
* Painting is handled by the {@link #paint(SynthContext,Graphics)} method. |
ffcc849b9351
6912118: Incosistency in several SynthUI classes between inherited specs ofupdate() and paint() methods
peterz
parents:
4394
diff
changeset
|
422 |
* |
ffcc849b9351
6912118: Incosistency in several SynthUI classes between inherited specs ofupdate() and paint() methods
peterz
parents:
4394
diff
changeset
|
423 |
* @param g the {@code Graphics} object used for painting |
ffcc849b9351
6912118: Incosistency in several SynthUI classes between inherited specs ofupdate() and paint() methods
peterz
parents:
4394
diff
changeset
|
424 |
* @param c the component being painted |
ffcc849b9351
6912118: Incosistency in several SynthUI classes between inherited specs ofupdate() and paint() methods
peterz
parents:
4394
diff
changeset
|
425 |
* @see #paint(SynthContext,Graphics) |
4394 | 426 |
*/ |
427 |
@Override |
|
2 | 428 |
public void paint(Graphics g, JComponent c) { |
429 |
SynthContext context = getContext(c); |
|
430 |
||
431 |
paint(context, g); |
|
432 |
context.dispose(); |
|
433 |
} |
|
434 |
||
4394 | 435 |
/** |
436 |
* Paints the specified component. |
|
437 |
* |
|
438 |
* @param context context for the component being painted |
|
4848
ffcc849b9351
6912118: Incosistency in several SynthUI classes between inherited specs ofupdate() and paint() methods
peterz
parents:
4394
diff
changeset
|
439 |
* @param g the {@code Graphics} object used for painting |
ffcc849b9351
6912118: Incosistency in several SynthUI classes between inherited specs ofupdate() and paint() methods
peterz
parents:
4394
diff
changeset
|
440 |
* @see #update(Graphics,JComponent) |
4394 | 441 |
*/ |
2 | 442 |
protected void paint(SynthContext context, Graphics g) { |
443 |
int selectedIndex = tabPane.getSelectedIndex(); |
|
444 |
int tabPlacement = tabPane.getTabPlacement(); |
|
445 |
||
446 |
ensureCurrentLayout(); |
|
447 |
||
448 |
// Paint tab area |
|
449 |
// If scrollable tabs are enabled, the tab area will be |
|
450 |
// painted by the scrollable tab panel instead. |
|
451 |
// |
|
452 |
if (!scrollableTabLayoutEnabled()) { // WRAP_TAB_LAYOUT |
|
453 |
Insets insets = tabPane.getInsets(); |
|
454 |
int x = insets.left; |
|
455 |
int y = insets.top; |
|
456 |
int width = tabPane.getWidth() - insets.left - insets.right; |
|
457 |
int height = tabPane.getHeight() - insets.top - insets.bottom; |
|
458 |
int size; |
|
459 |
switch(tabPlacement) { |
|
460 |
case LEFT: |
|
461 |
width = calculateTabAreaWidth(tabPlacement, runCount, |
|
462 |
maxTabWidth); |
|
463 |
break; |
|
464 |
case RIGHT: |
|
465 |
size = calculateTabAreaWidth(tabPlacement, runCount, |
|
466 |
maxTabWidth); |
|
467 |
x = x + width - size; |
|
468 |
width = size; |
|
469 |
break; |
|
470 |
case BOTTOM: |
|
471 |
size = calculateTabAreaHeight(tabPlacement, runCount, |
|
472 |
maxTabHeight); |
|
473 |
y = y + height - size; |
|
474 |
height = size; |
|
475 |
break; |
|
476 |
case TOP: |
|
477 |
default: |
|
478 |
height = calculateTabAreaHeight(tabPlacement, runCount, |
|
479 |
maxTabHeight); |
|
480 |
} |
|
481 |
||
482 |
tabAreaBounds.setBounds(x, y, width, height); |
|
483 |
||
484 |
if (g.getClipBounds().intersects(tabAreaBounds)) { |
|
485 |
paintTabArea(tabAreaContext, g, tabPlacement, |
|
486 |
selectedIndex, tabAreaBounds); |
|
487 |
} |
|
488 |
} |
|
489 |
||
490 |
// Paint content border |
|
491 |
paintContentBorder(tabContentContext, g, tabPlacement, selectedIndex); |
|
492 |
} |
|
493 |
||
494 |
||
4394 | 495 |
private void paintTabArea(SynthContext ss, Graphics g, |
2 | 496 |
int tabPlacement, int selectedIndex, |
497 |
Rectangle tabAreaBounds) { |
|
498 |
Rectangle clipRect = g.getClipBounds(); |
|
499 |
||
2658 | 500 |
//if the tab area's states should match that of the selected tab, then |
501 |
//first update the selected tab's states, then set the state |
|
502 |
//for the tab area to match |
|
503 |
//otherwise, restore the tab area's state to ENABLED (which is the |
|
504 |
//only supported state otherwise). |
|
505 |
if (tabAreaStatesMatchSelectedTab && selectedIndex >= 0) { |
|
506 |
updateTabContext(selectedIndex, true, selectedTabIsPressed, |
|
507 |
(getRolloverTab() == selectedIndex), |
|
508 |
(getFocusIndex() == selectedIndex)); |
|
509 |
ss.setComponentState(tabContext.getComponentState()); |
|
510 |
} else { |
|
511 |
ss.setComponentState(SynthConstants.ENABLED); |
|
512 |
} |
|
513 |
||
2 | 514 |
// Paint the tab area. |
515 |
SynthLookAndFeel.updateSubregion(ss, g, tabAreaBounds); |
|
516 |
ss.getPainter().paintTabbedPaneTabAreaBackground(ss, g, |
|
517 |
tabAreaBounds.x, tabAreaBounds.y, tabAreaBounds.width, |
|
518 |
tabAreaBounds.height, tabPlacement); |
|
519 |
ss.getPainter().paintTabbedPaneTabAreaBorder(ss, g, tabAreaBounds.x, |
|
520 |
tabAreaBounds.y, tabAreaBounds.width, tabAreaBounds.height, |
|
521 |
tabPlacement); |
|
522 |
||
523 |
int tabCount = tabPane.getTabCount(); |
|
524 |
||
525 |
iconRect.setBounds(0, 0, 0, 0); |
|
526 |
textRect.setBounds(0, 0, 0, 0); |
|
527 |
||
528 |
// Paint tabRuns of tabs from back to front |
|
529 |
for (int i = runCount - 1; i >= 0; i--) { |
|
530 |
int start = tabRuns[i]; |
|
531 |
int next = tabRuns[(i == runCount - 1)? 0 : i + 1]; |
|
532 |
int end = (next != 0? next - 1: tabCount - 1); |
|
533 |
for (int j = start; j <= end; j++) { |
|
534 |
if (rects[j].intersects(clipRect) && selectedIndex != j) { |
|
535 |
paintTab(tabContext, g, tabPlacement, rects, j, iconRect, |
|
536 |
textRect); |
|
537 |
} |
|
538 |
} |
|
539 |
} |
|
540 |
||
541 |
if (selectedIndex >= 0) { |
|
542 |
if (rects[selectedIndex].intersects(clipRect)) { |
|
543 |
paintTab(tabContext, g, tabPlacement, rects, selectedIndex, |
|
544 |
iconRect, textRect); |
|
545 |
} |
|
546 |
} |
|
547 |
} |
|
548 |
||
4394 | 549 |
/** |
550 |
* @inheritDoc |
|
551 |
*/ |
|
552 |
@Override |
|
2 | 553 |
protected void setRolloverTab(int index) { |
554 |
int oldRolloverTab = getRolloverTab(); |
|
555 |
super.setRolloverTab(index); |
|
556 |
||
557 |
Rectangle r = null; |
|
558 |
||
2658 | 559 |
if (oldRolloverTab != index && tabAreaStatesMatchSelectedTab) { |
560 |
//TODO need to just repaint the tab area! |
|
561 |
tabPane.repaint(); |
|
562 |
} else { |
|
563 |
if ((oldRolloverTab >= 0) && (oldRolloverTab < tabPane.getTabCount())) { |
|
564 |
r = getTabBounds(tabPane, oldRolloverTab); |
|
565 |
if (r != null) { |
|
566 |
tabPane.repaint(r); |
|
567 |
} |
|
2 | 568 |
} |
569 |
||
2658 | 570 |
if (index >= 0) { |
571 |
r = getTabBounds(tabPane, index); |
|
572 |
if (r != null) { |
|
573 |
tabPane.repaint(r); |
|
574 |
} |
|
2 | 575 |
} |
576 |
} |
|
577 |
} |
|
578 |
||
4394 | 579 |
private void paintTab(SynthContext ss, Graphics g, |
2 | 580 |
int tabPlacement, Rectangle[] rects, int tabIndex, |
581 |
Rectangle iconRect, Rectangle textRect) { |
|
582 |
Rectangle tabRect = rects[tabIndex]; |
|
583 |
int selectedIndex = tabPane.getSelectedIndex(); |
|
584 |
boolean isSelected = selectedIndex == tabIndex; |
|
2658 | 585 |
updateTabContext(tabIndex, isSelected, isSelected && selectedTabIsPressed, |
586 |
(getRolloverTab() == tabIndex), |
|
587 |
(getFocusIndex() == tabIndex)); |
|
2 | 588 |
|
589 |
SynthLookAndFeel.updateSubregion(ss, g, tabRect); |
|
2658 | 590 |
int x = tabRect.x; |
591 |
int y = tabRect.y; |
|
592 |
int height = tabRect.height; |
|
593 |
int width = tabRect.width; |
|
594 |
int placement = tabPane.getTabPlacement(); |
|
595 |
if (extendTabsToBase && runCount > 1) { |
|
596 |
//paint this tab such that its edge closest to the base is equal to |
|
597 |
//edge of the selected tab closest to the base. In terms of the TOP |
|
598 |
//tab placement, this will cause the bottom of each tab to be |
|
599 |
//painted even with the bottom of the selected tab. This is because |
|
600 |
//in each tab placement (TOP, LEFT, BOTTOM, RIGHT) the selected tab |
|
601 |
//is closest to the base. |
|
602 |
if (selectedIndex >= 0) { |
|
603 |
Rectangle r = rects[selectedIndex]; |
|
604 |
switch (placement) { |
|
605 |
case TOP: |
|
606 |
int bottomY = r.y + r.height; |
|
607 |
height = bottomY - tabRect.y; |
|
608 |
break; |
|
609 |
case LEFT: |
|
610 |
int rightX = r.x + r.width; |
|
611 |
width = rightX - tabRect.x; |
|
612 |
break; |
|
613 |
case BOTTOM: |
|
614 |
int topY = r.y; |
|
615 |
height = (tabRect.y + tabRect.height) - topY; |
|
616 |
y = topY; |
|
617 |
break; |
|
618 |
case RIGHT: |
|
619 |
int leftX = r.x; |
|
620 |
width = (tabRect.x + tabRect.width) - leftX; |
|
621 |
x = leftX; |
|
622 |
break; |
|
623 |
} |
|
624 |
} |
|
625 |
} |
|
626 |
tabContext.getPainter().paintTabbedPaneTabBackground(tabContext, g, |
|
627 |
x, y, width, height, tabIndex, placement); |
|
2 | 628 |
tabContext.getPainter().paintTabbedPaneTabBorder(tabContext, g, |
2658 | 629 |
x, y, width, height, tabIndex, placement); |
2 | 630 |
|
631 |
if (tabPane.getTabComponentAt(tabIndex) == null) { |
|
632 |
String title = tabPane.getTitleAt(tabIndex); |
|
633 |
Font font = ss.getStyle().getFont(ss); |
|
634 |
FontMetrics metrics = SwingUtilities2.getFontMetrics(tabPane, g, font); |
|
635 |
Icon icon = getIconForTab(tabIndex); |
|
636 |
||
637 |
layoutLabel(ss, tabPlacement, metrics, tabIndex, title, icon, |
|
638 |
tabRect, iconRect, textRect, isSelected); |
|
639 |
||
640 |
paintText(ss, g, tabPlacement, font, metrics, |
|
641 |
tabIndex, title, textRect, isSelected); |
|
642 |
||
643 |
paintIcon(g, tabPlacement, tabIndex, icon, iconRect, isSelected); |
|
644 |
} |
|
645 |
} |
|
646 |
||
4394 | 647 |
private void layoutLabel(SynthContext ss, int tabPlacement, |
2 | 648 |
FontMetrics metrics, int tabIndex, |
649 |
String title, Icon icon, |
|
650 |
Rectangle tabRect, Rectangle iconRect, |
|
651 |
Rectangle textRect, boolean isSelected ) { |
|
652 |
View v = getTextViewForTab(tabIndex); |
|
653 |
if (v != null) { |
|
654 |
tabPane.putClientProperty("html", v); |
|
655 |
} |
|
656 |
||
657 |
textRect.x = textRect.y = iconRect.x = iconRect.y = 0; |
|
658 |
||
659 |
ss.getStyle().getGraphicsUtils(ss).layoutText(ss, metrics, title, |
|
660 |
icon, SwingUtilities.CENTER, SwingUtilities.CENTER, |
|
2490
b460fb94812d
6815767: Bad parameter when calling another method in the class SynthTabbedPaneUI
peterz
parents:
2
diff
changeset
|
661 |
SwingUtilities.LEADING, SwingUtilities.CENTER, |
2 | 662 |
tabRect, iconRect, textRect, textIconGap); |
663 |
||
664 |
tabPane.putClientProperty("html", null); |
|
665 |
||
666 |
int xNudge = getTabLabelShiftX(tabPlacement, tabIndex, isSelected); |
|
667 |
int yNudge = getTabLabelShiftY(tabPlacement, tabIndex, isSelected); |
|
668 |
iconRect.x += xNudge; |
|
669 |
iconRect.y += yNudge; |
|
670 |
textRect.x += xNudge; |
|
671 |
textRect.y += yNudge; |
|
672 |
} |
|
673 |
||
4394 | 674 |
private void paintText(SynthContext ss, |
2 | 675 |
Graphics g, int tabPlacement, |
676 |
Font font, FontMetrics metrics, int tabIndex, |
|
677 |
String title, Rectangle textRect, |
|
678 |
boolean isSelected) { |
|
679 |
g.setFont(font); |
|
680 |
||
681 |
View v = getTextViewForTab(tabIndex); |
|
682 |
if (v != null) { |
|
683 |
// html |
|
684 |
v.paint(g, textRect); |
|
685 |
} else { |
|
686 |
// plain text |
|
687 |
int mnemIndex = tabPane.getDisplayedMnemonicIndexAt(tabIndex); |
|
688 |
||
689 |
g.setColor(ss.getStyle().getColor(ss, ColorType.TEXT_FOREGROUND)); |
|
690 |
ss.getStyle().getGraphicsUtils(ss).paintText(ss, g, title, |
|
691 |
textRect, mnemIndex); |
|
692 |
} |
|
693 |
} |
|
694 |
||
695 |
||
4394 | 696 |
private void paintContentBorder(SynthContext ss, Graphics g, |
2 | 697 |
int tabPlacement, int selectedIndex) { |
698 |
int width = tabPane.getWidth(); |
|
699 |
int height = tabPane.getHeight(); |
|
700 |
Insets insets = tabPane.getInsets(); |
|
701 |
||
702 |
int x = insets.left; |
|
703 |
int y = insets.top; |
|
704 |
int w = width - insets.right - insets.left; |
|
705 |
int h = height - insets.top - insets.bottom; |
|
706 |
||
707 |
switch(tabPlacement) { |
|
708 |
case LEFT: |
|
709 |
x += calculateTabAreaWidth(tabPlacement, runCount, maxTabWidth); |
|
710 |
w -= (x - insets.left); |
|
711 |
break; |
|
712 |
case RIGHT: |
|
713 |
w -= calculateTabAreaWidth(tabPlacement, runCount, maxTabWidth); |
|
714 |
break; |
|
715 |
case BOTTOM: |
|
716 |
h -= calculateTabAreaHeight(tabPlacement, runCount, maxTabHeight); |
|
717 |
break; |
|
718 |
case TOP: |
|
719 |
default: |
|
720 |
y += calculateTabAreaHeight(tabPlacement, runCount, maxTabHeight); |
|
721 |
h -= (y - insets.top); |
|
722 |
} |
|
723 |
SynthLookAndFeel.updateSubregion(ss, g, new Rectangle(x, y, w, h)); |
|
724 |
ss.getPainter().paintTabbedPaneContentBackground(ss, g, x, y, |
|
725 |
w, h); |
|
726 |
ss.getPainter().paintTabbedPaneContentBorder(ss, g, x, y, w, h); |
|
727 |
} |
|
728 |
||
729 |
private void ensureCurrentLayout() { |
|
730 |
if (!tabPane.isValid()) { |
|
731 |
tabPane.validate(); |
|
732 |
} |
|
733 |
/* If tabPane doesn't have a peer yet, the validate() call will |
|
734 |
* silently fail. We handle that by forcing a layout if tabPane |
|
735 |
* is still invalid. See bug 4237677. |
|
736 |
*/ |
|
737 |
if (!tabPane.isValid()) { |
|
738 |
TabbedPaneLayout layout = (TabbedPaneLayout)tabPane.getLayout(); |
|
739 |
layout.calculateLayoutInfo(); |
|
740 |
} |
|
741 |
} |
|
742 |
||
4394 | 743 |
/** |
744 |
* @inheritDoc |
|
745 |
*/ |
|
746 |
@Override |
|
2 | 747 |
protected int calculateMaxTabHeight(int tabPlacement) { |
748 |
FontMetrics metrics = getFontMetrics(tabContext.getStyle().getFont( |
|
749 |
tabContext)); |
|
750 |
int tabCount = tabPane.getTabCount(); |
|
751 |
int result = 0; |
|
752 |
int fontHeight = metrics.getHeight(); |
|
753 |
for(int i = 0; i < tabCount; i++) { |
|
754 |
result = Math.max(calculateTabHeight(tabPlacement, i, fontHeight), result); |
|
755 |
} |
|
756 |
return result; |
|
757 |
} |
|
758 |
||
4394 | 759 |
/** |
760 |
* @inheritDoc |
|
761 |
*/ |
|
762 |
@Override |
|
2 | 763 |
protected int calculateTabWidth(int tabPlacement, int tabIndex, |
764 |
FontMetrics metrics) { |
|
765 |
Icon icon = getIconForTab(tabIndex); |
|
766 |
Insets tabInsets = getTabInsets(tabPlacement, tabIndex); |
|
767 |
int width = tabInsets.left + tabInsets.right; |
|
768 |
Component tabComponent = tabPane.getTabComponentAt(tabIndex); |
|
769 |
if (tabComponent != null) { |
|
770 |
width += tabComponent.getPreferredSize().width; |
|
771 |
} else { |
|
772 |
if (icon != null) { |
|
773 |
width += icon.getIconWidth() + textIconGap; |
|
774 |
} |
|
775 |
View v = getTextViewForTab(tabIndex); |
|
776 |
if (v != null) { |
|
777 |
// html |
|
778 |
width += (int) v.getPreferredSpan(View.X_AXIS); |
|
779 |
} else { |
|
780 |
// plain text |
|
781 |
String title = tabPane.getTitleAt(tabIndex); |
|
782 |
width += tabContext.getStyle().getGraphicsUtils(tabContext). |
|
783 |
computeStringWidth(tabContext, metrics.getFont(), |
|
784 |
metrics, title); |
|
785 |
} |
|
786 |
} |
|
787 |
return width; |
|
788 |
} |
|
789 |
||
4394 | 790 |
/** |
791 |
* @inheritDoc |
|
792 |
*/ |
|
793 |
@Override |
|
2 | 794 |
protected int calculateMaxTabWidth(int tabPlacement) { |
795 |
FontMetrics metrics = getFontMetrics(tabContext.getStyle().getFont( |
|
796 |
tabContext)); |
|
797 |
int tabCount = tabPane.getTabCount(); |
|
798 |
int result = 0; |
|
799 |
for(int i = 0; i < tabCount; i++) { |
|
800 |
result = Math.max(calculateTabWidth(tabPlacement, i, metrics), |
|
801 |
result); |
|
802 |
} |
|
803 |
return result; |
|
804 |
} |
|
805 |
||
4394 | 806 |
/** |
807 |
* @inheritDoc |
|
808 |
*/ |
|
809 |
@Override |
|
2 | 810 |
protected Insets getTabInsets(int tabPlacement, int tabIndex) { |
2658 | 811 |
updateTabContext(tabIndex, false, false, false, |
2 | 812 |
(getFocusIndex() == tabIndex)); |
813 |
return tabInsets; |
|
814 |
} |
|
815 |
||
4394 | 816 |
/** |
817 |
* @inheritDoc |
|
818 |
*/ |
|
819 |
@Override |
|
2 | 820 |
protected FontMetrics getFontMetrics() { |
821 |
return getFontMetrics(tabContext.getStyle().getFont(tabContext)); |
|
822 |
} |
|
823 |
||
4394 | 824 |
private FontMetrics getFontMetrics(Font font) { |
2 | 825 |
return tabPane.getFontMetrics(font); |
826 |
} |
|
827 |
||
828 |
private void updateTabContext(int index, boolean selected, |
|
2658 | 829 |
boolean isMouseDown, boolean isMouseOver, boolean hasFocus) { |
2 | 830 |
int state = 0; |
831 |
if (!tabPane.isEnabled() || !tabPane.isEnabledAt(index)) { |
|
832 |
state |= SynthConstants.DISABLED; |
|
833 |
if (selected) { |
|
834 |
state |= SynthConstants.SELECTED; |
|
835 |
} |
|
836 |
} |
|
837 |
else if (selected) { |
|
838 |
state |= (SynthConstants.ENABLED | SynthConstants.SELECTED); |
|
839 |
if (isMouseOver && UIManager.getBoolean("TabbedPane.isTabRollover")) { |
|
840 |
state |= SynthConstants.MOUSE_OVER; |
|
841 |
} |
|
842 |
} |
|
843 |
else if (isMouseOver) { |
|
844 |
state |= (SynthConstants.ENABLED | SynthConstants.MOUSE_OVER); |
|
845 |
} |
|
846 |
else { |
|
847 |
state = SynthLookAndFeel.getComponentState(tabPane); |
|
848 |
state &= ~SynthConstants.FOCUSED; // don't use tabbedpane focus state |
|
849 |
} |
|
850 |
if (hasFocus && tabPane.hasFocus()) { |
|
851 |
state |= SynthConstants.FOCUSED; // individual tab has focus |
|
852 |
} |
|
2658 | 853 |
if (isMouseDown) { |
854 |
state |= SynthConstants.PRESSED; |
|
855 |
} |
|
856 |
||
2 | 857 |
tabContext.setComponentState(state); |
858 |
} |
|
859 |
||
2658 | 860 |
/** |
861 |
* @inheritDoc |
|
862 |
* |
|
863 |
* Overridden to create a TabbedPaneLayout subclass which takes into |
|
864 |
* account tabOverlap. |
|
865 |
*/ |
|
4394 | 866 |
@Override |
867 |
protected LayoutManager createLayoutManager() { |
|
2658 | 868 |
if (tabPane.getTabLayoutPolicy() == JTabbedPane.SCROLL_TAB_LAYOUT) { |
869 |
return super.createLayoutManager(); |
|
870 |
} else { /* WRAP_TAB_LAYOUT */ |
|
871 |
return new TabbedPaneLayout() { |
|
872 |
@Override |
|
873 |
public void calculateLayoutInfo() { |
|
874 |
super.calculateLayoutInfo(); |
|
875 |
//shift all the tabs, if necessary |
|
876 |
if (tabOverlap != 0) { |
|
877 |
int tabCount = tabPane.getTabCount(); |
|
878 |
//left-to-right/right-to-left only affects layout |
|
879 |
//when placement is TOP or BOTTOM |
|
880 |
boolean ltr = tabPane.getComponentOrientation().isLeftToRight(); |
|
881 |
for (int i = runCount - 1; i >= 0; i--) { |
|
882 |
int start = tabRuns[i]; |
|
883 |
int next = tabRuns[(i == runCount - 1)? 0 : i + 1]; |
|
884 |
int end = (next != 0? next - 1: tabCount - 1); |
|
885 |
for (int j = start+1; j <= end; j++) { |
|
886 |
// xshift and yshift represent the amount & |
|
887 |
// direction to shift the tab in their |
|
888 |
// respective axis. |
|
889 |
int xshift = 0; |
|
890 |
int yshift = 0; |
|
891 |
// configure xshift and y shift based on tab |
|
892 |
// position and ltr/rtl |
|
893 |
switch (tabPane.getTabPlacement()) { |
|
894 |
case JTabbedPane.TOP: |
|
895 |
case JTabbedPane.BOTTOM: |
|
896 |
xshift = ltr ? tabOverlap : -tabOverlap; |
|
897 |
break; |
|
898 |
case JTabbedPane.LEFT: |
|
899 |
case JTabbedPane.RIGHT: |
|
900 |
yshift = tabOverlap; |
|
901 |
break; |
|
902 |
default: //do nothing |
|
903 |
} |
|
904 |
rects[j].x += xshift; |
|
905 |
rects[j].y += yshift; |
|
906 |
rects[j].width += Math.abs(xshift); |
|
907 |
rects[j].height += Math.abs(yshift); |
|
908 |
} |
|
909 |
} |
|
910 |
} |
|
911 |
} |
|
912 |
}; |
|
913 |
} |
|
914 |
} |
|
915 |
||
2 | 916 |
private class SynthScrollableTabButton extends SynthArrowButton implements |
917 |
UIResource { |
|
918 |
public SynthScrollableTabButton(int direction) { |
|
919 |
super(direction); |
|
6500
129126795742
6915566: Closed swing tests failing with assert errors when run with -ea -esa
malenkov
parents:
5506
diff
changeset
|
920 |
setName("TabbedPane.button"); |
2 | 921 |
} |
922 |
} |
|
923 |
} |