public class TeXIcon
extends java.lang.Object
implements javax.swing.Icon
Icon
implementation that will paint the TeXFormula
that created it.
This class cannot be instantiated directly. It can be constructed from a
TeXFormula using the TeXFormula.createTeXIcon(int,float)
method.
Modifier and Type | Field and Description |
---|---|
static float |
defaultSize |
boolean |
isColored |
static float |
magFactor |
Modifier | Constructor and Description |
---|---|
protected |
TeXIcon(Box b,
float size)
Creates a new icon that will paint the given formula box in the given point size.
|
protected |
TeXIcon(Box b,
float size,
boolean trueValues) |
Modifier and Type | Method and Description |
---|---|
float |
getBaseLine() |
Box |
getBox() |
int |
getIconDepth()
Get the total height of the TeXIcon.
|
int |
getIconHeight()
Get the total height of the TeXIcon.
|
int |
getIconWidth()
Get the total width of the TeXIcon.
|
java.awt.Insets |
getInsets()
Get the insets of the TeXIcon.
|
float |
getTrueIconDepth()
Get the total height of the TeXIcon.
|
float |
getTrueIconHeight() |
float |
getTrueIconWidth()
Get the total width of the TeXIcon.
|
void |
paintIcon(java.awt.Component c,
java.awt.Graphics g,
int x,
int y)
Paint the
TeXFormula that created this icon. |
void |
setForeground(java.awt.Color fg) |
void |
setIconHeight(int height,
int alignment)
Change the height of the TeXIcon.
|
void |
setIconWidth(int width,
int alignment)
Change the width of the TeXIcon.
|
void |
setInsets(java.awt.Insets insets)
Set the insets of the TeXIcon.
|
void |
setInsets(java.awt.Insets insets,
boolean trueValues)
Set the insets of the TeXIcon.
|
public static float defaultSize
public static float magFactor
public boolean isColored
protected TeXIcon(Box b, float size)
b
- the formula box to be paintedsize
- the point sizeprotected TeXIcon(Box b, float size, boolean trueValues)
public void setForeground(java.awt.Color fg)
public java.awt.Insets getInsets()
public void setInsets(java.awt.Insets insets, boolean trueValues)
insets
- the insetstrueValues
- true to force the true valuespublic void setInsets(java.awt.Insets insets)
insets
- the insetspublic void setIconWidth(int width, int alignment)
width
- the new width of the TeXIconalignment
- a horizontal alignment constant: LEFT, RIGHT or CENTERpublic void setIconHeight(int height, int alignment)
height
- the new height of the TeXIconalignment
- a vertical alignment constant: TOP, BOTTOM or CENTERpublic int getIconHeight()
getIconHeight
in interface javax.swing.Icon
public int getIconDepth()
public int getIconWidth()
getIconWidth
in interface javax.swing.Icon
public float getTrueIconHeight()
public float getTrueIconDepth()
public float getTrueIconWidth()
public float getBaseLine()
public Box getBox()
public void paintIcon(java.awt.Component c, java.awt.Graphics g, int x, int y)
TeXFormula
that created this icon.paintIcon
in interface javax.swing.Icon