public void DeleteSelection(GraphApp app) { List <GUIEdge> localEdges = new List <GUIEdge>(); foreach (ISelectable i in currentSelection) { GUIVertex gv = i as GUIVertex; if (gv != null) { RemoveVertex(gv, app); foreach (GUIEdge ge in gv.GetEdges()) { localEdges.Add(ge); } continue; } GUIEdge e = i as GUIEdge; if (e != null) { RemoveEdge(e, app); continue; } } foreach (GUIEdge connected in localEdges) { RemoveEdge(connected, app); } Refresh(); }
public void AddEdge(GUIVertex start, GUIVertex end, Edge e) { GUIEdge edge = new GUIEdge(start, end, e); edge.Brush = GUIEdge.DefaultBrush; edge.LineWidth = GUIEdge.DefaultLineWidth; edges.Add(edge); selectables.Add(edge); Refresh(); }
public void RemoveEdge(GUIEdge e) { edges.Remove(e); }
public void AddEdge(GUIEdge e) { edges.Add(e); }
private void RemoveEdge(GUIEdge e, GraphApp app) { app.RemoveEdge(e.Edge); edges.Remove(e); selectables.Remove(e); }