public void Init() { model = new Model(); testModel = model.Repo.CreateModel("testModel", "RobotsMetamodel"); model.ModelName = testModel.Name; testNodeType = testModel.Metamodel.FindElement("FinalNode") as Repo.INode; testEdgeType = testModel.Metamodel.FindElement("Link") as Repo.IEdge; }
private void RaiseNewEdgeInRepo(Repo.IEdge edge, NodeViewModel prevVer, NodeViewModel ctrlVer) { var args = new EdgeEventArgs { Edge = edge, PrevVer = prevVer, CtrlVer = ctrlVer }; this.NewEdgeInRepo?.Invoke(this, args); }
/// <summary> /// Checking if Edge is initialized with constraint violation /// For now (02.04) checks if generalization is a one-side edge /// </summary> public static bool CheckEdge(Repo.IEdge edge, Repo.IRepo repo, string modelName) { return(true); /* * return repo.Model(modelName).Edges.Any(otherEdge => * ((otherEdge.edgeType == Repo.EdgeType.Generalization) * && (edge.edgeType == Repo.EdgeType.Generalization) * && (otherEdge.source == edge.target) * && (otherEdge.target == edge.source))); */ }
private void CreateEdge(Repo.IEdge edge) { var prevVerVertex = this.prevVer?.Vertex as DataVertex; var ctrlVerVertex = this.ctrlVer?.Vertex as DataVertex; if (prevVerVertex == null || ctrlVerVertex == null) { return; } var newEdge = new DataEdge(prevVerVertex, ctrlVerVertex, true); this.dataGraph.AddEdge(newEdge); this.DrawNewEdge(prevVerVertex.Node, ctrlVerVertex.Node); var ec = new EdgeControl(this.prevVer, this.ctrlVer, newEdge); this.g_Area.InsertEdge(newEdge, ec); }
public void NewEdge(Repo.IEdge edge, NodeViewModel prevVer, NodeViewModel ctrlVer) { this.RaiseNewEdgeInRepo(edge, prevVer, ctrlVer); }
/// <summary> /// Checking if edge is initialized with constraint violation /// For now (02.04) checks if generalization is a one-side edge. /// </summary> public static bool CheckEdge(Repo.IEdge edge, Repo.IRepo repo, string modelName) { return(true); // TODO }