package nl.tudelft.dnainator.ui;

import nl.tudelft.dnainator.graph.DNAGraph;
import nl.tudelft.dnainator.graph.DNALayout;

import org.graphstream.graph.Graph;
import org.graphstream.ui.layout.Layout;
import org.graphstream.ui.view.Viewer;

/**
 * The viewer is responsible for managing the interactable views of the the strain graph.
 * Use the addDefaultView() method to obtain a view.
 */
public class DNAViewer extends Viewer {
	/**
	 * Creates a new GraphViewer, with a default graph
	 * and ThreadingModel.GRAPH_IN_ANOTHER_THREAD.
	 */
	public DNAViewer() {
		this(new DNAGraph(), ThreadingModel.GRAPH_IN_ANOTHER_THREAD);
	}

	/**
	 * Creates a new GraphViewer, with ThreadingModel.GRAPH_IN_ANOTHER_THREAD.
	 * @param graph The graph of strains.
	 */
	public DNAViewer(Graph graph) {
		this(graph, ThreadingModel.GRAPH_IN_ANOTHER_THREAD);
	}

	/**
	 * Creates a new GraphViewer.
	 * @param graph	The graph of strains.
	 * @param model	The ThreadingModel to use.
	 */
	public DNAViewer(Graph graph, ThreadingModel model) {
		super(graph, model);
		
		Layout layout = new DNALayout(graph);
		this.enableAutoLayout(layout);
		this.setCloseFramePolicy(Viewer.CloseFramePolicy.EXIT);
	}
}

@@ -75,129 +75,43 @@
 ph;%0A
-import nl.tudelft.dnainator.graph.DNALayout;%0A%0Aimport org.graphstream.graph.Graph;%0Aimport org.graphstream.ui.layout.Layout
+%0Aimport org.graphstream.graph.Graph
 ;%0Aim
@@ -965,48 +965,8 @@
 %0A%09%09%0A
-%09%09Layout layout = new DNALayout(graph);%0A
 %09%09th
@@ -989,14 +989,8 @@
 out(
-layout
 );%0A%09

Remove tree layout, use default layout instead.