aboutsummaryrefslogtreecommitdiff
path: root/umlgen/src/main/resources/graph.ftl
diff options
context:
space:
mode:
authorYuuta Liang <yuutaw@student.cs.ubc.ca>2023-11-28 21:00:25 -0800
committerYuuta Liang <yuutaw@student.cs.ubc.ca>2023-11-28 21:00:25 -0800
commitc992db275494b05627248cd741adac5d7c199603 (patch)
treef259bb943512007cbc9b50ddf8013d6e3f8b9008 /umlgen/src/main/resources/graph.ftl
parent1073af21305360bd33903c533cdac57e9f936294 (diff)
downloadjca-c992db275494b05627248cd741adac5d7c199603.tar
jca-c992db275494b05627248cd741adac5d7c199603.tar.gz
jca-c992db275494b05627248cd741adac5d7c199603.tar.bz2
jca-c992db275494b05627248cd741adac5d7c199603.zip
Add UML generator
Signed-off-by: Yuuta Liang <yuutaw@student.cs.ubc.ca>
Diffstat (limited to 'umlgen/src/main/resources/graph.ftl')
-rw-r--r--umlgen/src/main/resources/graph.ftl37
1 files changed, 37 insertions, 0 deletions
diff --git a/umlgen/src/main/resources/graph.ftl b/umlgen/src/main/resources/graph.ftl
new file mode 100644
index 0000000..759fc44
--- /dev/null
+++ b/umlgen/src/main/resources/graph.ftl
@@ -0,0 +1,37 @@
+digraph {
+ node [
+ shape=record
+ style=filled
+ fillcolor=gray95
+ ]
+
+ <#list classes as cls>
+ <#if cls.tag()??>
+ ${cls.name()} [label = <{<b>«${cls.tag()}»</b><br />${cls.name()}}>]
+ <#else>
+ ${cls.name()} [label = "${cls.name()}"]
+ </#if>
+ </#list>
+
+ <#if extends??>
+ <#list extends as relation>
+ <#if relation.impl()>
+ edge [dir=forward arrowtail=empty arrowhead=empty style="dashed"]
+ <#else>
+ edge [dir=forward arrowtail=empty arrowhead=empty style=""]
+ </#if>
+ ${relation.from()} -> ${relation.to()}
+ </#list>
+ </#if>
+
+ <#if assocs??>
+ <#list assocs as assoc>
+ <#if assoc.partOf()>
+ edge [dir=both arrowtail=odiamond arrowhead=vee style="" headlabel="${assoc.head()}"]
+ <#else>
+ edge [dir=forward arrowtail=empty arrowhead=vee style="" headlabel="${assoc.head()}"]
+ </#if>
+ ${assoc.from()} -> ${assoc.to()}
+ </#list>
+ </#if>
+} \ No newline at end of file