net.sourceforge.plantuml.math.AsciiMath Maven / Gradle / Ivy
Go to download
Show more of this group Show more artifacts with this name
Show all versions of plantuml-mit Show documentation
Show all versions of plantuml-mit Show documentation
PlantUML is a component that allows to quickly write diagrams from text.
// THIS FILE HAS BEEN GENERATED BY A PREPROCESSOR.
package net.sourceforge.plantuml.math;
import java.awt.Color;
import java.io.IOException;
import java.lang.reflect.InvocationTargetException;
import javax.script.ScriptException;
import net.sourceforge.plantuml.klimt.MutableImage;
import net.sourceforge.plantuml.klimt.geom.XDimension2D;
import net.sourceforge.plantuml.klimt.shape.UImageSvg;
public class AsciiMath implements ScientificEquation {
// ::remove folder when __CORE__
private final LatexBuilder builder;
private final String tex;
public AsciiMath(String form) throws ScriptException, NoSuchMethodException {
this.tex = new ASCIIMathTeXImg().getTeX(form);
this.builder = new LatexBuilder(tex);
}
public XDimension2D getDimension() {
return builder.getDimension();
}
public UImageSvg getSvg(double scale, Color foregroundColor, Color backgroundColor)
throws ClassNotFoundException, IllegalAccessException, IllegalArgumentException, InvocationTargetException,
NoSuchMethodException, SecurityException, InstantiationException, IOException {
return builder.getSvg(scale, foregroundColor, backgroundColor);
}
public MutableImage getImage(Color foregroundColor, Color backgroundColor)
throws ClassNotFoundException, NoSuchMethodException, SecurityException, InstantiationException,
IllegalAccessException, IllegalArgumentException, InvocationTargetException {
return builder.getImage(foregroundColor, backgroundColor);
}
public String getSource() {
return tex;
}
}