public void remove() { if (keyLaTeX != null) try { JLaTeXMathCache.removeCachedTeXFormula(keyLaTeX); } catch (Exception ee) { ee.printStackTrace(); } }
public Object getCachedLaTeXKey( String latex, int fontSize, int style, ColorAdapter fgColorAdapter) { Object newKey; try { newKey = JLaTeXMathCache.getCachedTeXFormula( latex, TeXConstants.STYLE_DISPLAY, style, fontSize, 1 /* inset around the label*/, (AwtColorAdapter) fgColorAdapter); } catch (ParseException e) { if (keyLaTeX != null) { // remove old key from cache try { JLaTeXMathCache.removeCachedTeXFormula(keyLaTeX); } catch (Exception ee) { ee.printStackTrace(); } } throw e; } if (keyLaTeX != null && !keyLaTeX.equals(newKey)) { // key has changed, remove old key from cache try { JLaTeXMathCache.removeCachedTeXFormula(keyLaTeX); } catch (Exception ee) { ee.printStackTrace(); } // Application.debug("removing"); } keyLaTeX = newKey; return keyLaTeX; }