uk.ac.starlink.xdoc.fig
Class StringDrawer
java.lang.Object
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. |
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
StringDrawer
public StringDrawer(Anchor anchor,
boolean clearBg,
float fontScale)
- Constructor.
- Parameters:
anchor
- positional anchor for stringclearBg
- true to clear the bounds of the string area to
the background colour (white) firstfontScale
- scales the font size; 1 is normal
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 contexttext
- text to writex
- anchor X coordinatey
- anchor Y coordinate
- Returns:
- bounding box for painted string
Copyright © 2015 Central Laboratory of the Research Councils. All Rights Reserved.