Class JLaTeXMathCache
java.lang.Object
org.scilab.forge.jlatexmath.cache.JLaTeXMathCache
Class to cache generated image from formulas
- Author:
- Calixte DENIZET
-
Method Summary
Modifier and TypeMethodDescriptionstatic void
Clear the cachestatic Object
getCachedTeXFormula
(String f, int style, int size, int inset) static Object
getCachedTeXFormula
(String f, int style, int type, int size, int inset, Color fgcolor) Get a cached formulastatic int[]
static int[]
getCachedTeXFormulaDimensions
(String f, int style, int size, int inset) static int[]
getCachedTeXFormulaDimensions
(String f, int style, int type, int size, int inset, Color fgcolor) static Image
Get a cached formulastatic Image
getCachedTeXFormulaImage
(String f, int style, int size, int inset) static Image
getCachedTeXFormulaImage
(String f, int style, int type, int size, int inset, Color fgcolor) Get a cached formulastatic Object
Paint a cached formulastatic Object
paintCachedTeXFormula
(String f, int style, int type, int size, int inset, Color fgcolor, Graphics2D g) Paint a cached formulastatic Object
paintCachedTeXFormula
(String f, int style, int size, int inset, Graphics2D g) static void
Remove a formula from the cache.static void
removeCachedTeXFormula
(String f, int style, int size, int inset) static void
removeCachedTeXFormula
(String f, int style, int type, int size, int inset, Color fgcolor) Remove a formula from the cachestatic void
setMaxCachedObjects
(int max) Set max size.
-
Method Details
-
setMaxCachedObjects
public static void setMaxCachedObjects(int max) Set max size. Take care the cache will be reinitialized- Parameters:
max
- the max size
-
getCachedTeXFormulaDimensions
public static int[] getCachedTeXFormulaDimensions(String f, int style, int type, int size, int inset, Color fgcolor) throws ParseException - Parameters:
f
- a formulastyle
- a style like TeXConstants.STYLE_DISPLAYsize
- the size of fontinset
- the inset to add on the top, bottom, left and right- Returns:
- an array of length 3 containing width, height and depth
- Throws:
ParseException
-
getCachedTeXFormulaDimensions
public static int[] getCachedTeXFormulaDimensions(String f, int style, int size, int inset) throws ParseException - Throws:
ParseException
-
getCachedTeXFormulaDimensions
- Parameters:
o
- an Object to identify the image in the cache- Returns:
- an array of length 3 containing width, height and depth
- Throws:
ParseException
-
getCachedTeXFormula
public static Object getCachedTeXFormula(String f, int style, int type, int size, int inset, Color fgcolor) throws ParseException Get a cached formula- Parameters:
f
- a formulastyle
- a style like TeXConstants.STYLE_DISPLAYsize
- the size of fontinset
- the inset to add on the top, bottom, left and right- Returns:
- the key in the map
- Throws:
ParseException
-
getCachedTeXFormula
public static Object getCachedTeXFormula(String f, int style, int size, int inset) throws ParseException - Throws:
ParseException
-
clearCache
public static void clearCache()Clear the cache -
removeCachedTeXFormula
public static void removeCachedTeXFormula(String f, int style, int type, int size, int inset, Color fgcolor) throws ParseException Remove a formula from the cache- Parameters:
f
- a formulastyle
- a style like TeXConstants.STYLE_DISPLAYsize
- the size of fontinset
- the inset to add on the top, bottom, left and right- Throws:
ParseException
-
removeCachedTeXFormula
public static void removeCachedTeXFormula(String f, int style, int size, int inset) throws ParseException - Throws:
ParseException
-
removeCachedTeXFormula
Remove a formula from the cache. Take care, remove the Object o, invalidate it !- Parameters:
o
- an Object to identify the image in the cache- Throws:
ParseException
-
paintCachedTeXFormula
public static Object paintCachedTeXFormula(String f, int style, int type, int size, int inset, Color fgcolor, Graphics2D g) throws ParseException Paint a cached formula- Parameters:
f
- a formulastyle
- a style like TeXConstants.STYLE_DISPLAYsize
- the size of fontinset
- the inset to add on the top, bottom, left and right- Returns:
- the key in the map
- Throws:
ParseException
-
paintCachedTeXFormula
public static Object paintCachedTeXFormula(String f, int style, int size, int inset, Graphics2D g) throws ParseException - Throws:
ParseException
-
paintCachedTeXFormula
Paint a cached formula- Parameters:
o
- an Object to identify the image in the cacheg
- the graphics where to paint the image- Returns:
- the key in the map
- Throws:
ParseException
-
getCachedTeXFormulaImage
public static Image getCachedTeXFormulaImage(String f, int style, int type, int size, int inset, Color fgcolor) throws ParseException Get a cached formula- Parameters:
f
- a formulastyle
- a style like TeXConstants.STYLE_DISPLAYsize
- the size of fontinset
- the inset to add on the top, bottom, left and right- Returns:
- the cached image
- Throws:
ParseException
-
getCachedTeXFormulaImage
public static Image getCachedTeXFormulaImage(String f, int style, int size, int inset) throws ParseException - Throws:
ParseException
-
getCachedTeXFormulaImage
Get a cached formula- Parameters:
o
- an Object to identify the image in the cache- Returns:
- the cached image
- Throws:
ParseException
-