model: rename `as_notnullable` to `undecorate`
[nit.git] / src / model / model_viz.nit
index f8c0016..305cd23 100644 (file)
@@ -26,8 +26,6 @@ class MProjectTree
        # The model where to look for information
        var model: Model
 
-       init(model: Model) do self.model = model
-
        redef fun display(a) do
                if a isa MGroup then
                        if a.parent == null then return "{a.mproject.name} ({a.filepath.to_s})"
@@ -68,13 +66,13 @@ private class LinexComparator
 
        var mins = new HashMap [MGroup, nullable MModule]
        var maxs = new HashMap [MGroup, nullable MModule]
-       fun min(o: Object): nullable MModule do
+       fun mini(o: Object): nullable MModule do
                if o isa MModule then return o
                assert o isa MGroup
                if not mins.has_key(o) then computeminmax(o)
                return mins[o]
        end
-       fun max(o: Object): nullable MModule do
+       fun maxi(o: Object): nullable MModule do
                if o isa MModule then return o
                assert o isa MGroup
                if not maxs.has_key(o) then computeminmax(o)
@@ -87,14 +85,14 @@ private class LinexComparator
                        return
                end
                var subs = tree.sub[o]
-               var minres = min(subs.first)
-               var maxres = max(subs.first)
+               var minres = mini(subs.first)
+               var maxres = maxi(subs.first)
                var order = minres.model.mmodule_importation_hierarchy
                for o2 in subs do
-                       var c = min(o2)
+                       var c = mini(o2)
                        if c == null then continue
                        if minres == null or order.compare(minres, c) > 0 then minres = c
-                       c = max(o2)
+                       c = maxi(o2)
                        if c == null then continue
                        if maxres == null or order.compare(maxres, c) < 0 then maxres = c
                end
@@ -103,8 +101,8 @@ private class LinexComparator
                #if minres != maxres then print "* {o} {minres}..{maxres}"
        end
        redef fun compare(a,b) do
-               var ma = min(a)
-               var mb = min(b)
+               var ma = mini(a)
+               var mb = mini(b)
                if ma == null then
                        if mb == null then return 0 else return -1
                else if mb == null then
@@ -138,7 +136,7 @@ end
 # Interesting elements must be selected. See `mmodules`, ``
 # Display configuration can be set. See `cluster_group`, `project_group`
 class MProjectDot
-       super Streamable
+       super Writable
 
        # The model where to look for information
        var model: Model
@@ -163,7 +161,7 @@ class MProjectDot
        var project_group = true is writable
 
        # Recursively generate node and clusters for a mgroup
-       private fun dot_cluster(o: OStream, mgroup: MGroup)
+       private fun dot_cluster(o: Writer, mgroup: MGroup)
        do
                # Open the cluster, if required
                if mgroup.parent == null then