Beispiel #1
0
        /// <summary>
        /// charger le graphe2
        /// </summary>
        /// <param name="sender"></param>
        /// <param name="e"></param>
        private void chargeDuGraphe2ToolStripMenuItem_Click(object sender, EventArgs e)
        {
            if (this.pictureBoxGraphe2.Image != null)
            {
                pictureBoxGraphe2.Image.Dispose();
            }
            // this.isoLP.Graph2 = GraphLibManager.LoadGraph(this.richTextBoxAppariement, this.toolStripStatusLabel1);
            string nomFichier = GraphLibManager.ChoisirDirectory();

            this.isoLP.Graph2 = GraphLibManager.LoadGraph(nomFichier, comboBoxGraphe.SelectedIndex);
            if (this.isoLP.Graph2 != null)
            {
                GraphLibManager.DisplayGraph(this.isoLP.Graph2, this.pictureBoxGraphe2, "./Graph2.jpg", toolStripStatusLabel1);
                this.isoLP.Graph2.Name = "Graph2";
                if (!this.isoLP.Graph2.IsDirected)
                {
                    this.isoLP.DirectedGraph2 = GraphLibManager.LoadGraph(nomFichier, comboBoxGraphe.SelectedIndex);
                    GraphLibManager.transToDirectedGraph(this.isoLP.DirectedGraph2, false);
                    this.isoLP.DirectedGraph2.Name = "Graph2";
                }
                else
                {
                    this.isoLP.DirectedGraph2 = this.isoLP.Graph2;
                }
            }
        }
Beispiel #2
0
        /// <summary>
        /// Charger le graphe1
        /// </summary>
        /// <param name="sender"></param>
        /// <param name="e"></param>
        private void chargeDuGraphe1ToolStripMenuItem_Click(object sender, EventArgs e)
        {
            if (this.pictureBoxGraphe1.Image != null)
            {
                pictureBoxGraphe1.Image.Dispose();
            }
            string nomFichier = GraphLibManager.ChoisirDirectory();

            this.isoLP.Graph1 = GraphLibManager.LoadGraph(nomFichier, this.comboBoxGraphe.SelectedIndex);
            if (this.isoLP.Graph1 != null)
            {
                GraphLibManager.DisplayGraph(this.isoLP.Graph1, this.pictureBoxGraphe1, "./Graph1.jpg", toolStripStatusLabel1);
                this.isoLP.Graph1.Name = "Graph1";
                if (!this.isoLP.Graph1.IsDirected)
                {
                    this.isoLP.DirectedGraph1 = GraphLibManager.LoadGraph(nomFichier, this.comboBoxGraphe.SelectedIndex);
                    GraphLibManager.transToDirectedGraph(this.isoLP.DirectedGraph1, false);
                    this.isoLP.DirectedGraph1.Name = "Graph1";
                }
                else
                {
                    this.isoLP.DirectedGraph1 = this.isoLP.Graph1;
                }
            }
        }