Class TeXIcon

java.lang.Object
org.scilab.forge.jlatexmath.TeXIcon

public class TeXIcon extends Object
The icon of a TeXFormula: its size, and the way to paint it on a TeXGraphics.

This class cannot be instantiated directly. It can be constructed from a TeXFormula using the TeXFormula.createTeXIcon(int,float) method.

  • Field Details

    • defaultSize

      public static float defaultSize
    • magFactor

      public static float magFactor
    • isColored

      public boolean isColored
  • Constructor Details

    • TeXIcon

      protected TeXIcon(Box b, float size)
      Creates a new icon that will paint the given formula box in the given point size.
      Parameters:
      b - the formula box to be painted
      size - the point size
    • TeXIcon

      protected TeXIcon(Box b, float size, boolean trueValues)
  • Method Details

    • setForeground

      public void setForeground(TeXColor fg)
    • setInsets

      public void setInsets(TeXInsets insets, boolean trueValues)
      Set the insets of the TeXIcon.
      Parameters:
      insets - the insets
      trueValues - true to force the true values
    • setInsets

      public void setInsets(TeXInsets insets)
      Set the insets of the TeXIcon.
      Parameters:
      insets - the insets
    • getIconHeight

      public int getIconHeight()
      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.
    • paint

      public void paint(TeXGraphics g2, TeXColor defaultForeground, int x, int y)
      Paints the formula on a canvas that is not AWT (see PLAN.md, phase 2). The origin of the canvas is the top left corner of the icon; the foreground color is the one of setForeground(TeXColor), else the one given. If both are null, the color of the canvas is kept.