Index: /applications/editors/josm/plugins/ElevationProfile/src/org/openstreetmap/josm/plugins/elevation/ElevationHelper.java
===================================================================
--- /applications/editors/josm/plugins/ElevationProfile/src/org/openstreetmap/josm/plugins/elevation/ElevationHelper.java	(revision 29981)
+++ /applications/editors/josm/plugins/ElevationProfile/src/org/openstreetmap/josm/plugins/elevation/ElevationHelper.java	(revision 29982)
@@ -21,4 +21,5 @@
 import java.util.Locale;
 
+import org.openstreetmap.josm.data.Bounds;
 import org.openstreetmap.josm.data.coor.LatLon;
 import org.openstreetmap.josm.data.gpx.WayPoint;
@@ -287,4 +288,20 @@
     }
 
+    /**
+     * Checks given area for SRTM data.
+     *
+     * @param bounds the bounds/area to check
+     * @return true, if SRTM data are present; otherwise false
+     */
+    public static boolean hasSrtmData(Bounds bounds) {
+	if (bounds == null) return false;
+
+	LatLon tl = bounds.getMin();
+	LatLon br = bounds.getMax();
+
+	return 	isValidElevation(getSrtmElevation(tl)) &&
+		isValidElevation(getSrtmElevation(br));
+    }
+
     /*
      * Gets the geoid height for the given way point. See also {@link
Index: /applications/editors/josm/plugins/ElevationProfile/src/org/openstreetmap/josm/plugins/elevation/gui/ElevationProfileDialog.java
===================================================================
--- /applications/editors/josm/plugins/ElevationProfile/src/org/openstreetmap/josm/plugins/elevation/gui/ElevationProfileDialog.java	(revision 29981)
+++ /applications/editors/josm/plugins/ElevationProfile/src/org/openstreetmap/josm/plugins/elevation/gui/ElevationProfileDialog.java	(revision 29982)
@@ -1,13 +1,13 @@
 /**
- * This program is free software: you can redistribute it and/or modify it under 
- * the terms of the GNU General Public License as published by the 
- * Free Software Foundation, either version 3 of the License, or 
- * (at your option) any later version. 
+ * This program is free software: you can redistribute it and/or modify it under
+ * the terms of the GNU General Public License as published by the
+ * Free Software Foundation, either version 3 of the License, or
+ * (at your option) any later version.
  * 
- * This program 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. 
- * See the GNU General Public License for more details. 
+ * This program 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.
+ * See the GNU General Public License for more details.
  * 
- * You should have received a copy of the GNU General Public License along with this program. 
+ * You should have received a copy of the GNU General Public License along with this program.
  * If not, see <http://www.gnu.org/licenses/>.
  */
