org.stathissideris.ascii2image.graphics.ImageHandler 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 org.stathissideris.ascii2image.graphics;
import java.awt.Image;
public class ImageHandler {
// private static OffScreenSVGRenderer svgRenderer =
// new OffScreenSVGRenderer();
private static ImageHandler instance = new ImageHandler();
public static ImageHandler instance() {
return instance;
}
// private static final MediaTracker tracker = new MediaTracker(new JLabel());
public Image loadImage(String filename) {
return null;
// URL url = ClassLoader.getSystemResource(filename);
// Image result = null;
// if(url != null)
// result = Toolkit.getDefaultToolkit().getImage(url);
// else
// result = Toolkit.getDefaultToolkit().getImage(filename);
//// result = null;
//
// //wait for the image to load before returning
// tracker.addImage(result, 0);
// try {
// tracker.waitForID(0);
// } catch (InterruptedException e) {
// System.err.println("Failed to load image "+filename);
// Logme.error(e);
// }
// tracker.removeImage(result, 0);
//
// return result;
}
// public BufferedImage renderSVG(String filename, int width, int height, boolean stretch) throws IOException {
// File file = SecurityUtils.File(filename);
// URI uri = file.toURI();
// return svgRenderer.renderToImage(uri.toString(), width, height, stretch, null, null);
// }
//
// public BufferedImage renderSVG(String filename, int width, int height, boolean stretch, String idRegex, Color color) throws IOException {
// File file = SecurityUtils.File(filename);
// URI uri = file.toURI();
// return svgRenderer.renderToImage(uri.toString(), width, height, stretch, idRegex, color);
// }
}