privatedef movePanelUp(m: Mutator_Panel) = { def moveUp(l: List[Mutator_Panel]): List[Mutator_Panel] =
l match { case x :: y :: xs => if (y == m) y :: x :: xs else x :: moveUp(y :: xs) case _ => l
}
panels = moveUp(panels)
}
privatedef movePanelDown(m: Mutator_Panel) = { def moveDown(l: List[Mutator_Panel]): List[Mutator_Panel] =
l match { case x :: y :: xs => if (x == m) y :: x :: xs else x :: moveDown(y :: xs) case _ => l
}
def get_mutator: Mutator.Info = { val model = graphview.model val m =
initials.mutator match { case Mutator.Identity() =>
Mutator.Identity() case Mutator.Node_Expression(r, _, _, _) => val r1 = inputs(2)._2.string
Mutator.Node_Expression( if (Library.make_regex(r1).isDefined) r1 else r,
inputs(3)._2.bool,
// "Parents" means "Show parents" or "Matching Children"
inputs(1)._2.bool,
inputs(0)._2.bool) case Mutator.Node_List(_, _, _, _) =>
Mutator.Node_List( for {
ident <- space_explode(',', inputs(2)._2.string)
node <- model.find_node(ident)
} yield node,
inputs(3)._2.bool,
// "Parents" means "Show parents" or "Matching Children"
inputs(1)._2.bool,
inputs(0)._2.bool) case Mutator.Edge_Endpoints(_) =>
(model.find_node(inputs(0)._2.string), model.find_node(inputs(1)._2.string)) match{ case (Some(node1), Some(node2)) =>
Mutator.Edge_Endpoints((node1, node2)) case _ =>
Mutator.Identity()
} case Mutator.Add_Node_Expression(r) => val r1 = inputs(0)._2.string
Mutator.Add_Node_Expression(if (Library.make_regex(r1).isDefined) r1 else r) case Mutator.Add_Transitive_Closure(_, _) =>
Mutator.Add_Transitive_Closure(
inputs(0)._2.bool,
inputs(1)._2.bool) case _ =>
Mutator.Identity()
}
Mutator.Info(enabledBox.selected, background, m)
}
privatedef get_inputs(): List[(String, Input)] =
initials.mutator match { case Mutator.Node_Expression(regex, reverse, check_parents, check_children) =>
List(
("", new Check_Box_Input("Parents", check_children)),
("", new Check_Box_Input("Children", check_parents)),
("Regex", new Text_Field_Input(regex, x => Library.make_regex(x).isDefined)),
("", new Check_Box_Input(reverse_caption, reverse))) case Mutator.Node_List(list, reverse, check_parents, check_children) =>
List(
("", new Check_Box_Input("Parents", check_children)),
("", new Check_Box_Input("Children", check_parents)),
("Names", new Text_Field_Input(list.map(_.ident).mkString(","))),
("", new Check_Box_Input(reverse_caption, reverse))) case Mutator.Edge_Endpoints((source, dest)) =>
List(
("Source", new Text_Field_Input(source.ident)),
("Destination", new Text_Field_Input(dest.ident))) case Mutator.Add_Node_Expression(regex) =>
List(("Regex", new Text_Field_Input(regex, x => Library.make_regex(x).isDefined))) case Mutator.Add_Transitive_Closure(parents, children) =>
List(
("", new Check_Box_Input("Parents", parents)),
("", new Check_Box_Input("Children", children))) case _ => Nil
}
}
¤ Die Informationen auf dieser Webseite wurden
nach bestem Wissen sorgfältig zusammengestellt. Es wird jedoch weder Vollständigkeit, noch Richtigkeit,
noch Qualität der bereit gestellten Informationen zugesichert.0.16Bemerkung:
(vorverarbeitet)
¤
Die Informationen auf dieser Webseite wurden
nach bestem Wissen sorgfältig zusammengestellt. Es wird jedoch weder Vollständigkeit, noch Richtigkeit,
noch Qualität der bereit gestellten Informationen zugesichert.
Bemerkung:
Die farbliche Syntaxdarstellung ist noch experimentell.