package edu.claflin.cyfinder.internal.tasks.factories;

import java.util.ArrayList;
import java.util.Arrays;

import org.cytoscape.model.CyNetwork;
import org.cytoscape.task.AbstractNetworkTaskFactory;
import org.cytoscape.work.TaskIterator;

import edu.claflin.cyfinder.internal.tasks.DisplayGraphTask;
import edu.claflin.cyfinder.internal.tasks.MakeUndirectedTask;
import edu.claflin.cyfinder.internal.tasks.TitleTask;

public class DisplayGraphTaskFactory extends AbstractNetworkTaskFactory
{

	@Override
	public TaskIterator createTaskIterator(CyNetwork cn)
	{
		TaskIterator t = new TaskIterator();
		t.append(new TitleTask(cn, "Displaying Graph."));
		t.append(new MakeUndirectedTask(new ArrayList<CyNetwork>(Arrays.asList(cn)), false));
		t.append(new DisplayGraphTask(cn));
		return t;		
	}

}
