org.scilab.forge.jlatexmath
Class TeXFormula.TeXIconBuilder

java.lang.Object
  extended by 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
TeXFormula.TeXIconBuilder()
           
 
Method Summary
 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 TeXFormula
 TeXFormula.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 width
 TeXFormula.TeXIconBuilder setSize(float size)
          Specify the font size for rendering the given TeXFormula
 TeXFormula.TeXIconBuilder setStyle(int style)
          Specify the style for rendering the given TeXFormula
 TeXFormula.TeXIconBuilder setTrueValues(boolean trueValues)
          Specify the "true values" parameter for rendering the given TeXFormula
 TeXFormula.TeXIconBuilder setType(int type)
          Specify the font type for rendering the given TeXFormula
 TeXFormula.TeXIconBuilder setWidth(int widthUnit, float textWidth, int align)
          Specify the width of the formula (may be exact or maximum width, see setIsMaxWidth(boolean))
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

TeXFormula.TeXIconBuilder

public TeXFormula.TeXIconBuilder()
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, see setIsMaxWidth(boolean))

Parameters:
widthUnit - the width unit
textWidth - the width
align - 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 unit
interLineSpacing - 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