< prev index next >

src/java.desktop/macosx/classes/com/apple/laf/AquaTabbedPaneCopyFromBasicUI.java

Print this page

        

*** 210,219 **** --- 210,220 ---- } // UI Installation/De-installation public void installUI(final JComponent c) { + super.installUI(c); this.tabPane = (JTabbedPane)c; calculatedBaseline = false; rolloverTabIndex = -1; focusIndex = -1;
*** 825,835 **** if (tabPane.getTabComponentAt(tabIndex) == null) { String clippedTitle = title; if (scrollableTabLayoutEnabled() && tabScroller.croppedEdge.isParamsSet() && tabScroller.croppedEdge.getTabIndex() == tabIndex && isHorizontalTabPlacement()) { final int availTextWidth = tabScroller.croppedEdge.getCropline() - (textRect.x - tabRect.x) - tabScroller.croppedEdge.getCroppedSideWidth(); ! clippedTitle = SwingUtilities2.clipStringIfNecessary(null, metrics, title, availTextWidth); } paintText(g, tabPlacement, font, metrics, tabIndex, clippedTitle, textRect, isSelected); paintIcon(g, tabPlacement, tabIndex, icon, iconRect, isSelected); --- 826,836 ---- if (tabPane.getTabComponentAt(tabIndex) == null) { String clippedTitle = title; if (scrollableTabLayoutEnabled() && tabScroller.croppedEdge.isParamsSet() && tabScroller.croppedEdge.getTabIndex() == tabIndex && isHorizontalTabPlacement()) { final int availTextWidth = tabScroller.croppedEdge.getCropline() - (textRect.x - tabRect.x) - tabScroller.croppedEdge.getCroppedSideWidth(); ! clippedTitle = getTextUIDrawing().getClippedString(null, metrics, title, availTextWidth); } paintText(g, tabPlacement, font, metrics, tabIndex, clippedTitle, textRect, isSelected); paintIcon(g, tabPlacement, tabIndex, icon, iconRect, isSelected);
*** 1004,1020 **** if (selectedFG != null) { fg = selectedFG; } } g.setColor(fg); ! SwingUtilities2.drawStringUnderlineCharAt(tabPane, g, title, mnemIndex, textRect.x, textRect.y + metrics.getAscent()); } else { // tab disabled g.setColor(tabPane.getBackgroundAt(tabIndex).brighter()); ! SwingUtilities2.drawStringUnderlineCharAt(tabPane, g, title, mnemIndex, textRect.x, textRect.y + metrics.getAscent()); g.setColor(tabPane.getBackgroundAt(tabIndex).darker()); ! SwingUtilities2.drawStringUnderlineCharAt(tabPane, g, title, mnemIndex, textRect.x - 1, textRect.y + metrics.getAscent() - 1); } } } --- 1005,1021 ---- if (selectedFG != null) { fg = selectedFG; } } g.setColor(fg); ! getTextUIDrawing().drawStringUnderlineCharAt(tabPane, g, title, mnemIndex, textRect.x, textRect.y + metrics.getAscent()); } else { // tab disabled g.setColor(tabPane.getBackgroundAt(tabIndex).brighter()); ! getTextUIDrawing().drawStringUnderlineCharAt(tabPane, g, title, mnemIndex, textRect.x, textRect.y + metrics.getAscent()); g.setColor(tabPane.getBackgroundAt(tabIndex).darker()); ! getTextUIDrawing().drawStringUnderlineCharAt(tabPane, g, title, mnemIndex, textRect.x - 1, textRect.y + metrics.getAscent() - 1); } } }
*** 1637,1647 **** // html width += (int)v.getPreferredSpan(View.X_AXIS); } else { // plain text final String title = tabPane.getTitleAt(tabIndex); ! width += SwingUtilities2.stringWidth(tabPane, metrics, title); } } return width; } --- 1638,1648 ---- // html width += (int)v.getPreferredSpan(View.X_AXIS); } else { // plain text final String title = tabPane.getTitleAt(tabIndex); ! width += getTextUIDrawing().getStringWidth(tabPane, metrics, title); } } return width; }
< prev index next >