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