use of org.cristalise.kernel.lifecycle.renderer.LifecycleRenderer in project kernel by cristal-ise.
the class LifecycleRendererTest method generateInstance_SVG.
@Test
public void generateInstance_SVG() throws Exception {
String wfXML = FileStringUtility.url2String(LifecycleRendererTest.class.getResource("/LifeCycle.workflow"));
Workflow wf = (Workflow) Gateway.getMarshaller().unmarshall(wfXML);
LifecycleRenderer generator = new LifecycleRenderer(wf.search("workflow/domain").getChildrenGraphModel(), false);
int zoomFactor = generator.getZoomFactor(500, 500);
SVGGraphics2D svgG2D = new SVGGraphics2D(500, 500);
svgG2D.scale((double) zoomFactor / 100, (double) zoomFactor / 100);
generator.draw(svgG2D);
SVGUtils.writeToSVG(new File("target/workflow.svg"), svgG2D.getSVGElement());
}
use of org.cristalise.kernel.lifecycle.renderer.LifecycleRenderer in project kernel by cristal-ise.
the class LifecycleRendererTest method generateDef_SVG.
@Test
public void generateDef_SVG() throws Exception {
String caDefXML = FileStringUtility.url2String(Gateway.getResource().getKernelResourceURL("boot/CA/ManageModule.xml"));
CompositeActivityDef caDef = (CompositeActivityDef) Gateway.getMarshaller().unmarshall(caDefXML);
LifecycleRenderer generator = new LifecycleRenderer(caDef.getChildrenGraphModel(), true);
int zoomFactor = generator.getZoomFactor(500, 500);
SVGGraphics2D svgG2D = new SVGGraphics2D(500, 500);
svgG2D.scale((double) zoomFactor / 100, (double) zoomFactor / 100);
generator.draw(svgG2D);
SVGUtils.writeToSVG(new File("target/ManageModule.svg"), svgG2D.getSVGElement());
}
use of org.cristalise.kernel.lifecycle.renderer.LifecycleRenderer in project kernel by cristal-ise.
the class LifecycleRendererTest method generateDef_PNG.
@Test
public void generateDef_PNG() throws Exception {
String caDefXML = FileStringUtility.url2String(Gateway.getResource().getKernelResourceURL("boot/CA/ManageModule.xml"));
CompositeActivityDef caDef = (CompositeActivityDef) Gateway.getMarshaller().unmarshall(caDefXML);
BufferedImage img = new LifecycleRenderer(caDef.getChildrenGraphModel(), true).getWorkFlowModelImage(500, 500);
ImageIO.write(img, "png", new File("target/ManageModule.png"));
}
Aggregations