Class TeXIcon
java.lang.Object
org.scilab.forge.jlatexmath.TeXIcon
- All Implemented Interfaces:
Icon
An
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.
- Author:
- Kurt Vermeulen
-
Field Summary
FieldsModifier and TypeFieldDescriptionstatic floatbooleanstatic float -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionfloatgetBox()intGet the total height of the TeXIcon.intGet the total height of the TeXIcon.intGet the total width of the TeXIcon.Get the insets of the TeXIcon.floatGet the total height of the TeXIcon.floatfloatGet the total width of the TeXIcon.voidPaint theTeXFormulathat created this icon.voidsetForeground(Color fg) voidsetIconHeight(int height, int alignment) Change the height of the TeXIcon.voidsetIconWidth(int width, int alignment) Change the width of the TeXIcon.voidSet the insets of the TeXIcon.voidSet the insets of the TeXIcon.
-
Field Details
-
defaultSize
public static float defaultSize -
magFactor
public static float magFactor -
isColored
public boolean isColored
-
-
Constructor Details
-
TeXIcon
Creates a new icon that will paint the given formula box in the given point size.- Parameters:
b- the formula box to be paintedsize- the point size
-
TeXIcon
-
-
Method Details
-
setForeground
-
getInsets
-
setInsets
Set the insets of the TeXIcon.- Parameters:
insets- the insetstrueValues- true to force the true values
-
setInsets
-
setIconWidth
public void setIconWidth(int width, int alignment) Change the width of the TeXIcon. The new width must be greater than the current width, otherwise the icon will remain unchanged. The formula will be aligned to the left (TeXConstants.ALIGN_LEFT), to the right (TeXConstants.ALIGN_RIGHT) or will be centered in the middle (TeXConstants.ALIGN_CENTER).- Parameters:
width- the new width of the TeXIconalignment- a horizontal alignment constant: LEFT, RIGHT or CENTER
-
setIconHeight
public void setIconHeight(int height, int alignment) Change the height of the TeXIcon. The new height must be greater than the current height, otherwise the icon will remain unchanged. The formula will be aligned on top (TeXConstants.TOP), at the bottom (TeXConstants.BOTTOM) or will be centered in the middle (TeXConstants.CENTER).- Parameters:
height- the new height of the TeXIconalignment- a vertical alignment constant: TOP, BOTTOM or CENTER
-
getIconHeight
public int getIconHeight()Get the total height of the TeXIcon. This also includes the insets.- Specified by:
getIconHeightin interfaceIcon
-
getIconDepth
public int getIconDepth()Get the total height of the TeXIcon. This also includes the insets. -
getIconWidth
public int getIconWidth()Get the total width of the TeXIcon. This also includes the insets.- Specified by:
getIconWidthin interfaceIcon
-
getTrueIconHeight
public float getTrueIconHeight() -
getTrueIconDepth
public float getTrueIconDepth()Get the total height of the TeXIcon. This also includes the insets. -
getTrueIconWidth
public float getTrueIconWidth()Get the total width of the TeXIcon. This also includes the insets. -
getBaseLine
public float getBaseLine() -
getBox
-
paintIcon
Paint theTeXFormulathat created this icon.
-