lib/browser/GraphBrowser/AWTFontMetrics.java
author wenzelm
Sat, 30 Nov 2013 15:05:10 +0100
changeset 54651 d71e7908eec3
parent 33686 8e33ca8832b1
permissions -rw-r--r--
more thorough read_pid with extra delay, to give external process a chance to write pid file before attempting to terminate it -- especially relevant for PIDE document processing, where interrupts can happen in the range of milliseconds;

/***************************************************************************
  Title:      GraphBrowser/AWTFontMetrics.java
  Author:     Gerwin Klein, TU Muenchen

  AbstractFontMetrics from the AWT for graphics mode.
  
***************************************************************************/

package GraphBrowser;

import java.awt.FontMetrics;

public class AWTFontMetrics implements AbstractFontMetrics {
  private FontMetrics fontMetrics;

  public AWTFontMetrics(FontMetrics m) {
    fontMetrics = m;
  }

  public int stringWidth(String str) {
    return fontMetrics.stringWidth(str);
  }

  public int getAscent() {
    return fontMetrics.getAscent();
  }

  public int getDescent() {
    return fontMetrics.getDescent();
  }
}