| 13970 |      1 | /***************************************************************************
 | 
|  |      2 |   Title:      GraphBrowser/AWTFontMetrics.java
 | 
|  |      3 |   Author:     Gerwin Klein, TU Muenchen
 | 
|  |      4 | 
 | 
|  |      5 |   AbstractFontMetrics from the AWT for graphics mode.
 | 
|  |      6 |   
 | 
|  |      7 | ***************************************************************************/
 | 
|  |      8 | 
 | 
| 13968 |      9 | package 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 | }
 |