gt: 			if (this.CanvasSize != null)
context: package org.um.feri.ears.graphing;
  
  import java.awt.Dimension;
  import java.util.ArrayList;
  import java.util.Collection;
  import java.util.Collections;
  import java.util.Enumeration;
  import java.util.Hashtable;
  import java.util.Map;
  
  import org.um.feri.ears.algorithms.Algorithm;
  import org.um.feri.ears.algorithms.MOAlgorithm;
  import org.um.feri.ears.graphing.data.GraphDataSet;
  import org.um.feri.ears.graphing.data.RecordedData;
  import org.um.feri.ears.problems.Problem;
  import org.um.feri.ears.problems.moo.MOSolutionBase;
  
  import com.panayotis.gnuplot.plot.DataSetPlot;
  import com.panayotis.gnuplot.style.NamedPlotColor;
  import com.panayotis.gnuplot.style.PlotColor;
  import com.panayotis.gnuplot.style.PlotStyle;
  import com.panayotis.gnuplot.style.RgbPlotColor;
  
  
  public class GraphSet
  {
  	// Vars:
  	protected ArrayList<GraphEARS> graphs;
  	protected GraphDataSet data;
  	// SubVars:
  	protected PlotColorScheme plotColorScheme = PlotColorScheme.Colored;
  	protected Dimension CanvasSize = null;
  	protected double zoomLevel = 1.0;
  	protected Integer AnimationDuration = null;
  	protected Long EvaluationsPerFrame = null;
  	protected Integer FramesPerSecond = null;
  	protected Boolean outputAutomatic = null;
  	protected Boolean overwrite = null;
  	// Constants:
  	protected final static NamedPlotColor[] MULTI_PLOT_COLORS = new NamedPlotColor[]{NamedPlotColor.RED,NamedPlotColor.BLUE,NamedPlotColor.GREEN,NamedPlotColor.VIOLET,
  		NamedPlotColor.BROWN, NamedPlotColor.YELLOW, NamedPlotColor.MAGENTA, NamedPlotColor.BLACK, NamedPlotColor.PINK,NamedPlotColor.BEIGE, NamedPlotColor.CYAN, NamedPlotColor.PURPLE};
  																
  	
  	
  	// Constructor:
  	/**
  	 * Constructor for graph set with no contents.
  	 */
  	public GraphSet()
  	{
  		this.graphs = new ArrayList<GraphEARS>();
  	}
  	/**
  	 * Constructor for graph set containing graphs made with passed data set.
  	 * @param data Data set containing data subsets for all graphs.
  	 */
  	public GraphSet(GraphDataSet data)
  	{
  		this(data, 0);
  	}
  	/**
  	 * Constructor for graph set containing graphs made with passed data set.
  	 * Filters creation of graphs, static, animated, or both.
  	 * @param data Data set containing data subsets for all graphs.
  	 * @param type Type of graphs to create. (0-All, 1-Static, 2-Animated)
  	 */
  	public GraphSet(GraphDataSet data, int type)
  	{
  		this(data.getSubsets(), type);
  	}
  
  	public GraphSet(GraphDataSet data, int type, int evalsPerStep)
  	{
  		this(data.getSubsets(), type, evalsPerStep);
  	}
  	/**
  	 * Constructor for graph set containing graphs made with passed data set.
  	 * @param data Data set containing data subsets for all graphs.
  	 */
  	public GraphSet(RecordedData[][] allData)
  	{
  		this(allData, 0);
  	}
  	/**
  	 * Constructor for graph set containing graphs made with passed data set.
  	 * Filters creation of graphs, static, animated, or both.
  	 * @param data Data set containing data subsets for all graphs.
  	 * @param type Type of graphs to create. (0-All, 1-Static, 2-Animated)
  	 */
  	public GraphSet(RecordedData[][] allData, int type)
  	{
  		this(allData, type, GraphEARSStatic.DEFAULT_EVALUATIONS_PER_STEP);
  	}
  	public GraphSet(RecordedData[][] allData, int type, int evalsPerStep)
  	{
  		this.data = new GraphDataSet(allData);
  		this.graphs = new ArrayList<GraphEARS>();
  		for (int i=0; i<allData.length; i++)
  		{
  			if (allData[i][0].algorithm instanceof Algorithm)
  			{
  				if (type == 0 || type == 1)
  					graphs.add(new GraphEARSStatic(allData[i], evalsPerStep));
  				if (type == 0 || type == 2)
  				{
  					// no supported graphs
  				}
  			}
  			else
  			{
  				System.err.println("Wrong algorithm type");
  			}
  		}
  	}
  	/**
  	 * Constructor for graph set containing graphs made with passed data set.
  	 * Filters creation of graphs, static, animated, or both. Limits to graphs for specific axis combination.
  	 * @param data Data set containing data subsets for all graphs.
  	 * @param type Type of graphs to create. (0-All, 1-Static, 2-Animated)
  	 * @param objIndexX Objective index that should be presented on graphs X axis.
  	 * @param objIndexY Objective index that should be presented on graphs Y axis.
  	 */
  	public GraphSet(RecordedData[][] allData, int type, int objIndexX, int objIndexY)
  	{
  		this.data = new GraphDataSet(allData);
  		this.graphs = new ArrayList<GraphEARS>();
  		for (int i=0; i<allData.length; i++)
  		{
  			if (allData[i][0].algorithm instanceof Algorithm)
  			{
  				if (type == 0 || type == 1)
  					graphs.add(new GraphEARSStatic(allData[i]));
  				if (type == 0 || type == 2)
  				{
  					// no supported graphs
  				}
  			}
  			else if (allData[i][0].algorithm instanceof MOAlgorithm)
  			{
  				for(int i1=0; i1<1; i1++)
  				if (type == 0 || type == 1)
  					graphs.add(new GraphEARSStatic(allData[i], objIndexX, objIndexY));
  				if (type == 0 || type == 2)
  				{
  					graphs.add(new GraphEARSAnimated(allData[i], objIndexX, objIndexY));
  				}
  					
  			}
  		}
  	}
  	
  	
  	
  	// Get/Set:
  	/**
  	 * Retrieve graph from set with specific index.
  	 * @param index Index of graph.
  	 * @return Single GraphEARS object.
  	 */
  	public GraphEARS getGraph(int index)
  	{
  		return graphs.get(index);
  	}
  	public GraphEARS[] getGraphs()
  	{
  		return graphs.toArray(new GraphEARS[0]);
  	}
  	public int getGraphCount()
  	{
  		return graphs.size();
  	}
  	/**
  	 * Retrieve data that is/will be displayed on a selected graph.
  	 * @param index Index of graph in set.
  	 * @return Array of recorded data samples.
  	 */
  	public RecordedData[] getGraphDataSet(int index)
  	{
  		return data.getSubsets()[index];
  	}
  	
  	
  	// Add:
  	public void add(GraphEARS grph)
  	{
  		this.data.add(grph.data);
  		this.graphs.add(grph);
  		if (this.CanvasSize != null)
  			grph.setCanvasSize(CanvasSize);
  		if (this.AnimationDuration != null)
  			if (grph instanceof GraphEARSAnimated)
  				((GraphEARSAnimated)grph).setAnimationDuration(AnimationDuration);
  		if (this.EvaluationsPerFrame != null)
  			if (grph instanceof GraphEARSAnimated)
  				((GraphEARSAnimated)grph).setAnimationEvaluationsPerFrame(EvaluationsPerFrame);
  		if (this.FramesPerSecond != null)
  			if (grph instanceof GraphEARSAnimated)
  				((GraphEARSAnimated)grph).setAnimationFramesPerSecond(FramesPerSecond);
  		if (this.outputAutomatic != null)
  			grph.setOutputFileAutomatic();
  	}
  	public void add(Collection<GraphEARS> grphs)
  	{
  		for (GraphEARS g : grphs)
  		{
  			this.graphs.add(g);
  		}
  	}
  	public void add(GraphDataSet other)
  	{
  		GraphSet t = new GraphSet(other);
  		GraphEARS[] g = t.getGraphs();
  		for (int i=0; i<g.length; i++)
  		{
  