public class CustomVisualText extends CustomVisualObject
GraphView
.background, foreground, height, width, x, y
Constructor and Description |
---|
CustomVisualText(java.lang.String text,
int x,
int y)
Creates a new custom visual text.
|
Modifier and Type | Method and Description |
---|---|
void |
draw(java.awt.Graphics2D g,
java.awt.Font f)
Draws the object.
|
java.lang.String |
getText()
Gets the text that is painted.
|
void |
setText(java.lang.String text)
Sets the text that should be painted.
|
getBackground, getForeground, getHeight, getWidth, getX, getY, setBackground, setForeground, setHeight, setWidth, setX, setY
public CustomVisualText(java.lang.String text, int x, int y) throws java.lang.IllegalArgumentException
text
- the textx
- the x position of the string in the graphy
- the y position of the string in the graphjava.lang.IllegalArgumentException
- public java.lang.String getText()
public void setText(java.lang.String text) throws java.lang.IllegalArgumentException
text
- the textjava.lang.IllegalArgumentException
- public void draw(java.awt.Graphics2D g, java.awt.Font f)
CustomVisualObject
draw
in class CustomVisualObject
g
- the graphics contextf
- the font of the graph view that is used to paint text