use of org.freehep.graphicsio.emf.EMFGraphics2D in project abstools by abstools.
the class ExporterImpl method getGraphics.
private VectorGraphics getGraphics() {
VectorGraphics vectorGraphics;
if (orientation == null) {
orientation = dim.getWidth() <= dim.getHeight() ? "Portrait" : "Landscape";
}
if (type.equals("gif")) {
vectorGraphics = new GIFGraphics2D(stream, dim);
} else if (type.equals("png")) {
vectorGraphics = new ImageGraphics2D(stream, dim, "png");
} else if (type.equals("bmp")) {
vectorGraphics = new ImageGraphics2D(stream, dim, "bmp");
} else if (type.equals("jpg")) {
vectorGraphics = new ImageGraphics2D(stream, dim, "jpg");
} else if (type.equals("pdf")) {
PDFGraphics2D pdf = new PDFGraphics2D(stream, dim);
Properties properties = new Properties();
properties.setProperty(PDFGraphics2D.ORIENTATION, orientation);
properties.setProperty(PDFGraphics2D.PAGE_SIZE, format);
pdf.setProperties(properties);
vectorGraphics = pdf;
} else if (type.equals("ps")) {
PSGraphics2D ps = new PSGraphics2D(stream, dim);
Properties properties = new Properties();
properties.setProperty(PSGraphics2D.ORIENTATION, orientation);
properties.setProperty(PSGraphics2D.PAGE_SIZE, format);
ps.setProperties(properties);
ps.setMultiPage(true);
vectorGraphics = ps;
} else if (type.equals("emf")) {
vectorGraphics = new EMFGraphics2D(stream, dim);
} else if (type.equals("svg")) {
vectorGraphics = new SVGGraphics2D(stream, dim);
} else if (type.equals("swf")) {
vectorGraphics = new SWFGraphics2D(stream, dim);
} else {
throw new IllegalArgumentException("Unknown type: " + type);
}
return vectorGraphics;
}
Aggregations