| 
13970
 | 
     1  | 
/***************************************************************************
  | 
| 
74015
 | 
     2  | 
  Title:      graphbrowser/AWTFontMetrics.java
  | 
| 
13970
 | 
     3  | 
  Author:     Gerwin Klein, TU Muenchen
  | 
| 
 | 
     4  | 
  | 
| 
 | 
     5  | 
  AbstractFontMetrics from the AWT for graphics mode.
  | 
| 
 | 
     6  | 
  
  | 
| 
 | 
     7  | 
***************************************************************************/
  | 
| 
 | 
     8  | 
  | 
| 
74015
 | 
     9  | 
package isabelle.graphbrowser;
  | 
| 
13968
 | 
    10  | 
  | 
| 
 | 
    11  | 
import java.awt.FontMetrics;
  | 
| 
 | 
    12  | 
  | 
| 
 | 
    13  | 
public class AWTFontMetrics implements AbstractFontMetrics {
 | 
| 
 | 
    14  | 
  private FontMetrics fontMetrics;
  | 
| 
 | 
    15  | 
  | 
| 
 | 
    16  | 
  public AWTFontMetrics(FontMetrics m) {
 | 
| 
 | 
    17  | 
    fontMetrics = m;
  | 
| 
 | 
    18  | 
  }
  | 
| 
 | 
    19  | 
  | 
| 
 | 
    20  | 
  public int stringWidth(String str) {
 | 
| 
 | 
    21  | 
    return fontMetrics.stringWidth(str);
  | 
| 
 | 
    22  | 
  }
  | 
| 
 | 
    23  | 
  | 
| 
 | 
    24  | 
  public int getAscent() {
 | 
| 
 | 
    25  | 
    return fontMetrics.getAscent();
  | 
| 
 | 
    26  | 
  }
  | 
| 
 | 
    27  | 
  | 
| 
 | 
    28  | 
  public int getDescent() {
 | 
| 
 | 
    29  | 
    return fontMetrics.getDescent();
  | 
| 
 | 
    30  | 
  }
  | 
| 
 | 
    31  | 
}
  |