use of org.apache.batik.swing.JSVGCanvas in project charts by vaadin.
the class SwingDemo method display.
public static void display(Configuration conf) {
String svg = SVGGenerator.getInstance().generate(conf);
String parser = XMLResourceDescriptor.getXMLParserClassName();
SVGDocumentFactory documentFactory = new SAXSVGDocumentFactory(parser, true);
SVGDocument svgdoc;
try {
svgdoc = documentFactory.createSVGDocument(null, new StringReader(svg));
JSVGCanvas jsvgCanvas = new JSVGCanvas();
jsvgCanvas.setSVGDocument(svgdoc);
JFrame f = new JFrame();
f.setSize(600, 400);
f.getContentPane().add(jsvgCanvas);
f.pack();
f.setVisible(true);
} catch (IOException e) {
throw new RuntimeException(e);
}
}
Aggregations