src/Tools/GraphBrowser/graphbrowser/AWTFontMetrics.java
changeset 74015 12b1f4649ab1
parent 74011 1d366486a812
equal deleted inserted replaced
74014:3b8b1da2ff29 74015:12b1f4649ab1
       
     1 /***************************************************************************
       
     2   Title:      graphbrowser/AWTFontMetrics.java
       
     3   Author:     Gerwin Klein, TU Muenchen
       
     4 
       
     5   AbstractFontMetrics from the AWT for graphics mode.
       
     6   
       
     7 ***************************************************************************/
       
     8 
       
     9 package isabelle.graphbrowser;
       
    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 }