private void Initialize() { graphCounter = 0; graphEntries = new List <GraphEntry>(); currentGraphEntry = new GraphEntry(); }
private void NewGraph(int n, int m, int seed, bool isBipartite) { string str = "Graph: " + n + " " + m + " " + seed + " " + graphCounter; graphCounter++; GraphParameters gp = new GraphParameters(n, m, seed, isBipartite); UGraph uGraph = new UGraph(gp); GraphDisplay graphDisplay = new GraphDisplay(uGraph); /* if (isBipartite) * graphDisplay.BipartiteInit(); * else */ graphDisplay.CircleInit(); int[] coloring = Utility.InitIntArray(n, 0); GraphEntry ge = new GraphEntry(gp, uGraph, graphDisplay, coloring); graphListBox.Items.Add(str); graphEntries.Add(ge); graphListBox.SetSelected(graphListBox.Items.Count - 1, true); }
private void OnRemoveAllClick(object sender, EventArgs e) { graphListBox.Items.Clear(); graphEntries.Clear(); textBox2.Text = ""; currentGraphEntry = new GraphEntry(); UpdateDisplay(); }
private void OnSelectedGraphChanged(object sender, EventArgs e) { int index = graphListBox.SelectedIndex; if (index == -1) { currentGraphEntry = new GraphEntry(); } else { currentGraphEntry = graphEntries[index]; } UpdateDisplay(); }