--- a/src/Tools/Graphview/mutator.scala Thu Jan 01 12:34:15 2015 +0100
+++ b/src/Tools/Graphview/mutator.scala Thu Jan 01 13:07:30 2015 +0100
@@ -13,30 +13,12 @@
import scala.collection.immutable.SortedSet
-trait Mutator
-{
- val name: String
- val description: String
- def mutate(complete: Model.Graph, sub: Model.Graph): Model.Graph
-
- override def toString: String = name
-}
-
-trait Filter extends Mutator
+object Mutator
{
- def mutate(complete: Model.Graph, sub: Model.Graph) = filter(sub)
- def filter(sub: Model.Graph) : Model.Graph
-}
+ sealed case class Info(enabled: Boolean, color: Color, mutator: Mutator)
-object Mutators
-{
- type Mutator_Markup = (Boolean, Color, Mutator)
-
- val Enabled = true
- val Disabled = false
-
- def create(visualizer: Visualizer, m: Mutator): Mutator_Markup =
- (Mutators.Enabled, visualizer.Colors.next, m)
+ def make(visualizer: Visualizer, m: Mutator): Info =
+ Info(true, visualizer.Colors.next, m)
class Graph_Filter(
val name: String,
@@ -174,4 +156,19 @@
if (children) add_node_group(complete, withparents, complete.all_succs(sub.keys))
else withparents
})
-}
\ No newline at end of file
+}
+
+trait Mutator
+{
+ val name: String
+ val description: String
+ def mutate(complete: Model.Graph, sub: Model.Graph): Model.Graph
+
+ override def toString: String = name
+}
+
+trait Filter extends Mutator
+{
+ def mutate(complete: Model.Graph, sub: Model.Graph) = filter(sub)
+ def filter(sub: Model.Graph) : Model.Graph
+}