摘要:它是一款全自动图生成器,支持。但是图并不方便操作。因为经常使用来做图,所以如果能生成一个可以导入到的文件那就更好了。文件支持导入文件,那文件到底是什么样子的是导出时,生成的图片,包含各个元素。导入主要看的是。
Phuml项目需要画uml图,手写浪费时间,于是就搜了一些相关的工具来生成它。有php插件phpumd等等。发现了一个简单易用的工具,那就是phuml。
它是一款全自动uml图生成器,支持php5。
安装教程git clone https://github.com/jakobwesthoff/phuml //下载源码 yum install graphviz //安装图形库 cd phuml/src/app ./phuml -r /path -graphviz -createAssociations false -neato test.png //生成uml图
是不是很简单。
但是uml图并不方便操作。因为经常使用processon来做图,所以如果能生成一个可以导入到processon的.pos文件那就更好了。
processon支持导入.pos文件,那.pos文件到底是什么样子的?
{
"diagram":{
//image是导出时,生成的图片,elements包含各个元素。导入主要看的是elements。
"image":{
"height":322,
"pngdata":"", //导出时,base64格式图片
"width":310,
"y":9,
"x":26
},
"elements":{
"page":{
"gridSize":15, //网格大小
"showGrid":true, //显示网格
"orientation":"portrait", //页面方向 portrait竖向
"height":1500, //页面高度
"backgroundColor":"transparent", //背景颜色
"width":1250, //页面长度
"padding":20 //页面的灰边宽度
},
"elements":{
"15a3b34d769898":{ //生成一串随机id作为标识,每个图形都对应着一个
"textBlock":[ //文本块,uml图为三块
//类名
{
"position":{
"w":"w-20",
"h":"30",
"y":"0",
"x":"10"
},
"text":"类"
},
//属性
{
"position":{
"w":"w-20",
"h":47,
"y":"35",
"x":"10"
},
"text":"+ attribute1:type = defaultValue + attribute2:type - attribute3:type",
"fontStyle":{
"bold":false,
"textAlign":"left"
}
},
//方法
{
"position":{
"w":"w-20",
"h":145,
"y":93,
"x":"10"
},
"text":"+ operation1(params):returnType - operation2(params) - operation3() + operation1(params):returnType - operation2(params) - operation3() + operation1(params):returnType - operation2(params) - operation3()",
"fontStyle":{
"bold":false,
"textAlign":"left"
}
}
],
"lineStyle":{
},
"link":"",
"children":[
],
"parent":"",
"attribute":{
"linkable":true,
"visible":true,
"container":false,
"rotatable":true,
"markerOffset":5,
"collapsable":false,
"collapsed":false
},
"fontStyle":{
"bold":true
},
"resizeDir":[
"tl",
"tr",
"br",
"bl"
],
"dataAttributes":[
],
"shapeStyle":{
"alpha":1
},
"id":"15a3b34d769898",
"anchors":[
{
"y":"0",
"x":"w/2"
},
{
"y":"h",
"x":"w/2"
},
{
"y":"h/2",
"x":"0"
},
{
"y":"h/2",
"x":"w"
}
],
"title":"类",
"category":"uml_class",
"name":"cls",
"path":[
{
"actions":[
{
"action":"move",
"y":"4",
"x":"0"
},
{
"y1":"0",
"action":"quadraticCurve",
"y":"0",
"x":"4",
"x1":"0"
},
{
"action":"line",
"y":"0",
"x":"w-4"
},
{
"y1":"0",
"action":"quadraticCurve",
"y":"4",
"x":"w",
"x1":"w"
},
{
"action":"line",
"y":"h-4",
"x":"w"
},
{
"y1":"h",
"action":"quadraticCurve",
"y":"h",
"x":"w-4",
"x1":"w"
},
{
"action":"line",
"y":"h",
"x":"4"
},
{
"y1":"h",
"action":"quadraticCurve",
"y":"h-4",
"x":"0",
"x1":"0"
},
{
"action":"close"
}
]
},
{
"fillStyle":{
"type":"none"
},
"actions":[
{
"action":"move",
"y":30,
"x":"0"
},
{
"action":"line",
"y":30,
"x":"w"
},
{
"action":"move",
"y":88,
"x":"0"
},
{
"action":"line",
"y":88,
"x":"w"
}
]
},
{
"lineStyle":{
"lineWidth":0
},
"fillStyle":{
"type":"none"
},
"actions":[
{
"action":"move",
"y":"0",
"x":"0"
},
{
"action":"line",
"y":"0",
"x":"w"
},
{
"action":"line",
"y":"h",
"x":"w"
},
{
"action":"line",
"y":"h",
"x":"0"
},
{
"action":"close"
}
]
}
],
"fillStyle":{
},
"locked":false,
"group":"",
"props":{
"w":230,
"heights":[
30,
50,
145
],
"angle":0,
"h":242,
"y":49,
"zindex":1,
"x":66
}
}
}
}
},
"meta":{
"id":"58a29cdce4b028637aca553f",
"member":"saber",
"exportTime":"2017-02-14 14:00:44",
"diagramInfo":{
"category":"uml",
"title":"订单",
"created":"2017-02-14 13:59:56",
"attributes":null,
"creator":"saber",
"modified":"2017-02-14 14:00:25"
},
"type":"ProcessOn Schema File",
"version":"1.0"
}
}
所以只要仿照着它的格式来一份就能生成一份pos文件。
使用git clone https://github.com/sabercoding/phuml.git //下载源码 ./phuml -r /path -processon test.pos //生成pos文件待优化之处
类图大小及文本块大小
类之间的关系
类排版
最新发表在这里
文章版权归作者所有,未经允许请勿转载,若此文章存在违规行为,您可以联系管理员删除。
转载请注明本文地址:https://www.ucloud.cn/yun/22375.html
摘要:截至发文,最新版本为内容机密,团队使用首选私有部署,形式部署非常简单,只要分钟,行代码,你就可拥有自己专属的媲美的流程图应用。私有部署的还有一个好处是可以进行二次开发。 ...
上次讲了2个游戏源码 前端实战之js推箱子游戏(有界面、附源码、赞关藏) Python实战:五子棋小游戏,切身感受一下前端和桌面应用的区别,选择自己喜欢的 本来今天准备写一篇面向对象文章,但是想一想,讲面向对象之前还是先给大家介绍几款实用的工具,更加快速的理解,掌握知识点。 1.UML 统一建模语言(Unified Modeling Language,UML)是一种为面向对象系统的产品进行说明、可...
摘要:单例模式模式系列的开篇,首先介绍的是我最喜欢的单例模式,简单而言,这属于生成一个且只生成一个对象实例的特殊类。问题良好设计的系统通过方法调用传递对象实例。面向对象设计模式目录 单例模式 模式系列的开篇,首先介绍的是我最喜欢的单例模式(Singleton),简单而言,这属于:生成一个、且只生成一个对象实例的特殊类。 这个唯一存在的类,将替代Global关键字,并且更安全。 产生前提 全局...
摘要:分钟快速部署数字绘经常有小伙伴问,有没有一款好用又免费的画图软件,画画流程图思维导图今天就介绍一款开源的在线画图软件,可以满足多方的需求。为了方便部署和解决环境兼容性等问题,采用来部署安装数字绘。 5分钟快速部署DataDraw数字绘 经常有小伙伴问,有没有一款好用又免费的画图软件,画画流程图、UML、思维导图?今天就介绍一款开源的在线画图软件,可以满足多方的需求。 DataDraw数...
阅读 1925·2023-04-26 00:30
阅读 3349·2021-11-25 09:43
阅读 3126·2021-11-22 14:56
阅读 3404·2021-11-04 16:15
阅读 1429·2021-09-07 09:58
阅读 2207·2019-08-29 13:14
阅读 3321·2019-08-29 12:55
阅读 1208·2019-08-29 10:57