/** * Writes the dynamic views in the given workspace as WebSequenceDiagrams definitions, to the specified writer. * * @param workspace the workspace containing the views to be written * @param writer the Writer to write to */ public void write(Workspace workspace, Writer writer) { if (workspace != null && writer != null) { for (DynamicView view : workspace.getViews().getDynamicViews()) { write(view, writer); } } }
/** * Writes the views in the given workspace as PlantUML definitions, to the specified writer. * * @param workspace the workspace containing the views to be written * @param writer the Writer to write to */ public void write(Workspace workspace, Writer writer) { if (workspace == null) { throw new IllegalArgumentException("A workspace must be provided."); } if (writer == null) { throw new IllegalArgumentException("A writer must be provided."); } workspace.getViews().getSystemLandscapeViews().forEach(v -> write(v, writer)); workspace.getViews().getSystemContextViews().forEach(v -> write(v, writer)); workspace.getViews().getContainerViews().forEach(v -> write(v, writer)); workspace.getViews().getComponentViews().forEach(v -> write(v, writer)); workspace.getViews().getDynamicViews().forEach(v -> write(v, writer)); workspace.getViews().getDeploymentViews().forEach(v -> write(v, writer)); }
@Test public void test_writeDynamicView() throws Exception { populateWorkspace(); DynamicView dynamicView = workspace.getViews().getDynamicViews() .stream().findFirst().get(); plantUMLWriter.write(dynamicView, stringWriter); assertEquals(DYNAMIC_VIEW, stringWriter.toString()); }
.filter(v -> v.getKey() == null) .forEach(v -> warnings.add("Component view \"" + v.getName() + "\": Missing key")); getViews().getDynamicViews().stream() .filter(v -> v.getKey() == null) .forEach(v -> warnings.add("Dynamic view \"" + v.getName() + "\": Missing key"));
@Test public void test_writeDynamicViewSequence() throws Exception { populateWorkspace(); DynamicView dynamicView = workspace.getViews().getDynamicViews() .stream().findFirst().get(); plantUMLWriter.setUseSequenceDiagrams(true); plantUMLWriter.write(dynamicView, stringWriter); plantUMLWriter.setUseSequenceDiagrams(false); System.out.print(stringWriter.toString()); assertEquals(DYNAMIC_VIEW_SEQUENCE, stringWriter.toString()); }
DynamicView sourceView = findView(source.getDynamicViews(), view); if (sourceView != null) { view.copyLayoutInformationFrom(sourceView);