本文整理汇总了Java中com.structurizr.Workspace.getViews方法的典型用法代码示例。如果您正苦于以下问题:Java Workspace.getViews方法的具体用法?Java Workspace.getViews怎么用?Java Workspace.getViews使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类com.structurizr.Workspace
的用法示例。
在下文中一共展示了Workspace.getViews方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: main
import com.structurizr.Workspace; //导入方法依赖的package包/类
public static void main(String[] args) throws Exception {
// a Structurizr workspace is the wrapper for a software architecture model, views and documentation
Workspace workspace = new Workspace("Getting Started", "This is a model of my software system.");
Model model = workspace.getModel();
// add some elements to your software architecture model
Person user = model.addPerson("User", "A user of my software system.");
SoftwareSystem softwareSystem = model.addSoftwareSystem("Software System", "My software system.");
user.uses(softwareSystem, "Uses");
// define some views (the diagrams you would like to see)
ViewSet views = workspace.getViews();
SystemContextView contextView = views.createSystemContextView(softwareSystem, "SystemContext", "An example of a System Context diagram.");
contextView.setPaperSize(PaperSize.A5_Landscape);
contextView.addAllSoftwareSystems();
contextView.addAllPeople();
// add some documentation
StructurizrDocumentationTemplate template = new StructurizrDocumentationTemplate(workspace);
template.addContextSection(softwareSystem, Format.Markdown,
"Here is some context about the software system...\n" +
"\n" +
"![](embed:SystemContext)");
// add some styling
Styles styles = views.getConfiguration().getStyles();
styles.addElementStyle(Tags.SOFTWARE_SYSTEM).background("#1168bd").color("#ffffff");
styles.addElementStyle(Tags.PERSON).background("#08427b").color("#ffffff").shape(Shape.Person);
uploadWorkspaceToStructurizr(workspace);
}