/*
 *    Debrief - the Open Source Maritime Analysis Application
 *    http://debrief.info
 *
 *    (C) 2000-2014, PlanetMayo Ltd
 *
 *    This library is free software; you can redistribute it and/or
 *    modify it under the terms of the Eclipse Public License v1.0
 *    (http://www.eclipse.org/legal/epl-v10.html)
 *
 *    This library is distributed in the hope that it will be useful,
 *    but WITHOUT ANY WARRANTY; without even the implied warranty of
 *    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. 
 */
package org.mwc.debrief.satc_interface;

import org.eclipse.jface.resource.ImageDescriptor;
import org.mwc.cmap.core.ui_support.CoreViewLabelProvider.ViewLabelImageHelper;
import org.mwc.debrief.satc_interface.data.SATC_Solution;
import org.mwc.debrief.satc_interface.data.wrappers.BMC_Wrapper;
import org.mwc.debrief.satc_interface.data.wrappers.ContributionWrapper;
import org.mwc.debrief.satc_interface.data.wrappers.FMC_Wrapper;
import org.mwc.debrief.satc_interface.data.wrappers.StraightLegWrapper;

import MWC.GUI.Editable;

import com.planetmayo.debrief.satc.model.contributions.BaseContribution;
import com.planetmayo.debrief.satc.model.contributions.CourseForecastContribution;
import com.planetmayo.debrief.satc.model.contributions.RangeForecastContribution;
import com.planetmayo.debrief.satc.model.contributions.SpeedForecastContribution;

public class SATC_ImageHelper implements ViewLabelImageHelper
{

	public ImageDescriptor getImageFor(final Editable editable)
	{
		ImageDescriptor res = null;

		// TODO - switch to frequency icon, when we have one.
		
		if (editable instanceof SATC_Solution)
			res = SATC_Interface_Activator.getImageDescriptor("icons/calculator.gif");
		else if (editable instanceof StraightLegWrapper)
			res = SATC_Interface_Activator.getImageDescriptor("icons/leg.png");
		else if (editable instanceof BMC_Wrapper.BearingMeasurementEditable)
			res = SATC_Interface_Activator.getImageDescriptor("icons/bearings.gif");
		else if (editable instanceof FMC_Wrapper.MeasurementEditable)
			res = SATC_Interface_Activator.getImageDescriptor("icons/bearings.gif");
		else if (editable instanceof StraightLegWrapper)
			res = SATC_Interface_Activator.getImageDescriptor("icons/leg.png");
		else if (editable instanceof ContributionWrapper)
		{
			ContributionWrapper cw = (ContributionWrapper) editable;
			BaseContribution cont = cw.getContribution();
			if (cont instanceof CourseForecastContribution)
				res = SATC_Interface_Activator
						.getImageDescriptor("icons/direction.png");
			else if (cont instanceof SpeedForecastContribution)
				res = SATC_Interface_Activator.getImageDescriptor("icons/speed.png");
			else if (cont instanceof RangeForecastContribution)
				res = SATC_Interface_Activator.getImageDescriptor("icons/range.png");
		}
		return res;
	}

}

@@ -1225,32 +1225,119 @@
 tContribution;%0D%0A
+import com.planetmayo.debrief.satc.model.contributions.Range1959ForecastContribution;%0D%0A
 import com.plane
@@ -1659,69 +1659,8 @@
 %0D%0A%0D%0A
-%09%09// TODO - switch to frequency icon, when we have one.%0D%0A%09%09%0D%0A
 %09%09if
@@ -1761,22 +1761,23 @@
 ons/
-calculator.gif
+16/scenario.png
 %22);%0D
@@ -1881,32 +1881,35 @@
 scriptor(%22icons/
+16/
 leg.png%22);%0D%0A%09%09el
@@ -1961,32 +1961,31 @@
 gMeasurement
-Editable
+Wrapper
 )%0D%0A%09%09%09res = 
@@ -2031,36 +2031,38 @@
 ptor(%22icons/
+16/
 bearing
-s.gif
+.png
 %22);%0D%0A%09%09else 
@@ -2097,16 +2097,25 @@
 Wrapper.
+Frequency
 Measurem
@@ -2192,20 +2192,24 @@
 ons/
-bearings.gif
+16/frequency.png
 %22);%0D
@@ -2236,35 +2236,152 @@
  instanceof 
-StraightLeg
+BMC_Wrapper)%0D%0A%09%09%09res = SATC_Interface_Activator.getImageDescriptor(%22icons/16/bearing.png%22);%0D%0A%09%09else if (editable instanceof FMC_
 Wrapper)%0D%0A%09%09
@@ -2438,19 +2438,28 @@
 (%22icons/
-leg
+16/frequency
 .png%22);%0D
@@ -2749,16 +2749,19 @@
 (%22icons/
+16/
 directio
@@ -2887,16 +2887,19 @@
 (%22icons/
+16/
 speed.pn
@@ -3021,16 +3021,157 @@
 (%22icons/
+16/range.png%22);%0D%0A%09%09%09else if (cont instanceof Range1959ForecastContribution)%0D%0A%09%09%09%09res = SATC_Interface_Activator.getImageDescriptor(%22icons/16/
 range.pn

switch to new images