uk.ac.starlink.xdoc.fig
Class StringDrawer

java.lang.Object
  extended by uk.ac.starlink.xdoc.fig.StringDrawer

public class StringDrawer
extends Object

Object which can draw a string on a graphics context.

Since:
20 Sep 2007
Author:
Mark Taylor

Constructor Summary
StringDrawer(Anchor anchor, boolean clearBg, float fontScale)
          Constructor.
 
Method Summary
 Rectangle drawString(Graphics g, String text, int x, int y)
          Draws a string on the graphics context using the settings of this object.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

StringDrawer

public StringDrawer(Anchor anchor,
                    boolean clearBg,
                    float fontScale)
Constructor.

Parameters:
anchor - positional anchor for string
clearBg - true to clear the bounds of the string area to the background colour (white) first
fontScale - scales the font size; 1 is normal
Method Detail

drawString

public Rectangle drawString(Graphics g,
                            String text,
                            int x,
                            int y)
Draws a string on the graphics context using the settings of this object.

Parameters:
g - graphics context
text - text to write
x - anchor X coordinate
y - anchor Y coordinate
Returns:
bounding box for painted string


Copyright © 2015 Central Laboratory of the Research Councils. All Rights Reserved.