Exemple #1
0
        /// <summary>
        /// Initiates the presenter form.
        /// </summary>
        public Presenter()
        {
            InitializeComponent();

            cb_choose_alg.Items.AddRange(Algorithms.ToArray());
            cb_choose_alg.SelectedIndex = 0;
            SelectedAlgorithm           = Algorithms[cb_choose_alg.SelectedIndex];

            cb_graph_type.Items.AddRange(Enum.GetNames(typeof(GraphType)));
            cb_graph_type.SelectedIndex = 0;

            DrawingPanelHelper     = new DrawingPanelHelper(this, drawing_panel, SelectedAlgorithm);
            EdgeHolder             = new EdgeHolder();
            NodeHolder             = new NodeHolder();
            NodeHolder.Terminated += TerminationDetected;

            clb_algorithmTypes.Items.AddRange(Algorithms.ToArray());
            clb_graphTypes.Items.AddRange(Enum.GetNames(typeof(GraphType)));

            visualSimulatorPanel.Dock = DockStyle.Fill; // remove this

            PerformanceAnalyserFormOperations = new PerformanceAnalyserFormOperations(this);
            btn_cancel.Click += new EventHandler(PerformanceAnalyserFormOperations.btn_cancel_Click);
            btn_runPerformanceAnalysis.Click += new EventHandler(PerformanceAnalyserFormOperations.btn_runPerformanceAnalysis_Click);

            GraphPersister = new GraphPersister(this);
            saveTopologyToolStripMenuItem.Click   += GraphPersister.SaveTopology;
            importTopologyToolStripMenuItem.Click += GraphPersister.ImportTopology;
        }
Exemple #2
0
        /// <summary>
        /// Clears the drawing panel.
        /// </summary>
        /// <param name="sender"></param>
        /// <param name="e"></param>
        private void btn_clear_Click(object sender, EventArgs e)
        {
            DrawingPanelHelper.ClearPanel();

            NodeHolder.EmptyAllNodes();
            EdgeHolder.EmptyAllEdges();

            tb_console.Clear();

            cb_choose_alg.Enabled = true;
            if (cb_choose_alg.SelectedIndex == -1)
            {
                cb_choose_alg.SelectedIndex = 1;
            }
        }