Esempio n. 1
0
        /// <summary>
        /// Listview context menu click event for visualisation. Opens new form with graph visualisation.
        /// </summary>
        /// <param name="sender"></param>
        /// <param name="e"></param>
        private void vizualizovatToolStripMenuItem_Click(object sender, EventArgs e)
        {
            int index = listView1.FocusedItem.Index;

            if (graphs.ContainsKey(index))
            {
                FormVizSetup fviz = new FormVizSetup();
                if (fviz.ShowDialog() == DialogResult.OK)
                {
                    var g = graphs[index];
                    if (g.type == GraphItem.BA)
                    {
                        b = new BAform(g.graph.GetNodes(), fviz.steps, g.graph.m);
                        b.ShowDialog();
                    }
                    else if (g.type == GraphItem.NM)
                    {
                        var b = new NP_NMform(g.graph.GetNodes(), fviz.steps, g.graph.dict);
                        b.ShowDialog();
                    }
                    else if (g.type == GraphItem.NP)
                    {
                        var b = new NP_NMform(g.graph.GetNodes(), fviz.steps, g.graph.dict);
                        b.ShowDialog();
                    }
                }
            }
            else
            {
                MessageBox.Show("Vizualizáciu je možné zrealizovať až po dokončení generovania.", "Nemožno vizualizovať");
            }
        }
 public void Draw()
 {
     if (this.GetNodes() != null)
     {
         BAform b = new BAform(this.GetNodes(), 20, this.m);
         b.ShowDialog();
     }
 }