public class CustomVisualFormula extends CustomVisualObject
GraphView
.Modifier and Type | Field and Description |
---|---|
protected java.lang.String |
expression
the expression of the formula
|
protected Symbol |
formula
the icon representing the formula
|
background, foreground, height, width, x, y
Constructor and Description |
---|
CustomVisualFormula(java.lang.String expression,
int x,
int y)
Creates a new custom visual formula.
|
Modifier and Type | Method and Description |
---|---|
void |
draw(java.awt.Graphics2D g,
java.awt.Font f)
Draws the object.
|
java.lang.String |
getExpression()
Gets the latex expression of the formula that is painted.
|
int |
getHeight()
Gets the height of the object.
|
int |
getWidth()
Gets the width of the object.
|
void |
setExpression(java.lang.String expression)
Sets the latex expression of the formula that should be painted.
|
getBackground, getForeground, getX, getY, setBackground, setForeground, setHeight, setWidth, setX, setY
protected java.lang.String expression
protected Symbol formula
public CustomVisualFormula(java.lang.String expression, int x, int y) throws java.lang.IllegalArgumentException
expression
- the latex expression describing the formulax
- the x position of the string in the graphy
- the y position of the string in the graphjava.lang.IllegalArgumentException
- public java.lang.String getExpression()
public void setExpression(java.lang.String expression) throws java.lang.IllegalArgumentException
expression
- the latex expressionjava.lang.IllegalArgumentException
- public int getWidth()
CustomVisualObject
getWidth
in class CustomVisualObject
public int getHeight()
CustomVisualObject
getHeight
in class CustomVisualObject
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