public void display(TableElement element, ArrayList<Boolean> selected) {
		// Retrieves the matches for selected spectrum and finds them in the
		// model.
		ArrayList<TableElement> elements = new ArrayList<TableElement>();
		_current = element;
		if(selected == null)
			_options.setCurrentElement(element);
		ArrayList<Integer> matchIndices = element.getMatches();
		if(selected == null || selected.get(0))
			elements.add(element);
		for (int i = 0; i < matchIndices.size(); i++) {
			if (selected == null || selected.get(i+1))
				elements.add(MODEL.get(matchIndices.get(i)));
		}

		for (int i = 0; i < elements.size(); i++) {
			// Initialize spectrum retrieves the necessary data to plot from
			// each fit file
			elements.get(i).initializeSpectrum();

			// The colors are assigned by dividing up the color wheel according
			// to the number of spectra, excluding red (for ratio).
			elements.get(i).setColor(
					Color.getHSBColor((float) ( i + 1 )
							/ ( elements.size() + 1 ), 1, (float) 0.7));
		}

		// Removes what is already there (if anything), before reassigning.
		_plots.clear();
		_panel.removeAll();

		_plots.add(new SpectrumPlotter(elements, this, false));
		_panel.add(_plots.get(0));

		// This second bit initializes the ratio plot only if there are two
		// matching spectra.
		if (elements.size() == 2) {
			TableElement ratio = calculateRatio(elements.get(0),
					elements.get(1));
			ratio.setColor(Color.red);
			ArrayList<TableElement> tmp = new ArrayList<TableElement>();
			tmp.add(ratio);

			_plots.add(new SpectrumPlotter(tmp, this, true));
			_panel.add(_plots.get(1));
		}

		// Reinitialize and populate the legend.
		right.removeAll();
		for (TableElement current : elements)
			right.add(createLegend(current));

		// Show the window.
		pack();
		setLocationRelativeTo(null);
		setVisible(true);
	}