PennDraw.java
// dw controls the shift so this function can draw left, center, or right aligned text
dw controls the shift so this function can draw left, center, or right aligned text
dw controls the shift so this function can draw left center or right aligned text
private static void text(double x, double y, String s, double degrees, double dw) {
        AffineTransform t = (AffineTransform) offscreen.getTransform();
        FontMetrics metrics = offscreen.getFontMetrics();
        int w = metrics.stringWidth(s);
        int h = metrics.getDescent();
        double xs = scaleX(x);
        double ys = scaleY(y);
        if (degrees != 0) offscreen.rotate(-Math.toRadians(degrees), xs, ys);
        offscreen.drawString(s, (float) (xs + dw * w), (float) (ys + h));
        if (degrees != 0) offscreen.setTransform(t);
        draw();
    }
private static void text ( double x , double y , String s , double degrees , double dw ) { AffineTransform t = ( AffineTransform ) offscreen . getTransform ( ) ; FontMetrics metrics = offscreen . getFontMetrics ( ) ; int w = metrics . stringWidth ( s ) ; int h = metrics . getDescent ( ) ; double xs = scaleX ( x ) ; double ys = scaleY ( y ) ; if ( degrees != 0 ) offscreen . rotate ( - Math . toRadians ( degrees ) , xs , ys ) ; offscreen . drawString ( s , ( float ) ( xs + dw * w ) , ( float ) ( ys + h ) ) ; if ( degrees != 0 ) offscreen . setTransform ( t ) ; draw ( ) ; }
dw controls the shift so this function can draw left, center, or right aligned text
dw controls the shift so this function can draw left center or right aligned text