Interface TeXGraphics

All Known Implementing Classes:
UGraphicTeXGraphics

public interface TeXGraphics
The small drawing surface that the boxes need, in place of Graphics2D.

It is exactly the subset of Graphics2D that Box.draw(org.scilab.forge.jlatexmath.TeXGraphics, float, float) and its subclasses use: rectangles, rounded rectangle, lines, one glyph at the origin, the current color, the line width (butt caps, miter joins) and the transformation (translate, scale, rotate, save and restore).

  • Method Summary

    Modifier and Type
    Method
    Description
    void
    drawChar(int fontId, char c)
    Draws one glyph with its origin (baseline, left) at the current origin.
    void
    drawLine(float x1, float y1, float x2, float y2)
     
    void
    drawRect(float x, float y, float width, float height)
     
    void
    drawRoundRect(float x, float y, float width, float height, float arcWidth, float arcHeight)
     
    void
    drawText(String text, double fontSize)
    Draws text that no TeX font has the glyphs of (see TeXTextMeasurer), with its baseline origin at the current origin.
    void
    fillRect(float x, float y, float width, float height)
     
     
    double
    The horizontal scale factor of the current transformation.
    void
     
    void
     
    void
    rotate(double theta)
     
    void
    rotate(double theta, double x, double y)
     
    void
    Saves the current line settings, to be given back by restoreStroke().
    void
    Saves the current transformation, to be given back by restoreTransform().
    void
    scale(double sx, double sy)
     
    void
     
    void
    setLineWidth(float width)
    Sets the width of the lines, with butt caps and miter joins.
    void
    translate(double tx, double ty)
     
  • Method Details

    • getColor

      TeXColor getColor()
    • setColor

      void setColor(TeXColor color)
    • setLineWidth

      void setLineWidth(float width)
      Sets the width of the lines, with butt caps and miter joins.
    • saveStroke

      void saveStroke()
      Saves the current line settings, to be given back by restoreStroke().
    • restoreStroke

      void restoreStroke()
    • fillRect

      void fillRect(float x, float y, float width, float height)
    • drawRect

      void drawRect(float x, float y, float width, float height)
    • drawRoundRect

      void drawRoundRect(float x, float y, float width, float height, float arcWidth, float arcHeight)
    • drawLine

      void drawLine(float x1, float y1, float x2, float y2)
    • drawChar

      void drawChar(int fontId, char c)
      Draws one glyph with its origin (baseline, left) at the current origin. The size is given by the current scale: one unit is TeXFormula.FONT_SCALE_FACTOR font units.
    • drawText

      void drawText(String text, double fontSize)
      Draws text that no TeX font has the glyphs of (see TeXTextMeasurer), with its baseline origin at the current origin. The font size is in the current units, as the size of the glyphs of drawChar(int, char) is. The canvas may not rotate or flip it.
    • translate

      void translate(double tx, double ty)
    • scale

      void scale(double sx, double sy)
    • rotate

      void rotate(double theta)
    • rotate

      void rotate(double theta, double x, double y)
    • getScaleX

      double getScaleX()
      The horizontal scale factor of the current transformation.
    • saveTransform

      void saveTransform()
      Saves the current transformation, to be given back by restoreTransform().
    • restoreTransform

      void restoreTransform()