< prev index next >
src/java.desktop/share/classes/javax/swing/plaf/basic/BasicToolTipUI.java
Print this page
*** 71,80 ****
--- 71,81 ----
public BasicToolTipUI() {
super();
}
public void installUI(JComponent c) {
+ super.installUI(c);
installDefaults(c);
installComponents(c);
installListeners(c);
}
*** 171,181 ****
View v = (View) c.getClientProperty(BasicHTML.propertyKey);
if (v != null) {
v.paint(g, paintTextR);
} else {
g.setFont(font);
! SwingUtilities2.drawString(c, g, tipText, paintTextR.x,
paintTextR.y + metrics.getAscent());
}
}
public Dimension getPreferredSize(JComponent c) {
--- 172,182 ----
View v = (View) c.getClientProperty(BasicHTML.propertyKey);
if (v != null) {
v.paint(g, paintTextR);
} else {
g.setFont(font);
! getTextUIDrawing().drawString(c, g, tipText, paintTextR.x,
paintTextR.y + metrics.getAscent());
}
}
public Dimension getPreferredSize(JComponent c) {
*** 194,204 ****
View v = (c != null) ? (View) c.getClientProperty("html") : null;
if (v != null) {
prefSize.width += (int) v.getPreferredSpan(View.X_AXIS) + 6;
prefSize.height += (int) v.getPreferredSpan(View.Y_AXIS);
} else {
! prefSize.width += SwingUtilities2.stringWidth(c,fm,text) + 6;
prefSize.height += fm.getHeight();
}
}
return prefSize;
}
--- 195,205 ----
View v = (c != null) ? (View) c.getClientProperty("html") : null;
if (v != null) {
prefSize.width += (int) v.getPreferredSpan(View.X_AXIS) + 6;
prefSize.height += (int) v.getPreferredSpan(View.Y_AXIS);
} else {
! prefSize.width += getTextUIDrawing().getStringWidth(c,fm,text) + 6;
prefSize.height += fm.getHeight();
}
}
return prefSize;
}
< prev index next >