Example #1
0
 /**
  * Returns the baseline.
  *
  * @throws NullPointerException {@inheritDoc}
  * @throws IllegalArgumentException {@inheritDoc}
  * @see javax.swing.JComponent#getBaseline(int, int)
  * @since 1.6
  */
 public int getBaseline(JComponent c, int width, int height) {
   super.getBaseline(c, width, height);
   AbstractButton b = (AbstractButton) c;
   String text = b.getText();
   if (text == null || "".equals(text)) {
     return -1;
   }
   FontMetrics fm = b.getFontMetrics(b.getFont());
   layout(b, fm, width, height);
   return BasicHTML.getBaseline(b, textRect.y, fm.getAscent(), textRect.width, textRect.height);
 }
Example #2
0
 // ********************************
 //          Install PLAF
 // ********************************
 public void installUI(JComponent c) {
   installDefaults((AbstractButton) c);
   installListeners((AbstractButton) c);
   installKeyboardActions((AbstractButton) c);
   BasicHTML.updateRenderer(c, ((AbstractButton) c).getText());
 }
Example #3
0
 // ********************************
 //         Uninstall PLAF
 // ********************************
 public void uninstallUI(JComponent c) {
   uninstallKeyboardActions((AbstractButton) c);
   uninstallListeners((AbstractButton) c);
   uninstallDefaults((AbstractButton) c);
   BasicHTML.updateRenderer(c, "");
 }