/*
 *    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.core.ui;

import org.eclipse.jface.resource.ImageDescriptor;
import org.mwc.cmap.core.ui_support.CoreViewLabelProvider.ViewLabelImageHelper;
import org.mwc.debrief.core.DebriefPlugin;

import Debrief.Wrappers.FixWrapper;
import Debrief.Wrappers.LabelWrapper;
import Debrief.Wrappers.NarrativeWrapper;
import Debrief.Wrappers.SensorContactWrapper;
import Debrief.Wrappers.SensorWrapper;
import Debrief.Wrappers.ShapeWrapper;
import Debrief.Wrappers.TrackWrapper;
import Debrief.Wrappers.Track.CoreTMASegment;
import Debrief.Wrappers.Track.TrackSegment;
import MWC.GUI.Editable;
import MWC.GUI.ExternallyManagedDataLayer;
import MWC.GUI.Shapes.ChartBoundsWrapper;
import MWC.GUI.Shapes.ChartFolio;
import MWC.GUI.Shapes.PolygonShape.PolygonNode;
import MWC.TacticalData.NarrativeEntry;

public class DebriefImageHelper implements ViewLabelImageHelper
{

	public ImageDescriptor getImageFor(final Editable editable)
	{
		ImageDescriptor res = null;
		
		if (editable instanceof SensorWrapper)
			res = DebriefPlugin.getImageDescriptor("icons/16/sensor.png");
		else if (editable instanceof ChartFolio)
			res = DebriefPlugin.getImageDescriptor("icons/16/library.png");
		else if (editable instanceof ExternallyManagedDataLayer)
			res = DebriefPlugin.getImageDescriptor("icons/16/map.png");
		else if (editable instanceof ChartBoundsWrapper)
			res = DebriefPlugin.getImageDescriptor("icons/16/map.png");
		else if (editable instanceof SensorContactWrapper)
			res = DebriefPlugin.getImageDescriptor("icons/16/sensor_contact.png");
		else if (editable instanceof NarrativeWrapper)
			res = DebriefPlugin.getImageDescriptor("icons/16/narrative.png");
		else if (editable instanceof NarrativeEntry)
			res = DebriefPlugin.getImageDescriptor("icons/16/narrative_entry.png");
		else if (editable instanceof CoreTMASegment)
			res = DebriefPlugin.getImageDescriptor("icons/16/tma_segment.png");
		else if (editable instanceof TrackSegment)
			res = DebriefPlugin.getImageDescriptor("icons/16/track_segment.png");
		else if (editable instanceof FixWrapper)
			res = DebriefPlugin.getImageDescriptor("icons/16/fix.png");
		else if (editable instanceof ShapeWrapper)
			res = DebriefPlugin.getImageDescriptor("icons/16/shape.png");
		else if (editable instanceof PolygonNode)
			res = DebriefPlugin.getImageDescriptor("icons/16/polygon.png");
		else if (editable instanceof LabelWrapper)
			res = DebriefPlugin.getImageDescriptor("icons/16/shape.gif");
		else if (editable instanceof TrackWrapper)
		{
			// we're doing fancy testing here, so put it last in the list
			
			// see if it's a relative track
			TrackWrapper tw=  (TrackWrapper) editable;
			if(tw.isTMATrack())
				res = DebriefPlugin.getImageDescriptor("icons/16/track_relative.png");
			else
				res = DebriefPlugin.getImageDescriptor("icons/16/track.png");
		}
		 
		return res;
	}

}

@@ -1118,24 +1118,54 @@
 ckSegment;%0D%0A
+import MWC.GUI.DynamicLayer;%0D%0A
 import MWC.G
@@ -1214,32 +1214,83 @@
 agedDataLayer;%0D%0A
+import MWC.GUI.Chart.Painters.TimeDisplayPainter;%0D%0A
 import MWC.GUI.S
@@ -3129,14 +3129,421 @@
 ape.
-gif%22);
+png%22);%0D%0A%09%09else if (editable instanceof DynamicLayer)%0D%0A%09%09%09res = DebriefPlugin.getImageDescriptor(%22icons/16/clock.png%22);%0D%0A%09%09else if (editable instanceof TimeDisplayPainter)%0D%0A%09%09%7B%09%0D%0A%09%09%09TimeDisplayPainter tdp = (TimeDisplayPainter) editable;%0D%0A%09%09%09if(tdp.isAbsolute())%0D%0A%09%09%09%09res = DebriefPlugin.getImageDescriptor(%22icons/16/clock.png%22);%0D%0A%09%09%09else%0D%0A%09%09%09%09res = DebriefPlugin.getImageDescriptor(%22icons/16/stopwatch.png%22);%0D%0A%09%09%7D
 %0D%0A%09%09

use correct images for new time display types