private void openFileBtn_Click(object sender, EventArgs e) { OpenFileDialog open = new OpenFileDialog(); open.CheckFileExists = true; if (open.ShowDialog() == DialogResult.OK) { Algoritmi.UcitajDatoteku(open.FileName); Algoritmi.CrtajSve(Algoritmi.root, 1, 50, drawPanel.Width / 2); } }
private void findBtn_Click(object sender, EventArgs e) { Stopwatch sw = new Stopwatch(); sw.Start(); Cvor found = Algoritmi.NadjiCvor(Convert.ToInt32(findBox.Text)); sw.Stop(); timeLabel.Text = sw.ElapsedMilliseconds.ToString() + " ms"; Algoritmi.graphicsObj.Clear(Color.DimGray); Algoritmi.CrtajSve(Algoritmi.root, 1, 50, drawPanel.Width / 2); found.Graf.CrtajCvor(false); findBox.Text = ""; }
private void deleteBtn_Click(object sender, EventArgs e) { if (delBox.Text.Length != 0) { Stopwatch sw = new Stopwatch(); sw.Start(); Algoritmi.IzbrisiCvor(Convert.ToInt32(delBox.Text)); sw.Stop(); timeLabel.Text = sw.ElapsedMilliseconds.ToString() + " ms"; Algoritmi.graphicsObj.Clear(Color.DimGray); Algoritmi.CrtajSve(Algoritmi.root, 1, 50, drawPanel.Width / 2); } delBox.Text = ""; }
private void addBtn_Click(object sender, EventArgs e) { if (nodeBox.Text.Length != 0) { Stopwatch sw = new Stopwatch(); sw.Start(); Algoritmi.root = Algoritmi.DodajCvor(Algoritmi.root, Convert.ToInt32(nodeBox.Text)); Algoritmi.PostaviVisine(Algoritmi.tmpCvor); sw.Stop(); timeLabel.Text = sw.ElapsedMilliseconds.ToString() + " ms"; Algoritmi.graphicsObj.Clear(Color.DimGray); Algoritmi.CrtajSve(Algoritmi.root, 1, 50, drawPanel.Width / 2); } nodeBox.Text = ""; }
private void drawPanel_Paint(object sender, PaintEventArgs e) { Algoritmi.graphicsObj.Clear(Color.DimGray); Algoritmi.CrtajSve(Algoritmi.root, 1, 50, drawPanel.Width / 2); }