src/main/java/org/teachingextensions/logo/utils/MazeUtils/StdDraw.java
public static void text(double x, double y, String text)
  {
    if (text == null)
      throw new NullPointerException();
    offscreen.setFont(font);
    FontMetrics metrics = offscreen.getFontMetrics();
    double xs = scaleX(x);
    double ys = scaleY(y);
    int ws = metrics.stringWidth(text);
    int hs = metrics.getDescent();
    offscreen.drawString(text, (float) (xs - ws / 2.0), (float) (ys + hs));
    draw();
  }
public static void text(double x, double y, String text)
  {
    if (text == null)
      throw new NullPointerException();
    offscreen.setFont(font);
    FontMetrics metrics = offscreen.getFontMetrics();
    double xs = scaleX(x);
    double ys = scaleY(y);
    int ws = metrics.stringWidth(text);
    int hs = metrics.getDescent();
    offscreen.drawString(text, (float) (xs - ws / 2.0), (float) (ys + hs));
    draw();
  }
public static void text ( double x , double y , String text ) { if ( text == null ) throw new NullPointerException ( ) ; offscreen . setFont ( font ) ; FontMetrics metrics = offscreen . getFontMetrics ( ) ; double xs = scaleX ( x ) ; double ys = scaleY ( y ) ; int ws = metrics . stringWidth ( text ) ; int hs = metrics . getDescent ( ) ; offscreen . drawString ( text , ( float ) ( xs - ws / 2.0 ) , ( float ) ( ys + hs ) ) ; draw ( ) ; }
Write the given text string in the current font, centered at (<em>x</em>, <em>y</em>).

@param  x the center <em>x</em>-coordinate of the text
@param  y the center <em>y</em>-coordinate of the text
@param  text the text to write
Write the given text string in the current font centered at ( <em > x< / em > <em > y< / em > ) .