uml: migrate to `model_collect`
authorAlexandre Terrasa <alexandre@moz-code.org>
Fri, 22 May 2015 00:23:13 +0000 (20:23 -0400)
committerAlexandre Terrasa <alexandre@moz-code.org>
Fri, 29 May 2015 23:10:11 +0000 (19:10 -0400)
Signed-off-by: Alexandre Terrasa <alexandre@moz-code.org>

src/uml/uml_base.nit
src/uml/uml_class.nit

index e54ccef..3cb5e92 100644 (file)
@@ -16,7 +16,7 @@
 module uml_base
 
 import toolcontext
-import model_utils
+import model
 
 redef class ToolContext
        # -p
index c985a04..79865aa 100644 (file)
@@ -16,6 +16,7 @@
 module uml_class
 
 import uml_base
+import model::model_collect
 
 redef class UMLModel
        # Generates a UML class diagram from a `Model`
@@ -84,9 +85,9 @@ redef class MClass
                t.add "|"
                var props: Collection[MProperty]
                if ctx.private_gen then
-                       props = intro_mproperties(none_visibility)
+                       props = collect_intro_mproperties(none_visibility)
                else
-                       props = intro_mproperties(public_visibility)
+                       props = collect_intro_mproperties(public_visibility)
                end
                for i in props do
                        if i isa MAttribute then
@@ -95,8 +96,13 @@ redef class MClass
                        end
                end
                t.add "|"
-               for i in intro_methods do
-                       if not ctx.private_gen and i.visibility != public_visibility then continue
+               var meths
+               if ctx.private_gen then
+                       meths = collect_intro_mmethods(none_visibility)
+               else
+                       meths = collect_intro_mmethods(public_visibility)
+               end
+               for i in meths do
                        t.add i.tpl_class(ctx, main)
                        t.add "\\l"
                end