store colors after build
authorMarkus Kaiser <markus.kaiser@in.tum.de>
Sun, 14 Oct 2012 21:02:14 +0200
changeset 49854 c541bbad7024
parent 49853 875ed58b3b65
child 49855 b3110dec1a32
child 49857 7bf407d77152
store colors after build
src/Tools/Graphview/src/model.scala
--- a/src/Tools/Graphview/src/model.scala	Sun Oct 14 19:16:39 2012 +0200
+++ b/src/Tools/Graphview/src/model.scala	Sun Oct 14 21:02:14 2012 +0200
@@ -93,13 +93,14 @@
   def colors = _colors
   
   private def build_colors() {
-    (Map[String, Color]() /: Colors()) ({
-        case (colors, (enabled, color, mutator)) => {
-            (colors /: mutator.mutate(graph, graph).keys) ({
-                case (colors, k) => colors + (k -> color)
-              })
-          }
-    })
+    _colors = 
+      (Map[String, Color]() /: Colors()) ({
+          case (colors, (enabled, color, mutator)) => {
+              (colors /: mutator.mutate(graph, graph).keys) ({
+                  case (colors, k) => colors + (k -> color)
+                })
+            }
+      })
   }
   Colors.events += { case _ => build_colors() }
-}
\ No newline at end of file
+}