< prev index next >
src/java.desktop/share/classes/com/sun/java/swing/plaf/gtk/Metacity.java
Print this page
@@ -724,17 +724,19 @@
if (frame.isIconifiable()) {
width += buttonDim.width;
}
FontMetrics fm = frame.getFontMetrics(titlePane.getFont());
String frameTitle = frame.getTitle();
- int title_w = frameTitle != null ? SwingUtilities2.stringWidth(
+ int title_w = frameTitle != null ? SwingUtilities2
+ .getTextUIDrawing(frame).getStringWidth(
frame, fm, frameTitle) : 0;
int title_length = frameTitle != null ? frameTitle.length() : 0;
// Leave room for three characters in the title.
if (title_length > 3) {
- int subtitle_w = SwingUtilities2.stringWidth(
+ int subtitle_w = SwingUtilities2
+ .getTextUIDrawing(frame).getStringWidth(
frame, fm, frameTitle.substring(0, 3) + "...");
width += (title_w < subtitle_w) ? title_w : subtitle_w;
} else {
width += title_w;
}
@@ -998,14 +1000,16 @@
int y = aee.evaluate(getStringAttr(attrs, "y"));
String title = jif.getTitle();
if (title != null) {
FontMetrics fm = SwingUtilities2.getFontMetrics(jif, g);
- title = SwingUtilities2.clipStringIfNecessary(jif, fm, title,
+ title = SwingUtilities2.getTextUIDrawing(jif)
+ .getClippedString(jif, fm, title,
calculateTitleArea(jif).width);
g.setColor(color);
- SwingUtilities2.drawString(jif, g, title, x, y + fm.getAscent());
+ SwingUtilities2.getTextUIDrawing(jif)
+ .drawString(jif, g, title, x, y + fm.getAscent());
}
}
protected Dimension calculateButtonSize(JComponent titlePane) {
int buttonHeight = getInt("button_height");
@@ -1087,11 +1091,11 @@
protected int calculateTitleTextWidth(Graphics g, JInternalFrame jif) {
String title = jif.getTitle();
if (title != null) {
Rectangle r = calculateTitleArea(jif);
- return Math.min(SwingUtilities2.stringWidth(jif,
+ return Math.min(SwingUtilities2.getTextUIDrawing(jif).getStringWidth(jif,
SwingUtilities2.getFontMetrics(jif, g), title), r.width);
}
return 0;
}
< prev index next >