|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
public interface Text
Text works using a Font, a size, a type (Normal, Bold...) and an alignment (Left, Centered, Right). It is also possible to change its foreground color.
Alignment
Field Summary | |
---|---|
static int |
BOLD
Bold text. |
static int |
ITALIC
Italic text. |
static int |
NORMAL
Normal text. |
Method Summary | |
---|---|
void |
draw(java.awt.Graphics2D g,
java.lang.String text,
int x,
int y,
Alignment alignment)
Renders text on graphic output, to the specified location and alignment. |
int |
getSize()
Get the text size in px (8px, 12px...). |
int |
getStringHeight(java.awt.Graphics2D g,
java.lang.String str)
Get string height size. |
int |
getStringWidth(java.awt.Graphics2D g,
java.lang.String str)
Get string width size. |
void |
setColor(java.awt.Color color)
Set the new text color value. |
Field Detail |
---|
static final int NORMAL
static final int ITALIC
static final int BOLD
Method Detail |
---|
void draw(java.awt.Graphics2D g, java.lang.String text, int x, int y, Alignment alignment)
g
- graphic output.text
- text string.x
- horizontal location.y
- vertical location.alignment
- alignement value (LEFT, CENTERED, RIGHT).void setColor(java.awt.Color color)
color
- color value.int getSize()
int getStringWidth(java.awt.Graphics2D g, java.lang.String str)
g
- graphic context.str
- input string.
int getStringHeight(java.awt.Graphics2D g, java.lang.String str)
g
- graphic context.str
- input string.
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |