@Override protected Size2D arrangeFN(Graphics2D g2,double w){
  g2.setFont(getFont());
  FontMetrics fm=g2.getFontMetrics(getFont());
  Rectangle2D bounds=TextUtilities.getTextBounds(getText(),g2,fm);
  if (bounds.getWidth() <= w) {
    return new Size2D(w,bounds.getHeight());
  }
 else {
    return new Size2D(0.0,0.0);
  }
}

@ Override protected Size2D arrangeFN ( Graphics2D g2 , double w ) { g2 . setFont ( getFont ( ) ) ; FontMetrics fm = g2 . getFontMetrics ( getFont ( ) ) ; Rectangle2D bounds = TextUtilities . getTextBounds ( getText ( ) , g2 , fm ) ; if ( bounds . getWidth ( ) <= w ) { return new Size2D ( w , bounds . getHeight ( ) ) ; } else { return new Size2D ( 0.0 , 0.0 ) ; } }
arranges the content for this title assuming a fixed width and no bounds on the height , and returns the required size . this will reflect the fact that a text title positioned on the left or right of a chart will be rotated by 90 degrees .
