nitc :: MEntity :: tpl_module
self
# Builds a dot UML package diagram entity from `self`
fun tpl_module(model: UMLModel): Writable is abstract
src/uml/uml_module.nit:44,2--45,54
redef fun tpl_module(model) do
var name = self.name.escape_to_dot
var t = new Template
t.add "{mmodule.name.escape_to_dot}{name} [\n\tlabel = \"\{"
if mclass.kind == abstract_kind then
t.add "abstract\\n{name}"
else if mclass.kind == interface_kind then
t.add "interface\\n{name}"
else
t.add "{name}"
end
if mclass.arity > 0 then
t.add "["
var mparameters = mclass.mparameters
t.add mparameters.first.name
for i in [1 .. mparameters.length[ do
t.add ", "
t.add mparameters[i].name
end
t.add "]"
end
t.add "|"
for i in mpropdefs do
if not i isa MAttributeDef then continue
if not model.filter.accept_mentity(i) then continue
t.add i.tpl_module(model)
t.add "\\l"
end
t.add "|"
for i in mpropdefs do
if not i isa MMethodDef then continue
if not model.filter.accept_mentity(i) then continue
t.add i.tpl_module(model)
t.add "\\l"
end
t.add "\}\""
if is_intro then
t.add "color=\"{intro_colour}\""
else
t.add "color=\"{redef_colour}\""
end
t.add "\n]\n"
var supers = in_hierarchy.direct_greaters
for i in supers do
if i.mmodule != mmodule then continue
t.add "{i.mmodule}{i.name} -> {mmodule}{name} [dir=back"
if i.mclass.kind == interface_kind then
t.add " arrowtail=open style=dashed"
else
t.add " arrowtail=empty"
end
t.add "]\n"
end
return t
end
src/uml/uml_module.nit:75,2--129,4
redef fun tpl_module(model) do
var name = self.name.escape_to_dot
var t = new Template
t.add "subgraph cluster{name} \{\n"
t.add "label = \"{name}\"\n"
for i in mclassdefs do
if not model.filter.accept_mentity(i) then continue
t.add i.tpl_module(model)
end
t.add "\}\n"
return t
end
src/uml/uml_module.nit:49,2--60,4