Search in sources :

Example 1 with Layout

use of com.structurizr.io.plantuml.C4PlantUMLWriter.Layout in project agile-architecture-documentation-system by Riduidel.

the class GraphEmitter method writeAllViews.

private void writeAllViews(Workspace workspace) {
    Layout layout = C4PlantUMLWriter.Layout.valueOf(layoutMode);
    PlantUMLWriter plantUMLWriter = new C4PlantUMLWriter(layout, plantumlPencils);
    // Hints to have arrows more easily visible
    plantUMLWriter.addSkinParam("pathHoverColor", "GreenYellow");
    plantUMLWriter.addSkinParam("ArrowThickness", "3");
    plantUMLWriter.addSkinParam("svgLinkTarget", "_parent");
    destination.mkdirs();
    plantUMLWriter.toPlantUMLDiagrams(workspace).stream().parallel().forEach(diagram -> {
        // Incredibly enough, that's not a view!
        Path path = new File(destination, diagram.getKey() + ".plantuml").toPath();
        try {
            Files.write(path, diagram.getDefinition().getBytes(Charset.forName("UTF-8")));
            logger.info(String.format("Generated diagram %s in file %s", diagram.getKey(), path));
        } catch (IOException e) {
            throw new CantWriteDiagram(String.format("Can't write diagram %s in file %s", diagram.getKey(), path), e);
        }
    });
}
Also used : Path(java.nio.file.Path) Layout(com.structurizr.io.plantuml.C4PlantUMLWriter.Layout) PlantUMLWriter(com.structurizr.io.plantuml.PlantUMLWriter) C4PlantUMLWriter(com.structurizr.io.plantuml.C4PlantUMLWriter) C4PlantUMLWriter(com.structurizr.io.plantuml.C4PlantUMLWriter) IOException(java.io.IOException) File(java.io.File)

Aggregations

C4PlantUMLWriter (com.structurizr.io.plantuml.C4PlantUMLWriter)1 Layout (com.structurizr.io.plantuml.C4PlantUMLWriter.Layout)1 PlantUMLWriter (com.structurizr.io.plantuml.PlantUMLWriter)1 File (java.io.File)1 IOException (java.io.IOException)1 Path (java.nio.file.Path)1