Package org.scilab.forge.jlatexmath
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 TypeMethodDescriptionvoiddrawChar(int fontId, char c) Draws one glyph with its origin (baseline, left) at the current origin.voiddrawLine(float x1, float y1, float x2, float y2) voiddrawRect(float x, float y, float width, float height) voiddrawRoundRect(float x, float y, float width, float height, float arcWidth, float arcHeight) voidDraws text that no TeX font has the glyphs of (seeTeXTextMeasurer), with its baseline origin at the current origin.voidfillRect(float x, float y, float width, float height) getColor()doubleThe horizontal scale factor of the current transformation.voidvoidvoidrotate(double theta) voidrotate(double theta, double x, double y) voidSaves the current line settings, to be given back byrestoreStroke().voidSaves the current transformation, to be given back byrestoreTransform().voidscale(double sx, double sy) voidvoidsetLineWidth(float width) Sets the width of the lines, with butt caps and miter joins.voidtranslate(double tx, double ty)
-
Method Details
-
getColor
TeXColor getColor() -
setColor
-
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 byrestoreStroke(). -
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 isTeXFormula.FONT_SCALE_FACTORfont units. -
drawText
Draws text that no TeX font has the glyphs of (seeTeXTextMeasurer), with its baseline origin at the current origin. The font size is in the current units, as the size of the glyphs ofdrawChar(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 byrestoreTransform(). -
restoreTransform
void restoreTransform()
-