< prev index next >
src/java.desktop/macosx/classes/com/apple/laf/AquaTabbedPaneCopyFromBasicUI.java
Print this page
@@ -210,10 +210,11 @@
}
// UI Installation/De-installation
public void installUI(final JComponent c) {
+ super.installUI(c);
this.tabPane = (JTabbedPane)c;
calculatedBaseline = false;
rolloverTabIndex = -1;
focusIndex = -1;
@@ -825,11 +826,11 @@
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);
+ clippedTitle = getTextUIDrawing().getClippedString(null, metrics, title, availTextWidth);
}
paintText(g, tabPlacement, font, metrics, tabIndex, clippedTitle, textRect, isSelected);
paintIcon(g, tabPlacement, tabIndex, icon, iconRect, isSelected);
@@ -1004,17 +1005,17 @@
if (selectedFG != null) {
fg = selectedFG;
}
}
g.setColor(fg);
- SwingUtilities2.drawStringUnderlineCharAt(tabPane, g, title, mnemIndex, textRect.x, textRect.y + metrics.getAscent());
+ getTextUIDrawing().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());
+ getTextUIDrawing().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);
+ getTextUIDrawing().drawStringUnderlineCharAt(tabPane, g, title, mnemIndex, textRect.x - 1, textRect.y + metrics.getAscent() - 1);
}
}
}
@@ -1637,11 +1638,11 @@
// html
width += (int)v.getPreferredSpan(View.X_AXIS);
} else {
// plain text
final String title = tabPane.getTitleAt(tabIndex);
- width += SwingUtilities2.stringWidth(tabPane, metrics, title);
+ width += getTextUIDrawing().getStringWidth(tabPane, metrics, title);
}
}
return width;
}
< prev index next >