예제 #1
0
        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);
            }
        }
예제 #2
0
        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 = "";
        }
예제 #3
0
 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 = "";
 }
예제 #4
0
 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 = "";
 }
예제 #5
0
 private void drawPanel_Paint(object sender, PaintEventArgs e)
 {
     Algoritmi.graphicsObj.Clear(Color.DimGray);
     Algoritmi.CrtajSve(Algoritmi.root, 1, 50, drawPanel.Width / 2);
 }