docs: @SuppressWarnings("unchecked")
  	public void setGraph(Preview preview, Color[] colors) {
  		if (preview == null) {
  			// no preview received
  		    this.measureOverview.update(null, "", null);
  			this.graphCanvas.setGraph(null, null, null, 1000, null);
  			this.paramGraphCanvas.setGraph(null, null, null, null);
  			this.budgetGraphCanvas.setGraph(null, null, null, null);
  			return;
  		}
  
  		ParsedPreview pp;
  		ParsedPreview ppStd;
  
  		// check which type of task it is
  		Class<?> c = preview.getTaskClass();
  		if (c == ALPartitionEvaluationTask.class || c == ALMultiParamTask.class) {
  			// PreviewCollection
  			PreviewCollection<Preview> pc = (PreviewCollection<Preview>) preview;
  
  	         // get varied parameter name and values
  			this.variedParamName = pc.getVariedParamName();
              this.variedParamValues = pc.getVariedParamValues();
  
  			if (c == ALPartitionEvaluationTask.class) {
  				// calculate mean preview collection for each parameter value
  				MeanPreviewCollection mpc = new MeanPreviewCollection(
  						(PreviewCollection<PreviewCollection<Preview>>) preview);
  				pp = readCollection(mpc.getMeanPreviews());
  				ppStd = readCollection(mpc.getStdPreviews());
  
  				this.graphCanvas.setStandardDeviationPainted(true);
  				this.paramGraphCanvas.setStandardDeviationPainted(true);
  			} else {
  				pp = readCollection(pc);
  				ppStd = null;
  			    this.graphCanvas.setStandardDeviationPainted(false);
  			    this.paramGraphCanvas.setStandardDeviationPainted(false);
  			}
  
  			// enable param and budget graph
  			this.graphPanelTabbedPane.setEnabledAt(1, true);
              this.graphPanelTabbedPane.setEnabledAt(2, true);
  
      	} else if (c == ALPrequentialEvaluationTask.class) {
      		// read Preview (in this case, no special preview is required)
      		pp = read(preview);
      		ppStd = null;
  
      		// reset varied param name and values
      		this.variedParamName = "";
      		this.variedParamValues = null;
  
     			// switch to Processed Instances tab
      		this.graphPanelTabbedPane.setSelectedIndex(0);
  
  			// disable param and budget view
  			this.graphPanelTabbedPane.setEnabledAt(1, false);
              this.graphPanelTabbedPane.setEnabledAt(2, false);
  
              // disable painting standard deviation
      		this.graphCanvas.setStandardDeviationPainted(false);
              this.paramGraphCanvas.setStandardDeviationPainted(false);
  
      	} else {
      		// sth went wrong
      	    this.measureOverview.update(null, "", null);
      		this.graphCanvas.setGraph(null, null, null, 1000, null);
      		this.paramGraphCanvas.setGraph(null, null, null, null);
      		this.budgetGraphCanvas.setGraph(null, null, null, null);
  			return;
      	}
  
  		MeasureCollection[] measures = pp.getMeasureCollectionsArray();
  		MeasureCollection[] measuresStd = null;
  		if (ppStd != null) {
  			measuresStd = ppStd.getMeasureCollectionsArray();
  		}
  
  		// restructure latest budgets to make them readable for the
  		// GraphScatter class
  		this.budgets = new double[measures.length];
  		for (int i = 0; i < measures.length; i++) {
  			this.budgets[i] = measures[i].getLastValue(6);
  		}
  
  		int[] pfs = pp.getProcessFrequenciesArray();
  		int min_pf = min(pfs);
  
  		this.measureOverview.update(measures, this.variedParamName, this.variedParamValues);
  		this.graphCanvas.setGraph(measures, measuresStd, pfs, min_pf, colors);
  		this.paramGraphCanvas.setGraph(measures, measuresStd, this.variedParamValues, colors);
  		this.budgetGraphCanvas.setGraph(measures, measuresStd, this.budgets, colors);
  	}