Class TeXFormula.TeXIconBuilder

java.lang.Object
org.scilab.forge.jlatexmath.TeXFormula.TeXIconBuilder
Enclosing class:
TeXFormula

public class TeXFormula.TeXIconBuilder extends Object
Apply the Builder pattern instead of using the createTeXIcon(...) factories
Author:
Felix Natter
  • Constructor Details

    • TeXIconBuilder

      public TeXIconBuilder()
  • Method Details

    • 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(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