当前位置: 首页>>代码示例>>Java>>正文


Java Workspace.getModel方法代码示例

本文整理汇总了Java中com.structurizr.Workspace.getModel方法的典型用法代码示例。如果您正苦于以下问题:Java Workspace.getModel方法的具体用法?Java Workspace.getModel怎么用?Java Workspace.getModel使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在com.structurizr.Workspace的用法示例。


在下文中一共展示了Workspace.getModel方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的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);
}
 
开发者ID:structurizr,项目名称:java-quickstart,代码行数:32,代码来源:Structurizr.java

示例2: model

import com.structurizr.Workspace; //导入方法依赖的package包/类
@Bean
Model model(Workspace workspace) {
    return workspace.getModel();
}
 
开发者ID:Catalysts,项目名称:cat-boot,代码行数:5,代码来源:StructurizrAutoConfiguration.java


注:本文中的com.structurizr.Workspace.getModel方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。