Package org.scilab.forge.jlatexmath
Class TeXFormula.TeXIconBuilder
- java.lang.Object
-
- org.scilab.forge.jlatexmath.TeXFormula.TeXIconBuilder
-
- Enclosing class:
- TeXFormula
public class TeXFormula.TeXIconBuilder extends java.lang.Object
Apply the Builder pattern instead of using the createTeXIcon(...) factories- Author:
- Felix Natter
-
-
Constructor Summary
Constructors Constructor Description TeXIconBuilder()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description TeXIcon
build()
Create a TeXIcon from the information gathered by the (chained) setXXX() methods.TeXFormula.TeXIconBuilder
setFGColor(java.awt.Color fgcolor)
Specify the background color for rendering the given TeXFormulaTeXFormula.TeXIconBuilder
setInterLineSpacing(int interLineUnit, float interLineSpacing)
Specify the inter line spacing unit and value.TeXFormula.TeXIconBuilder
setIsMaxWidth(boolean isMaxWidth)
Specifies whether the width is the exact or the maximum widthTeXFormula.TeXIconBuilder
setSize(float size)
Specify the font size for rendering the given TeXFormulaTeXFormula.TeXIconBuilder
setStyle(int style)
Specify the style for rendering the given TeXFormulaTeXFormula.TeXIconBuilder
setTrueValues(boolean trueValues)
Specify the "true values" parameter for rendering the given TeXFormulaTeXFormula.TeXIconBuilder
setType(int type)
Specify the font type for rendering the given TeXFormulaTeXFormula.TeXIconBuilder
setWidth(int widthUnit, float textWidth, int align)
Specify the width of the formula (may be exact or maximum width, seesetIsMaxWidth(boolean)
)
-
-
-
Method Detail
-
setStyle
public TeXFormula.TeXIconBuilder setStyle(int style)
Specify the style for rendering the given TeXFormula- Parameters:
style
- the style- Returns:
- the builder, used for chaining
-
setSize
public TeXFormula.TeXIconBuilder setSize(float size)
Specify the font size for rendering the given TeXFormula- Parameters:
size
- the size- Returns:
- the builder, used for chaining
-
setType
public TeXFormula.TeXIconBuilder setType(int type)
Specify the font type for rendering the given TeXFormula- Parameters:
type
- the font type- Returns:
- the builder, used for chaining
-
setFGColor
public TeXFormula.TeXIconBuilder setFGColor(java.awt.Color fgcolor)
Specify the background color for rendering the given TeXFormula- Parameters:
fgcolor
- the foreground color- Returns:
- the builder, used for chaining
-
setTrueValues
public TeXFormula.TeXIconBuilder setTrueValues(boolean trueValues)
Specify the "true values" parameter for rendering the given TeXFormula- Parameters:
trueValues
- the "true values" value- Returns:
- the builder, used for chaining
-
setWidth
public TeXFormula.TeXIconBuilder setWidth(int widthUnit, float textWidth, int align)
Specify the width of the formula (may be exact or maximum width, seesetIsMaxWidth(boolean)
)- Parameters:
widthUnit
- the width unittextWidth
- the widthalign
- the alignment- Returns:
- the builder, used for chaining
-
setIsMaxWidth
public TeXFormula.TeXIconBuilder setIsMaxWidth(boolean isMaxWidth)
Specifies whether the width is the exact or the maximum width- Parameters:
isMaxWidth
- whether the width is a maximum width- Returns:
- the builder, used for chaining
-
setInterLineSpacing
public TeXFormula.TeXIconBuilder setInterLineSpacing(int interLineUnit, float interLineSpacing)
Specify the inter line spacing unit and value. NOTE: this is required for automatic linebreaks to work!- Parameters:
interLineUnit
- the unitinterLineSpacing
- the value- Returns:
- the builder, used for chaining
-
build
public TeXIcon build()
Create a TeXIcon from the information gathered by the (chained) setXXX() methods. (see Builder pattern)- Returns:
- the TeXIcon
-
-