@@ -54,452 +54,461 @@
 /**
  * @author Oliver Wieland <oliver.wieland@online.de>
- * Implements a JOSM ToggleDialog to show the elevation profile. It monitors the 
- * connection between layer and elevation profile. 
+ * Implements a JOSM ToggleDialog to show the elevation profile. It monitors the
+ * connection between layer and elevation profile.
  */
 public class ElevationProfileDialog extends ToggleDialog implements LayerChangeListener, ComponentListener {
 
-	private static final String EMPTY_DATA_STRING = "-";
-	/**
-	 * 
-	 */
-	private static final long serialVersionUID = -868463893732535577L;
-	/* Elevation profile instance */
-	private IElevationModel model;
-	/* GPX data */
-	private GpxLayer activeLayer = null;
-	private HashMap<GpxLayer, ElevationModel> layerMap = new HashMap<GpxLayer, ElevationModel>();
-	
-	/* UI elements */
-	private ElevationProfilePanel profPanel;
-	private JLabel minHeightLabel;
-	private JLabel maxHeightLabel;
-	private JLabel avrgHeightLabel;
-	private JLabel elevationGainLabel;
-	private JLabel totalTimeLabel;
-	private JLabel distLabel;
-	private JComboBox trackCombo;
-	private JButton zoomButton;
-	
-	/* Listener to the elevation model */
-	private List<IElevationModelListener> listeners = new ArrayList<IElevationModelListener>();
-	
-	/**
-	 * Corresponding layer instance within map view.
-	 */
-	private ElevationProfileLayer profileLayer;
-
-	/**
-	 * Default constructor
-	 */
-	public ElevationProfileDialog() {
-		this(tr("Elevation Profile"), "elevation",
-				tr("Open the elevation profile window."), null, 200, true);
-	}
-
-	/**
-	 * Constructor (see below)
-	 */
-	public ElevationProfileDialog(String name, String iconName, String tooltip,
-			Shortcut shortcut, int preferredHeight) {
-		this(name, iconName, tooltip, shortcut, preferredHeight, false);
-	}
-
-	/**
-	 * Constructor
-	 * 
-	 * @param name
-	 *            the name of the dialog
-	 * @param iconName
-	 *            the name of the icon to be displayed
-	 * @param tooltip
-	 *            the tool tip
-	 * @param shortcut
-	 *            the shortcut
-	 * @param preferredHeight
-	 *            the preferred height for the dialog
-	 * @param defShow
-	 *            if the dialog should be shown by default, if there is no
-	 *            preference
-	 */
-	public ElevationProfileDialog(String name, String iconName, String tooltip,
-			Shortcut shortcut, int preferredHeight, boolean defShow) {
-		super(name, iconName, tooltip, shortcut, preferredHeight, defShow);
-		
-		// create model
-		model = new ElevationModel();
-				
-		// top panel
-		JPanel rootPanel = new JPanel();
-		GridLayout gridLayout1 = new GridLayout(2, 1);
-		rootPanel.setLayout(gridLayout1);
-		
-		// statistics panel 
-		JPanel statPanel = new JPanel();
-		GridLayout gridLayoutStat = new GridLayout(2, 6);
-		statPanel.setLayout(gridLayoutStat);
-
-		// first row: Headlines with bold font
-		String[] labels = new String[]{tr("Min"), tr("Avrg"), tr("Max"), tr("Dist"), tr("Gain"), tr("Time")};
-		for (int i = 0; i < labels.length; i++) {
-		    	JLabel lbl = new JLabel(labels[i]);
-		    	lbl.setFont(getFont().deriveFont(Font.BOLD));
-		    	statPanel.add(lbl);
+    private static final String EMPTY_DATA_STRING = "-";
+    /**
+     * 
+     */
+    private static final long serialVersionUID = -868463893732535577L;
+    /* Elevation profile instance */
+    private IElevationModel model;
+    /* GPX data */
+    private GpxLayer activeLayer = null;
+    private final HashMap<GpxLayer, ElevationModel> layerMap = new HashMap<GpxLayer, ElevationModel>();
+
+    /* UI elements */
+    private final ElevationProfilePanel profPanel;
+    private final JLabel minHeightLabel;
+    private final JLabel maxHeightLabel;
+    private final JLabel avrgHeightLabel;
+    private final JLabel elevationGainLabel;
+    private final JLabel totalTimeLabel;
+    private final JLabel distLabel;
+    private final JComboBox trackCombo;
+    private final JButton zoomButton;
+
+    /* Listener to the elevation model */
+    private final List<IElevationModelListener> listeners = new ArrayList<IElevationModelListener>();
+
+    /**
+     * Corresponding layer instance within map view.
+     */
+    private ElevationProfileLayer profileLayer;
+
+    /**
+     * Default constructor
+     */
+    public ElevationProfileDialog() {
+	this(tr("Elevation Profile"), "elevation",
+		tr("Open the elevation profile window."), null, 200, true);
+    }
+
+    /**
+     * Constructor (see below)
+     */
+    public ElevationProfileDialog(String name, String iconName, String tooltip,
+	    Shortcut shortcut, int preferredHeight) {
+	this(name, iconName, tooltip, shortcut, preferredHeight, false);
+    }
+
+    /**
+     * Constructor
+     * 
+     * @param name
+     *            the name of the dialog
+     * @param iconName
+     *            the name of the icon to be displayed
+     * @param tooltip
+     *            the tool tip
+     * @param shortcut
+     *            the shortcut
+     * @param preferredHeight
+     *            the preferred height for the dialog
+     * @param defShow
+     *            if the dialog should be shown by default, if there is no
+     *            preference
+     */
+    public ElevationProfileDialog(String name, String iconName, String tooltip,
+	    Shortcut shortcut, int preferredHeight, boolean defShow) {
+	super(name, iconName, tooltip, shortcut, preferredHeight, defShow);
+
+	// create model
+	model = new ElevationModel();
+
+	// top panel
+	JPanel rootPanel = new JPanel();
+	GridLayout gridLayout1 = new GridLayout(2, 1);
+	rootPanel.setLayout(gridLayout1);
+
+	// statistics panel
+	JPanel statPanel = new JPanel();
+	GridLayout gridLayoutStat = new GridLayout(2, 6);
+	statPanel.setLayout(gridLayoutStat);
+
+	// first row: Headlines with bold font
+	String[] labels = new String[]{tr("Min"), tr("Avrg"), tr("Max"), tr("Dist"), tr("Gain"), tr("Time")};
+	for (int i = 0; i < labels.length; i++) {
+	    JLabel lbl = new JLabel(labels[i]);
+	    lbl.setFont(getFont().deriveFont(Font.BOLD));
+	    statPanel.add(lbl);
+	}
+
+	// second row
+	minHeightLabel = new JLabel("0 m");
+	statPanel.add(minHeightLabel);
+	avrgHeightLabel = new JLabel("0 m");
+	statPanel.add(avrgHeightLabel);
+	maxHeightLabel = new JLabel("0 m");
+	statPanel.add(maxHeightLabel);
+	distLabel = new JLabel("0 km");
+	statPanel.add(distLabel);
+	elevationGainLabel = new JLabel("0 m");
+	statPanel.add(elevationGainLabel);
+	totalTimeLabel = new JLabel("0");
+	statPanel.add(totalTimeLabel);
+
+	// track selection panel
+	JPanel trackPanel = new JPanel();
+	FlowLayout fl = new FlowLayout(FlowLayout.LEFT);
+	trackPanel.setLayout(fl);
+
+	JLabel lbTrack = new JLabel(tr("Tracks"));
+	lbTrack.setFont(getFont().deriveFont(Font.BOLD));
+	trackPanel.add(lbTrack);
+
+	zoomButton = new JButton(tr("Zoom"));
+	zoomButton.addActionListener(new ActionListener() {
+	    @Override
+	    public void actionPerformed(ActionEvent arg0) {
+		if (model != null) {
+		    IElevationProfile profile = model.getCurrentProfile();
+		    if (profile != null) {
+			Main.map.mapView.zoomTo(profile.getBounds());
+		    }
 		}
-		
-		// second row
-		minHeightLabel = new JLabel("0 m");
-		statPanel.add(minHeightLabel);
-		avrgHeightLabel = new JLabel("0 m");
-		statPanel.add(avrgHeightLabel);
-		maxHeightLabel = new JLabel("0 m");
-		statPanel.add(maxHeightLabel);
-		distLabel = new JLabel("0 km");
-		statPanel.add(distLabel);
-		elevationGainLabel = new JLabel("0 m");
-		statPanel.add(elevationGainLabel);
-		totalTimeLabel = new JLabel("0");
-		statPanel.add(totalTimeLabel);
-		
-		// track selection panel
-		JPanel trackPanel = new JPanel();
-		FlowLayout fl = new FlowLayout(FlowLayout.LEFT);
-		trackPanel.setLayout(fl);
-				
-		JLabel lbTrack = new JLabel(tr("Tracks"));		
-		lbTrack.setFont(getFont().deriveFont(Font.BOLD));
-		trackPanel.add(lbTrack);
-		
-		zoomButton = new JButton(tr("Zoom"));
-		zoomButton.addActionListener(new ActionListener() {		    
-		    @Override
-		    public void actionPerformed(ActionEvent arg0) {
-			if (model != null) {
-				IElevationProfile profile = model.getCurrentProfile();
-				if (profile != null) {
-				    Main.map.mapView.zoomTo(profile.getBounds());
-				}
-		    	}
-
-		    }
-		});
-		zoomButton.setEnabled(false);
-		
-		trackCombo = new JComboBox(new TrackModel());		
-		trackCombo.setPreferredSize(new Dimension(200, 24)); // HACK!
-		trackCombo.setEnabled(false); // we have no model on startup
-		
-		trackPanel.add(trackCombo);
-		trackPanel.add(zoomButton);
-
-		// assemble root panel
-		rootPanel.add(statPanel);
-		rootPanel.add(trackPanel);
-		
-		add(rootPanel, BorderLayout.PAGE_END);
-		
-		// add chart component
-		profPanel = new ElevationProfilePanel(null);
-		add(profPanel, BorderLayout.CENTER);
-		profPanel.addComponentListener(this);
-		
-		dock();
-	}
-	
+
+	    }
+	});
+	zoomButton.setEnabled(false);
+
+	trackCombo = new JComboBox(new TrackModel());
+	trackCombo.setPreferredSize(new Dimension(200, 24)); // HACK!
+	trackCombo.setEnabled(false); // we have no model on startup
+
+	trackPanel.add(trackCombo);
+	trackPanel.add(zoomButton);
+
+	// assemble root panel
+	rootPanel.add(statPanel);
+	rootPanel.add(trackPanel);
+
+	add(rootPanel, BorderLayout.PAGE_END);
+
+	// add chart component
+	profPanel = new ElevationProfilePanel(null);
+	add(profPanel, BorderLayout.CENTER);
+	profPanel.addComponentListener(this);
+
+	dock();
+    }
+
+    @Override
+    public void showNotify() {
+	MapView.addLayerChangeListener(this);
+	if (Main.isDisplayingMapView()) {
+	    Layer layer = Main.map.mapView.getActiveLayer();
+	    if (layer instanceof GpxLayer) {
+		setActiveLayer((GpxLayer) layer);
+	    }
+	}
+    }
+
+    @Override
+    public void hideNotify() {
+	MapView.removeLayerChangeListener(this);
+    }
+
+    /**
+     * Gets the elevation model instance.
+     * @return
+     */
+    public IElevationModel getModel() {
+	return model;
+    }
+
+    /**
+     * Sets the elevation model instance.
+     * @param model The new model.
+     */
+    public void setModel(IElevationModel model) {
+	if (this.model != model) {
+	    this.model = model;
+	    profPanel.setElevationModel(model);
+	    updateView();
+	}
+    }
+
+    /**
+     * Gets the associated layer instance of the elevation profile.
+     * @return
+     */
+    public ElevationProfileLayer getProfileLayer() {
+	return profileLayer;
+    }
+
+    /**
+     * Sets the associated layer instance of the elevation profile.
+     * @param profileLayer The elevation profile layer.
+     */
+    public void setProfileLayer(ElevationProfileLayer profileLayer) {
+	if (this.profileLayer != profileLayer) {
+	    if (this.profileLayer != null) {
+		profPanel.removeSelectionListener(this.profileLayer);
+	    }
+	    this.profileLayer = profileLayer;
+	    profPanel.addSelectionListener(this.profileLayer);
+	}
+    }
+
+    /**
+     * Refreshes the dialog when model data have changed and notifies clients
+     * that the model has changed.
+     */
+    @SuppressWarnings("unchecked") // TODO: Can be removed in Java 1.7
+    private void updateView() {
+	if (model == null) {
+	    disableView();
+	    return;
+	}
+
+	IElevationProfile profile = model.getCurrentProfile();
+	if (profile != null) {
+	    // Show name of profile in title
+	    setTitle(String.format("%s: %s", tr("Elevation Profile"), profile.getName()));
+
+	    if (profile.hasElevationData()) {
+		// Show elevation data
+		minHeightLabel.setText(
+			ElevationHelper.getElevationText(profile.getMinHeight()));
+		maxHeightLabel.setText(
+			ElevationHelper.getElevationText(profile.getMaxHeight()));
+		avrgHeightLabel.setText(
+			ElevationHelper.getElevationText(profile.getAverageHeight()));
+		elevationGainLabel.setText(
+			ElevationHelper.getElevationText(profile.getGain()));
+	    }
+
+	    // compute values for time and distance
+	    long diff = profile.getTimeDifference();
+	    long minutes = diff / (1000 * 60);
+	    long hours = minutes / 60;
+	    minutes = minutes % 60;
+
+	    double dist = profile.getDistance();
+
+	    totalTimeLabel.setText(String.format("%d:%02d h", hours, minutes));
+	    distLabel.setText(NavigatableComponent.getSystemOfMeasurement().getDistText(dist));
+	    trackCombo.setEnabled(model.profileCount() > 1);
+	    trackCombo.setModel(new TrackModel());
+	    zoomButton.setEnabled(true);
+	} else { // no elevation data, -> switch back to empty view
+	    disableView();
+	}
+
+	fireModelChanged();
+	repaint();
+    }
+
+    private void disableView() {
+	setTitle(String.format("%s: (No data)", tr("Elevation Profile")));
+
+	minHeightLabel.setText(EMPTY_DATA_STRING);
+	maxHeightLabel.setText(EMPTY_DATA_STRING);
+	avrgHeightLabel.setText(EMPTY_DATA_STRING);
+	elevationGainLabel.setText(EMPTY_DATA_STRING);
+	totalTimeLabel.setText(EMPTY_DATA_STRING);
+	distLabel.setText(EMPTY_DATA_STRING);
+	trackCombo.setEnabled(false);
+	zoomButton.setEnabled(false);
+    }
+
+    /**
+     * Fires the 'model changed' event to all listeners.
+     */
+    protected void fireModelChanged() {
+	for (IElevationModelListener listener : listeners) {
+	    listener.elevationProfileChanged(getModel().getCurrentProfile());
+	}
+    }
+
+    /**
+     * Adds a model listener to this instance.
+     * 
+     * @param listener
+     *            The listener to add.
+     */
+    public void addModelListener(IElevationModelListener listener) {
+	this.listeners.add(listener);
+    }
+
+    /**
+     * Removes a model listener from this instance.
+     * 
+     * @param listener
+     *            The listener to remove.
+     */
+    public void removeModelListener(IElevationModelListener listener) {
+	this.listeners.remove(listener);
+    }
+
+    /**
+     * Removes all listeners from this instance.
+     */
+    public void removeAllListeners() {
+	this.listeners.clear();
+    }
+
+    /* (non-Javadoc)
+     * @see org.openstreetmap.josm.gui.MapView.LayerChangeListener#activeLayerChange(org.openstreetmap.josm.gui.layer.Layer, org.openstreetmap.josm.gui.layer.Layer)
+     */
+    @Override
+    public void activeLayerChange(Layer oldLayer, Layer newLayer) {
+	if (newLayer instanceof GpxLayer) {
+	    setActiveLayer((GpxLayer) newLayer);
+	}
+    }
+
+    private void setActiveLayer(GpxLayer newLayer) {
+	if (activeLayer != newLayer) {
+	    activeLayer = newLayer;
+
+	    // layer does not exist -> create
+	    if (!layerMap.containsKey(newLayer)) {
+		GpxData gpxData = newLayer.data;
+		ElevationModel newEM = new ElevationModel(newLayer.getName(),
+			gpxData);
+		layerMap.put(newLayer, newEM);
+	    }
+
+	    ElevationModel em = layerMap.get(newLayer);
+	    setModel(em);
+	}
+    }
+
+    /* (non-Javadoc)
+     * @see org.openstreetmap.josm.gui.MapView.LayerChangeListener#layerAdded(org.openstreetmap.josm.gui.layer.Layer)
+     */
+    @Override
+    public void layerAdded(Layer newLayer) {
+	if (newLayer instanceof GpxLayer) {
+	    GpxLayer gpxLayer = (GpxLayer) newLayer;
+	    setActiveLayer(gpxLayer);
+	}
+    }
+
+    /* (non-Javadoc)
+     * @see org.openstreetmap.josm.gui.MapView.LayerChangeListener#layerRemoved(org.openstreetmap.josm.gui.layer.Layer)
+     */
+    @Override
+    public void layerRemoved(Layer oldLayer) {
+	if (layerMap.containsKey(oldLayer)) {
+	    layerMap.remove(oldLayer);
+	}
+
+	if (layerMap.size() == 0) {
+	    setModel(null);
+	    if (profileLayer != null) {
+		profileLayer.setProfile(null);
+	    }
+	}
+    }
+
+    /*
+     * (non-Javadoc)
+     * 
+     * @seejava.awt.event.ComponentListener#componentHidden(java.awt.event.
+     * ComponentEvent)
+     */
+    @Override
+    public void componentHidden(ComponentEvent e) {
+    }
+
+    /*
+     * (non-Javadoc)
+     * 
+     * @see
+     * java.awt.event.ComponentListener#componentMoved(java.awt.event.ComponentEvent
+     * )
+     */
+    @Override
+    public void componentMoved(ComponentEvent e) {
+    }
+
+    /*
+     * (non-Javadoc)
+     * 
+     * @seejava.awt.event.ComponentListener#componentResized(java.awt.event.
+     * ComponentEvent)
+     */
+    @Override
+    public void componentResized(ComponentEvent e) {
+    }
+
+    /*
+     * (non-Javadoc)
+     * 
+     * @see
+     * java.awt.event.ComponentListener#componentShown(java.awt.event.ComponentEvent
+     * )
+     */
+    @Override
+    public void componentShown(ComponentEvent e) {
+    }
+
+
+    @SuppressWarnings("rawtypes") // TODO: Can be removed in Java 1.7
+    class TrackModel implements ComboBoxModel {
+	private Collection<ListDataListener> listeners;
+
 	@Override
-	public void showNotify() {
-		MapView.addLayerChangeListener(this);
-		if (Main.isDisplayingMapView()) {
-			Layer layer = Main.map.mapView.getActiveLayer();
-			if (layer instanceof GpxLayer) {
-				setActiveLayer((GpxLayer) layer);
-			}
-		}
-	}
-	
+	public void addListDataListener(ListDataListener arg0) {
+	    if (listeners == null) {
+		listeners = new ArrayList<ListDataListener>();
+	    }
+	    listeners.add(arg0);
+	}
+
 	@Override
-	public void hideNotify() {
-		MapView.removeLayerChangeListener(this);
-	}
-
-	/**
-	 * Gets the elevation model instance.
-	 * @return
-	 */
-	public IElevationModel getModel() {
-		return model;
-	}
-
-	/**
-	 * Sets the elevation model instance.
-	 * @param model The new model.
-	 */
-	public void setModel(IElevationModel model) {
-		if (this.model != model) {
-		    	this.model = model;
-			profPanel.setElevationModel(model);
-			updateView();
-		}
-	}
-
-	/**
-	 * Gets the associated layer instance of the elevation profile.
-	 * @return
-	 */
-	public ElevationProfileLayer getProfileLayer() {
-		return profileLayer;
-	}
-
-	/**
-	 * Sets the associated layer instance of the elevation profile.
-	 * @param profileLayer The elevation profile layer.
-	 */
-	public void setProfileLayer(ElevationProfileLayer profileLayer) {
-		if (this.profileLayer != profileLayer) {
-			if (this.profileLayer != null) {
-				profPanel.removeSelectionListener(this.profileLayer);
-			}
-			this.profileLayer = profileLayer;
-			profPanel.addSelectionListener(this.profileLayer);
-		}
-	}
-
-	/**
-	 * Refreshes the dialog when model data have changed and notifies clients
-	 * that the model has changed.
-	 */
-	private void updateView() {
-	    	if (model == null) {
-	    	    disableView();
-	    	    return;
-	    	}
-
-		IElevationProfile profile = model.getCurrentProfile();
-		if (profile != null) {
-		    // Show name of profile in title 
-		    setTitle(String.format("%s: %s", tr("Elevation Profile"), profile.getName()));
-
-		    if (profile.hasElevationData()) {
-			// Show elevation data
-			minHeightLabel.setText(
-				ElevationHelper.getElevationText(profile.getMinHeight()));
-			maxHeightLabel.setText(
-				ElevationHelper.getElevationText(profile.getMaxHeight()));
-			avrgHeightLabel.setText(
-				ElevationHelper.getElevationText(profile.getAverageHeight()));
-			elevationGainLabel.setText(
-				ElevationHelper.getElevationText(profile.getGain()));
-		    }
-
-		    // compute values for time and distance
-		    long diff = profile.getTimeDifference();
-		    long minutes = diff / (1000 * 60);
-		    long hours = minutes / 60;
-		    minutes = minutes % 60;
-
-		    double dist = profile.getDistance();
-
-		    totalTimeLabel.setText(String.format("%d:%d h", hours, minutes));
-		    distLabel.setText(NavigatableComponent.getSystemOfMeasurement().getDistText(dist));
-		    trackCombo.setEnabled(model.profileCount() > 1);
-		    trackCombo.setModel(new TrackModel());
-		    zoomButton.setEnabled(true);
-		} else { // no elevation data, -> switch back to empty view
-		    disableView();
-		}
-		
-		fireModelChanged();
-		repaint();	    
-	}
-
-	private void disableView() {
-	    setTitle(String.format("%s: (No data)", tr("Elevation Profile")));
-
-	    minHeightLabel.setText(EMPTY_DATA_STRING);
-	    maxHeightLabel.setText(EMPTY_DATA_STRING);
-	    avrgHeightLabel.setText(EMPTY_DATA_STRING);
-	    elevationGainLabel.setText(EMPTY_DATA_STRING);
-	    totalTimeLabel.setText(EMPTY_DATA_STRING);
-	    distLabel.setText(EMPTY_DATA_STRING);
-	    trackCombo.setEnabled(false);
-	    zoomButton.setEnabled(false);
-	}
-
-	/**
-	 * Fires the 'model changed' event to all listeners.
-	 */
-	protected void fireModelChanged() {
-		for (IElevationModelListener listener : listeners) {
-			listener.elevationProfileChanged(getModel().getCurrentProfile());
-		}
-	}
-
-	/**
-	 * Adds a model listener to this instance.
-	 * 
-	 * @param listener
-	 *            The listener to add.
-	 */
-	public void addModelListener(IElevationModelListener listener) {
-		this.listeners.add(listener);
-	}
-
-	/**
-	 * Removes a model listener from this instance.
-	 * 
-	 * @param listener
-	 *            The listener to remove.
-	 */
-	public void removeModelListener(IElevationModelListener listener) {
-		this.listeners.remove(listener);
-	}
-
-	/**
-	 * Removes all listeners from this instance.
-	 */
-	public void removeAllListeners() {
-		this.listeners.clear();
-	}
-
-	/* (non-Javadoc)
-	 * @see org.openstreetmap.josm.gui.MapView.LayerChangeListener#activeLayerChange(org.openstreetmap.josm.gui.layer.Layer, org.openstreetmap.josm.gui.layer.Layer)
-	 */
-	public void activeLayerChange(Layer oldLayer, Layer newLayer) {
-		if (newLayer instanceof GpxLayer) {
-			setActiveLayer((GpxLayer) newLayer);
-		}
-	}
-
-	private void setActiveLayer(GpxLayer newLayer) {
-		if (activeLayer != newLayer) {
-			activeLayer = newLayer;
-
-			// layer does not exist -> create
-			if (!layerMap.containsKey(newLayer)) {
-				GpxData gpxData = newLayer.data;
-				ElevationModel newEM = new ElevationModel(newLayer.getName(),
-						gpxData);
-				layerMap.put(newLayer, newEM);
-			}
-			
-			ElevationModel em = layerMap.get(newLayer);
-			setModel(em);			
-		}
-	}
-
-	/* (non-Javadoc)
-	 * @see org.openstreetmap.josm.gui.MapView.LayerChangeListener#layerAdded(org.openstreetmap.josm.gui.layer.Layer)
-	 */
-	public void layerAdded(Layer newLayer) {
-		if (newLayer instanceof GpxLayer) {
-			GpxLayer gpxLayer = (GpxLayer) newLayer;
-			setActiveLayer(gpxLayer);
-		}
-	}
-
-	/* (non-Javadoc)
-	 * @see org.openstreetmap.josm.gui.MapView.LayerChangeListener#layerRemoved(org.openstreetmap.josm.gui.layer.Layer)
-	 */
-	public void layerRemoved(Layer oldLayer) {
-		if (layerMap.containsKey(oldLayer)) {
-			layerMap.remove(oldLayer);
-		}
-		
-		if (layerMap.size() == 0) {
-			setModel(null);
-			if (profileLayer != null) {
-				profileLayer.setProfile(null);
-			}
-		}
-	}
-
-	/*
-	 * (non-Javadoc)
-	 * 
-	 * @seejava.awt.event.ComponentListener#componentHidden(java.awt.event.
-	 * ComponentEvent)
-	 */
-	public void componentHidden(ComponentEvent e) {
-	}
-
-	/*
-	 * (non-Javadoc)
-	 * 
-	 * @see
-	 * java.awt.event.ComponentListener#componentMoved(java.awt.event.ComponentEvent
-	 * )
-	 */
-	public void componentMoved(ComponentEvent e) {
-	}
-
-	/*
-	 * (non-Javadoc)
-	 * 
-	 * @seejava.awt.event.ComponentListener#componentResized(java.awt.event.
-	 * ComponentEvent)
-	 */
-	public void componentResized(ComponentEvent e) {
-	}
-
-	/*
-	 * (non-Javadoc)
-	 * 
-	 * @see
-	 * java.awt.event.ComponentListener#componentShown(java.awt.event.ComponentEvent
-	 * )
-	 */
-	public void componentShown(ComponentEvent e) {
-	}
-	
-	
-	class TrackModel implements ComboBoxModel {
-	    private Collection<ListDataListener> listeners;
-
-	    @Override
-	    public void addListDataListener(ListDataListener arg0) {
-		if (listeners == null) {
-		    listeners = new ArrayList<ListDataListener>();
-		}
-		listeners.add(arg0);
-	    }
-
-	    @Override
-	    public IElevationProfile getElementAt(int index) {
-		if (model == null) return null;
-		
-		IElevationProfile ep = model.getProfiles().get(index);
-		return ep;
-	    }
-
-	    @Override
-	    public int getSize() {
-		if (model == null) return 0;
-		
-		return model.profileCount();
-	    }
-
-	    @Override
-	    public void removeListDataListener(ListDataListener listener) {
-		if (listeners == null) return;	
-		
-		listeners.remove(listener);
-	    }
-
-	    @Override
-	    public Object getSelectedItem() {
-		if (model == null) return null;
-		
-		return model.getCurrentProfile();
-	    }
-
-	    @Override
-	    public void setSelectedItem(Object selectedObject) {
-		if (model != null && selectedObject instanceof IElevationProfile) {
-		    model.setCurrentProfile((IElevationProfile) selectedObject);
-		    profileLayer.setProfile(model.getCurrentProfile());
-		    
-		    repaint();		    
-		}
-	    }
-	    
-	}
+	public IElevationProfile getElementAt(int index) {
+	    if (model == null) return null;
+
+	    IElevationProfile ep = model.getProfiles().get(index);
+	    return ep;
+	}
+
+	@Override
+	public int getSize() {
+	    if (model == null) return 0;
+
+	    return model.profileCount();
+	}
+
+	@Override
+	public void removeListDataListener(ListDataListener listener) {
+	    if (listeners == null) return;
+
+	    listeners.remove(listener);
+	}
+
+	@Override
+	public Object getSelectedItem() {
+	    if (model == null) return null;
+
+	    return model.getCurrentProfile();
+	}
+
+	@Override
+	public void setSelectedItem(Object selectedObject) {
+	    if (model != null && selectedObject instanceof IElevationProfile) {
+		model.setCurrentProfile((IElevationProfile) selectedObject);
+		profileLayer.setProfile(model.getCurrentProfile());
+
+		repaint();
+	    }
+	}
+
+    }
 }
Index: /applications/editors/josm/plugins/ElevationProfile/src/org/openstreetmap/josm/plugins/elevation/gui/ElevationProfilePanel.java
===================================================================
--- /applications/editors/josm/plugins/ElevationProfile/src/org/openstreetmap/josm/plugins/elevation/gui/ElevationProfilePanel.java	(revision 29981)
+++ /applications/editors/josm/plugins/ElevationProfile/src/org/openstreetmap/josm/plugins/elevation/gui/ElevationProfilePanel.java	(revision 29982)
@@ -52,4 +52,6 @@
      */
     private static final long serialVersionUID = -7343429725259575319L;
+    private static final int BOTTOM_TEXT_Y_OFFSET = 7;
+
     private IElevationModel model;
     private Rectangle plotArea;
@@ -204,10 +206,15 @@
 		IElevationProfile profile = model.getCurrentProfile();
 		if (profile != null && profile.hasElevationData()) {
-		    drawAlignedString(formatDate(profile.getStart()), 5, y1 + 5,
+		    // Draw start and end date
+		    drawAlignedString(formatDate(profile.getStart()), 5, y1 + BOTTOM_TEXT_Y_OFFSET,
 			    TextAlignment.Left, g);
 		    drawAlignedString(formatDate(profile.getEnd()),
-			    getPlotRight(), y1 + 5, TextAlignment.Right, g);
-
-
+			    getPlotRight(), y1 + BOTTOM_TEXT_Y_OFFSET, TextAlignment.Right, g);
+
+		    // Show SRTM indicator
+		    if (ElevationHelper.hasSrtmData(profile.getBounds())) {
+			String txt = "SRTM";
+			drawAlignedString(txt, getPlotHCenter(), y1 + BOTTOM_TEXT_Y_OFFSET, TextAlignment.Centered, g);
+		    }
 		    drawProfile(g);
 		    drawElevationLines(g);
@@ -425,4 +432,5 @@
 		    ElevationWayPointKind.Plain);
 
+	    // draw cursor
 	    if (i == this.selectedIndex) {
 		g.setColor(Color.BLACK);
@@ -435,4 +443,5 @@
 		c = renderer.getColorForWaypoint(profile, wpt, ElevationWayPointKind.Highlighted);
 	    }
+
 	    int yEle = getYForEelevation(eleVal);
 	    int x = getPlotLeft() + i;
@@ -442,4 +451,5 @@
 	    g.setColor(ElevationColors.EPLightBlue);
 	}
+
 	g.setColor(oldC);
     }
