/* Can only play animation if the home and destination nodes are set and * there are nodes in the graph */ public void AddAnimation(Animation anim) { this.anim = anim; this.comboBox1.Text = anim.ToString(); this.comboBox1.Items.Add(anim.ToString()); animations.Add(anim); }
private void newButton(object sender, System.EventArgs e) { graph.Clear(); this.inkOverlay.Ink.DeleteStrokes(inkOverlay.Ink.Strokes); penButton(sender, e); if (anim != null) { anim.Stop(); } anim = new DijkstraAnimation(this); comboBox1.Text = anim.ToString(); togglePlayPause(PLAY); Invalidate(); }
private void newButton(object sender, System.EventArgs e) { graph.Clear(); this.inkOverlay.Ink.DeleteStrokes(inkOverlay.Ink.Strokes); penButton(sender, e); if(anim != null) anim.Stop(); anim = new DijkstraAnimation(this); comboBox1.Text = anim.ToString(); togglePlayPause(PLAY); Invalidate(); }