Rectangle rect = a.getBounds();
Rectangle rect = a instanceof Rectangle ? (Rectangle) a : a.getBounds();
  protected Rectangle lineToRect(Shape a, int line)  {    // Ensure metrics are up-to-date.    updateMetrics();        Rectangle rect = a.getBounds();    int fontHeight = metrics.getHeight();    return new Rectangle(rect.x, rect.y + (line * fontHeight),			 rect.width, fontHeight);  }