244 LookAndFeel.installColors(c,"ToolTip.backgroundInactive",
245 "ToolTip.foregroundInactive");
246 }
247 else {
248 LookAndFeel.installColors(c,"ToolTip.background",
249 "ToolTip.foreground");
250 }
251 } else {
252 LookAndFeel.installBorder(c, "ToolTip.border");
253 LookAndFeel.installColors(c, "ToolTip.background",
254 "ToolTip.foreground");
255 }
256 }
257
258
259 private static class PropertyChangeHandler implements
260 PropertyChangeListener {
261 public void propertyChange(PropertyChangeEvent e) {
262 String name = e.getPropertyName();
263 if (name.equals("tiptext") || "font".equals(name) ||
264 "foreground".equals(name)) {
265 // remove the old html view client property if one
266 // existed, and install a new one if the text installed
267 // into the JLabel is html source.
268 JToolTip tip = ((JToolTip) e.getSource());
269 String text = tip.getTipText();
270 BasicHTML.updateRenderer(tip, text);
271 }
272 else if ("component".equals(name)) {
273 JToolTip tip = ((JToolTip) e.getSource());
274
275 if (tip.getUI() instanceof BasicToolTipUI) {
276 ((BasicToolTipUI)tip.getUI()).componentChanged(tip);
277 }
278 }
279 }
280 }
281 }
|
244 LookAndFeel.installColors(c,"ToolTip.backgroundInactive",
245 "ToolTip.foregroundInactive");
246 }
247 else {
248 LookAndFeel.installColors(c,"ToolTip.background",
249 "ToolTip.foreground");
250 }
251 } else {
252 LookAndFeel.installBorder(c, "ToolTip.border");
253 LookAndFeel.installColors(c, "ToolTip.background",
254 "ToolTip.foreground");
255 }
256 }
257
258
259 private static class PropertyChangeHandler implements
260 PropertyChangeListener {
261 public void propertyChange(PropertyChangeEvent e) {
262 String name = e.getPropertyName();
263 if (name.equals("tiptext") || "font".equals(name) ||
264 "foreground".equals(name) ||
265 "ancestor" == name || "graphicsConfig" == name) {
266 // remove the old html view client property if one
267 // existed, and install a new one if the text installed
268 // into the JLabel is html source.
269 JToolTip tip = ((JToolTip) e.getSource());
270 String text = tip.getTipText();
271 BasicHTML.updateRenderer(tip, text);
272 }
273 else if ("component".equals(name)) {
274 JToolTip tip = ((JToolTip) e.getSource());
275
276 if (tip.getUI() instanceof BasicToolTipUI) {
277 ((BasicToolTipUI)tip.getUI()).componentChanged(tip);
278 }
279 }
280 }
281 }
282 }
|