public class StringPainter extends Object
Modifier and Type | Method and Description |
---|---|
static void |
computeOptimalSize(String string,
Font font,
Size size)
Computes the optimal size of a string.
|
static void |
drawStringAtPoint(GraphicsContext g,
String string,
Font font,
int anchorX,
int anchorY,
int horizontalAlignment,
int verticalAlignment)
Draws a string aligned with an anchor point.
|
static void |
drawStringInArea(GraphicsContext g,
String string,
Font font,
int x,
int y,
int width,
int height,
int horizontalAlignment,
int verticalAlignment)
Draws a string aligned in a area.
|
public static void computeOptimalSize(String string, Font font, Size size)
The given size is modified to set the optimal size.
string
- the string.font
- the font.size
- the size to modify.public static void drawStringAtPoint(GraphicsContext g, String string, Font font, int anchorX, int anchorY, int horizontalAlignment, int verticalAlignment)
g
- the graphics context.string
- the string.font
- the font.anchorX
- the anchor point x coordinate.anchorY
- the anchor point y coordinate.horizontalAlignment
- the horizontal alignment.verticalAlignment
- the vertical alignment.public static void drawStringInArea(GraphicsContext g, String string, Font font, int x, int y, int width, int height, int horizontalAlignment, int verticalAlignment)
g
- the graphics context.string
- the string.font
- the font.x
- the area x coordinate.y
- the area y coordinate.width
- the area width.height
- the area height.horizontalAlignment
- the horizontal alignment.verticalAlignment
- the vertical alignment.