热门标签 | HotTags
当前位置:  开发笔记 > 编程语言 > 正文

java的format类,JavaFormat类代码示例

importcom.structurizr.documentation.Format;导入依赖的package包类publicstaticvoidmain(String[]args

import com.structurizr.documentation.Format; //导入依赖的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);

}



推荐阅读
author-avatar
kenyousay
这个家伙很懒,什么也没留下!
PHP1.CN | 中国最专业的PHP中文社区 | DevBox开发工具箱 | json解析格式化 |PHP资讯 | PHP教程 | 数据库技术 | 服务器技术 | 前端开发技术 | PHP框架 | 开发工具 | 在线工具
Copyright © 1998 - 2020 PHP1.CN. All Rights Reserved | 京公网安备 11010802041100号 | 京ICP备19059560号-4 | PHP1.CN 第一PHP社区 版权所有