All Downloads are FREE. Search and download functionalities are using the official Maven repository.

net.sourceforge.plantuml.math.AsciiMath Maven / Gradle / Ivy

There is a newer version: 1.2024.8
Show newest version
// 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;
	}

}




© 2015 - 2024 Weber Informatics LLC | Privacy Policy