public void rearrangeGraphFromModel(Model.SBML.Model model, IDrawingInterface drawable) { if (!finishing) { if (thread != null) { thread.stop(); Console.WriteLine("Rearrange thread already running"); } GraphLayoutManager rearranger = new GraphLayoutManager_SpringEmbedder(); thread = new RearrangeThread(rearranger, model, drawable); Thread newThread = new Thread(new ThreadStart(thread.run)); thread.setThread(newThread); newThread.Start(); } }
protected void rearrangeThreadFinished(MacroCommand command) { if (listener != null) { listener.rearrangementComplete(command); } thread = null; Console.WriteLine("Rearrange thread finished"); if (finishing) { Console.WriteLine("Rearrange thread cleaned up"); Application.Exit(); } }
public GraphLayoutThreadManager() { thread = null; finishing = false; }