Index: /applications/editors/josm/plugins/ElevationProfile/.classpath
===================================================================
--- /applications/editors/josm/plugins/ElevationProfile/.classpath	(revision 23721)
+++ /applications/editors/josm/plugins/ElevationProfile/.classpath	(revision 23721)
@@ -0,0 +1,9 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<classpath>
+	<classpathentry kind="src" path="src"/>
+	<classpathentry kind="src" path="test"/>
+	<classpathentry kind="con" path="org.eclipse.jdt.launching.JRE_CONTAINER/org.eclipse.jdt.internal.debug.ui.launcher.StandardVMType/J2SE-1.5"/>
+	<classpathentry kind="lib" path="lib/josm-tested.jar" sourcepath="J:/Dokumente und Einstellungen/Oliver/Eigene Dateien/Java/applications/editors/josm/core/src"/>
+	<classpathentry kind="con" path="org.eclipse.jdt.junit.JUNIT_CONTAINER/3"/>
+	<classpathentry kind="output" path="bin"/>
+</classpath>
Index: /applications/editors/josm/plugins/ElevationProfile/.externalToolBuilders/ElevationProfile.launch
===================================================================
--- /applications/editors/josm/plugins/ElevationProfile/.externalToolBuilders/ElevationProfile.launch	(revision 23721)
+++ /applications/editors/josm/plugins/ElevationProfile/.externalToolBuilders/ElevationProfile.launch	(revision 23721)
@@ -0,0 +1,21 @@
+<?xml version="1.0" encoding="UTF-8" standalone="no"?>
+<launchConfiguration type="org.eclipse.ant.AntBuilderLaunchConfigurationType">
+<booleanAttribute key="org.eclipse.ant.ui.ATTR_TARGETS_UPDATED" value="true"/>
+<booleanAttribute key="org.eclipse.ant.ui.DEFAULT_VM_INSTALL" value="false"/>
+<booleanAttribute key="org.eclipse.ant.uiSET_INPUTHANDLER" value="false"/>
+<listAttribute key="org.eclipse.debug.core.MAPPED_RESOURCE_PATHS">
+<listEntry value="/ElevationProfile/build.xml"/>
+</listAttribute>
+<listAttribute key="org.eclipse.debug.core.MAPPED_RESOURCE_TYPES">
+<listEntry value="1"/>
+</listAttribute>
+<booleanAttribute key="org.eclipse.debug.ui.ATTR_LAUNCH_IN_BACKGROUND" value="false"/>
+<stringAttribute key="org.eclipse.jdt.launching.CLASSPATH_PROVIDER" value="org.eclipse.ant.ui.AntClasspathProvider"/>
+<booleanAttribute key="org.eclipse.jdt.launching.DEFAULT_CLASSPATH" value="true"/>
+<stringAttribute key="org.eclipse.jdt.launching.PROJECT_ATTR" value="ElevationProfile"/>
+<stringAttribute key="org.eclipse.ui.externaltools.ATTR_LOCATION" value="${workspace_loc:/ElevationProfile/build.xml}"/>
+<stringAttribute key="org.eclipse.ui.externaltools.ATTR_RUN_BUILD_KINDS" value="full,incremental,"/>
+<stringAttribute key="org.eclipse.ui.externaltools.ATTR_TOOL_ARGUMENTS" value="install"/>
+<booleanAttribute key="org.eclipse.ui.externaltools.ATTR_TRIGGERS_CONFIGURED" value="true"/>
+<stringAttribute key="org.eclipse.ui.externaltools.ATTR_WORKING_DIRECTORY" value="${workspace_loc:/ElevationProfile}"/>
+</launchConfiguration>
Index: /applications/editors/josm/plugins/ElevationProfile/.externalToolBuilders/ElevationProfileAnt.launch
===================================================================
--- /applications/editors/josm/plugins/ElevationProfile/.externalToolBuilders/ElevationProfileAnt.launch	(revision 23721)
+++ /applications/editors/josm/plugins/ElevationProfile/.externalToolBuilders/ElevationProfileAnt.launch	(revision 23721)
@@ -0,0 +1,20 @@
+<?xml version="1.0" encoding="UTF-8" standalone="no"?>
+<launchConfiguration type="org.eclipse.ant.AntBuilderLaunchConfigurationType">
+<booleanAttribute key="org.eclipse.ant.ui.ATTR_TARGETS_UPDATED" value="true"/>
+<booleanAttribute key="org.eclipse.ant.ui.DEFAULT_VM_INSTALL" value="false"/>
+<listAttribute key="org.eclipse.debug.core.MAPPED_RESOURCE_PATHS">
+<listEntry value="/ElevationProfile/build.xml"/>
+</listAttribute>
+<listAttribute key="org.eclipse.debug.core.MAPPED_RESOURCE_TYPES">
+<listEntry value="1"/>
+</listAttribute>
+<booleanAttribute key="org.eclipse.debug.ui.ATTR_LAUNCH_IN_BACKGROUND" value="false"/>
+<stringAttribute key="org.eclipse.jdt.launching.CLASSPATH_PROVIDER" value="org.eclipse.ant.ui.AntClasspathProvider"/>
+<booleanAttribute key="org.eclipse.jdt.launching.DEFAULT_CLASSPATH" value="true"/>
+<stringAttribute key="org.eclipse.jdt.launching.PROJECT_ATTR" value="ElevationProfile"/>
+<stringAttribute key="org.eclipse.ui.externaltools.ATTR_LOCATION" value="${workspace_loc:/ElevationProfile/build.xml}"/>
+<stringAttribute key="org.eclipse.ui.externaltools.ATTR_RUN_BUILD_KINDS" value="full,incremental,"/>
+<stringAttribute key="org.eclipse.ui.externaltools.ATTR_TOOL_ARGUMENTS" value="install"/>
+<booleanAttribute key="org.eclipse.ui.externaltools.ATTR_TRIGGERS_CONFIGURED" value="true"/>
+<stringAttribute key="org.eclipse.ui.externaltools.ATTR_WORKING_DIRECTORY" value="${workspace_loc:/ElevationProfile}"/>
+</launchConfiguration>
Index: /applications/editors/josm/plugins/ElevationProfile/.project
===================================================================
--- /applications/editors/josm/plugins/ElevationProfile/.project	(revision 23721)
+++ /applications/editors/josm/plugins/ElevationProfile/.project	(revision 23721)
@@ -0,0 +1,27 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<projectDescription>
+	<name>ElevationProfile</name>
+	<comment></comment>
+	<projects>
+	</projects>
+	<buildSpec>
+		<buildCommand>
+			<name>org.eclipse.jdt.core.javabuilder</name>
+			<arguments>
+			</arguments>
+		</buildCommand>
+		<buildCommand>
+			<name>org.eclipse.ui.externaltools.ExternalToolBuilder</name>
+			<triggers>full,incremental,</triggers>
+			<arguments>
+				<dictionary>
+					<key>LaunchConfigHandle</key>
+					<value>&lt;project&gt;/.externalToolBuilders/ElevationProfile.launch</value>
+				</dictionary>
+			</arguments>
+		</buildCommand>
+	</buildSpec>
+	<natures>
+		<nature>org.eclipse.jdt.core.javanature</nature>
+	</natures>
+</projectDescription>
Index: /applications/editors/josm/plugins/ElevationProfile/src/org/openstreetmap/josm/plugins/elevation/ElevationProfileBase.java
===================================================================
--- /applications/editors/josm/plugins/ElevationProfile/src/org/openstreetmap/josm/plugins/elevation/ElevationProfileBase.java	(revision 23720)
+++ /applications/editors/josm/plugins/ElevationProfile/src/org/openstreetmap/josm/plugins/elevation/ElevationProfileBase.java	(revision 23721)
@@ -443,5 +443,5 @@
 	 */
 	public boolean hasElevationData() {
-		return minHeight == maxHeight;
+		return minHeight != maxHeight;
 	}
 
Index: /applications/editors/josm/plugins/ElevationProfile/src/org/openstreetmap/josm/plugins/elevation/ElevationProfilePlugin.java
===================================================================
--- /applications/editors/josm/plugins/ElevationProfile/src/org/openstreetmap/josm/plugins/elevation/ElevationProfilePlugin.java	(revision 23720)
+++ /applications/editors/josm/plugins/ElevationProfile/src/org/openstreetmap/josm/plugins/elevation/ElevationProfilePlugin.java	(revision 23721)
@@ -65,5 +65,5 @@
 		if (newFrame != null) {
 			newFrame.addToggleDialog(eleProfileDlg);
-			eleProfileDlg.addModelListener(eleMode);
+			eleProfileDlg.addModelListener(eleMode);			
 		}
 		
@@ -73,4 +73,5 @@
 			Main.map.mapView.addPropertyChangeListener(eleProfileDlg);
 			MapView.addLayerChangeListener(eleProfileDlg);
+			eleProfileDlg.setProfileLayer(getCurrentLayer());
 		}
 	}
@@ -84,5 +85,5 @@
 		if(currentLayer == null){
 			currentLayer = new ElevationProfileLayer("Elevation profile");
-			Main.main.addLayer(currentLayer);
+			Main.main.addLayer(currentLayer);			
 		}
 		return currentLayer;
Index: /applications/editors/josm/plugins/ElevationProfile/src/org/openstreetmap/josm/plugins/elevation/ElevationWayPointKind.java
===================================================================
--- /applications/editors/josm/plugins/ElevationProfile/src/org/openstreetmap/josm/plugins/elevation/ElevationWayPointKind.java	(revision 23720)
+++ /applications/editors/josm/plugins/ElevationProfile/src/org/openstreetmap/josm/plugins/elevation/ElevationWayPointKind.java	(revision 23721)
@@ -21,4 +21,5 @@
 public enum ElevationWayPointKind {
 	Plain, 				// Simple way point
+	Highlighted,		// Highlighted waypoint
 	StartPoint,			// First way point
 	EndPoint,			// Last way point
@@ -27,4 +28,4 @@
 	ElevationGain,		// Elevation gain
 	ElevationLoss,		// Elevation loss	
-	FullHour			// Full Hour
+	FullHour			// Full Hour	
 }
Index: /applications/editors/josm/plugins/ElevationProfile/src/org/openstreetmap/josm/plugins/elevation/gui/DefaultElevationProfileRenderer.java
===================================================================
--- /applications/editors/josm/plugins/ElevationProfile/src/org/openstreetmap/josm/plugins/elevation/gui/DefaultElevationProfileRenderer.java	(revision 23720)
+++ /applications/editors/josm/plugins/ElevationProfile/src/org/openstreetmap/josm/plugins/elevation/gui/DefaultElevationProfileRenderer.java	(revision 23721)
@@ -88,4 +88,6 @@
 				return LOW_COLOR;
 			}
+		case Highlighted:
+			return Color.ORANGE;
 		case ElevationGain:
 			return Color.GREEN;
@@ -98,5 +100,5 @@
 		case MinElevation:
 			return LOW_COLOR;
-
+		
 		case StartPoint:
 			return START_COLOR;
@@ -177,5 +179,14 @@
 		if (kind == ElevationWayPointKind.FullHour) {
 			int hour = WayPointHelper.getHourOfWayPoint(wpt);			
-			drawLabel(String.format("%d:00", hour), pnt.x, pnt.y + g.getFontMetrics().getHeight(), g);
+			drawLabel(String.format("%02d:00", hour), pnt.x, pnt.y + g.getFontMetrics().getHeight(), g);
+		}
+		
+		if (kind == ElevationWayPointKind.Highlighted) {
+			int eleH = (int) WayPointHelper.getElevation(wpt);
+			int hour = WayPointHelper.getHourOfWayPoint(wpt);			
+			int min = WayPointHelper.getMinuteOfWayPoint(wpt);
+			drawSphere(g, Color.WHITE, c, pnt.x, pnt.y, r2 * 2);
+			drawLabel(String.format("%02d:%02d", hour, min), pnt.x, pnt.y - g.getFontMetrics().getHeight(), g);
+			drawLabel(String.format("%dm", eleH), pnt.x, pnt.y + g.getFontMetrics().getHeight(), g);
 		}
 	}
Index: /applications/editors/josm/plugins/ElevationProfile/src/org/openstreetmap/josm/plugins/elevation/gui/ElevationColors.java
===================================================================
--- /applications/editors/josm/plugins/ElevationProfile/src/org/openstreetmap/josm/plugins/elevation/gui/ElevationColors.java	(revision 23720)
+++ /applications/editors/josm/plugins/ElevationProfile/src/org/openstreetmap/josm/plugins/elevation/gui/ElevationColors.java	(revision 23721)
@@ -26,4 +26,6 @@
 	public static Color EPLightBlue = new Color(176, 187, 208);
 	
+	public static Color EPOrange = new Color(180, 140, 115);
+	
 	public static Color EPLightBeige = new Color(235, 235, 215);
 	public static Color EPMidBeige = new Color(227, 222, 215);
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 23720)
+++ /applications/editors/josm/plugins/ElevationProfile/src/org/openstreetmap/josm/plugins/elevation/gui/ElevationProfileDialog.java	(revision 23721)
@@ -38,4 +38,5 @@
 import javax.swing.JTextField;
 
+import org.openstreetmap.josm.Main;
 import org.openstreetmap.josm.data.gpx.GpxData;
 import org.openstreetmap.josm.gui.MapView;
@@ -81,4 +82,6 @@
 	private JRadioButton geoidFixed;
 	private JTextField geoidFixedValue;
+	
+	private ElevationProfileLayer profileLayer;
 
 	/**
@@ -118,5 +121,5 @@
 			Shortcut shortcut, int preferredHeight, boolean defShow) {
 		super(name, iconName, tooltip, shortcut, preferredHeight, defShow);
-
+				
 		JPanel dataPanel = new JPanel(new GridBagLayout());
 		GridBagConstraints c = new GridBagConstraints();
@@ -273,4 +276,18 @@
 				updateView();
 			}
+		}
+	}
+
+	public ElevationProfileLayer getProfileLayer() {
+		return profileLayer;
+	}
+
+	public void setProfileLayer(ElevationProfileLayer profileLayer) {
+		if (this.profileLayer != profileLayer) {
+			if (this.profileLayer != null) {
+				profPanel.removeSelectionListener(this.profileLayer);
+			}
+			this.profileLayer = profileLayer;
+			profPanel.addSelectionListener(this.profileLayer);
 		}
 	}
@@ -399,8 +416,10 @@
 				layerMap.put(newLayer, em);
 			}
-
+			
+			System.out.println("Active layer: " + newLayer.getName());
 			ElevationModel em = layerMap.get(newLayer);
 			em.setSliceSize(slices);
 			setModel(em);
+			
 		}
 	}
@@ -408,4 +427,5 @@
 	public void layerAdded(Layer newLayer) {
 		createLayer(newLayer);
+		System.out.println("layerAdded: " + newLayer.getName());
 	}
 
Index: /applications/editors/josm/plugins/ElevationProfile/src/org/openstreetmap/josm/plugins/elevation/gui/ElevationProfileLayer.java
===================================================================
--- /applications/editors/josm/plugins/ElevationProfile/src/org/openstreetmap/josm/plugins/elevation/gui/ElevationProfileLayer.java	(revision 23720)
+++ /applications/editors/josm/plugins/ElevationProfile/src/org/openstreetmap/josm/plugins/elevation/gui/ElevationProfileLayer.java	(revision 23721)
@@ -41,7 +41,8 @@
  */
 public class ElevationProfileLayer extends
-		org.openstreetmap.josm.gui.layer.Layer {
+org.openstreetmap.josm.gui.layer.Layer implements IElevationProfileSelectionListener {
 	private IElevationProfile profile;
 	private IElevationProfileRenderer renderer = new DefaultElevationProfileRenderer();
+	private WayPoint selWayPoint = null;
 
 	/**
@@ -154,4 +155,5 @@
 		WayPoint lastWpt = null;
 		int lastEle = 0;
+		int index = 0;
 
 		if (profile != null) {
@@ -159,11 +161,26 @@
 				int ele = (int) WayPointHelper.getElevation(wpt);
 
-				if (lastWpt != null) {
-					int h1 = WayPointHelper.getHourOfWayPoint(wpt);
-					int h2 = WayPointHelper.getHourOfWayPoint(lastWpt);
-					if (h1 != h2) { // hour changed?
+				if (selWayPoint == null) {
+					if (lastWpt != null) {					
+						int h1 = WayPointHelper.getHourOfWayPoint(wpt);
+						int h2 = WayPointHelper.getHourOfWayPoint(lastWpt);
+						if (h1 != h2) { // hour changed?
+							renderer.renderWayPoint(g, profile, mv, wpt,
+									ElevationWayPointKind.FullHour);
+						} else { // check for elevation gain
+							if (ele > lastEle) {
+								renderer.renderWayPoint(g, profile, mv, wpt,
+										ElevationWayPointKind.ElevationGain);
+							} else {
+								renderer.renderWayPoint(g, profile, mv, wpt,
+										ElevationWayPointKind.ElevationLoss);
+							}
+						}
+					}
+				} else {
+					if (selWayPoint == wpt)  {
 						renderer.renderWayPoint(g, profile, mv, wpt,
-								ElevationWayPointKind.FullHour);
-					} else { // check for elevation gain
+							ElevationWayPointKind.Highlighted);
+					} else {
 						if (ele > lastEle) {
 							renderer.renderWayPoint(g, profile, mv, wpt,
@@ -175,8 +192,9 @@
 					}
 				}
-				
+
 				// remember for next iteration
 				lastEle = (int) WayPointHelper.getElevation(wpt);
 				lastWpt = wpt;
+				index++;
 			}
 
@@ -206,3 +224,11 @@
 	}
 
+	@Override
+	public void selectedWayPointChanged(WayPoint newWayPoint) {
+		if (selWayPoint != newWayPoint) {
+			selWayPoint = newWayPoint;
+			Main.map.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 23720)
+++ /applications/editors/josm/plugins/ElevationProfile/src/org/openstreetmap/josm/plugins/elevation/gui/ElevationProfilePanel.java	(revision 23721)
@@ -5,4 +5,5 @@
 import java.awt.Color;
 import java.awt.Dimension;
+import java.awt.Event;
 import java.awt.Font;
 import java.awt.FontMetrics;
@@ -11,7 +12,12 @@
 import java.awt.event.ComponentEvent;
 import java.awt.event.ComponentListener;
+import java.awt.event.MouseEvent;
+import java.awt.event.MouseListener;
+import java.awt.event.MouseMotionListener;
 import java.text.Format;
 import java.text.SimpleDateFormat;
+import java.util.ArrayList;
 import java.util.Date;
+import java.util.List;
 
 import javax.swing.BorderFactory;
@@ -24,5 +30,10 @@
 import org.openstreetmap.josm.plugins.elevation.WayPointHelper;
 
-public class ElevationProfilePanel extends JPanel implements ComponentListener {
+/**
+ * Provides the panel showing the elevation profile.
+ * @author Oliver
+ *
+ */
+public class ElevationProfilePanel extends JPanel implements ComponentListener, MouseMotionListener {
 	/**
 	 * Serial version UID
@@ -32,5 +43,12 @@
 	private Rectangle plotArea;
 	private IElevationProfileRenderer renderer = new DefaultElevationProfileRenderer();
-
+	private int selectedIndex = -1;
+	private List<IElevationProfileSelectionListener> selectionChangedListeners = new ArrayList<IElevationProfileSelectionListener>();
+	private boolean isPainting;
+
+	/**
+	 * Constructs a new ElevationProfilePanel with the given elevation profile.
+	 * @param profile The elevation profile to show in the panel.
+	 */
 	public ElevationProfilePanel(IElevationProfile profile) {
 		super();
@@ -40,24 +58,109 @@
 		createOrUpdatePlotArea();
 		addComponentListener(this);
-	}
-
+		addMouseMotionListener(this);
+	}
+
+	/**
+	 * Gets the elevation profile instance.
+	 * @return
+	 */
 	public IElevationProfile getProfile() {
 		return profile;
 	}
 
+	/**
+	 * Sets the new elevation profile instance.
+	 * @param profile
+	 */
 	public void setElevationModel(IElevationProfile profile) {
-		this.profile = profile;
-	}
-
+		if (this.profile != profile) {
+			this.profile = profile;
+			invalidate();
+		}
+	}
+
+	/**
+	 * Gets the plot area coordinates.
+	 * @return
+	 */
 	public Rectangle getPlotArea() {
 		return plotArea;
 	}
 
+	/**
+	 * Sets the plot area coordinates.
+	 * @param plotArea
+	 */
 	public void setPlotArea(Rectangle plotArea) {
 		this.plotArea = plotArea;
 	}
-
+	
+	/**
+	 * Gets the selected index of the bar.	
+	 * @return
+	 */
+	public int getSelectedIndex() {
+		return selectedIndex;
+	}
+
+	/**
+	 * Sets the selected index of the bar.
+	 * @param selectedIndex
+	 */
+	public void setSelectedIndex(int selectedIndex) {
+		this.selectedIndex = selectedIndex;
+	}
+	
+	/**
+	 * Gets the selected (highlighted) way point.
+	 * @return The selected way point or null, if no way point is selected.
+	 */
+	public WayPoint getSelectedWayPoint() {
+		if (this.selectedIndex != -1 && profile != null && profile.getWayPoints() != null && profile.getWayPoints().size() > this.selectedIndex) {
+			return profile.getWayPoints().get(this.selectedIndex);
+		} else {
+			return null;			
+		}
+	}
+	
+	/**
+	 * Adds a selection listener.
+	 * @param listener The listener instance to add.
+	 */
+	public void addSelectionListener(IElevationProfileSelectionListener listener) {
+		if (listener == null) return;
+		
+		selectionChangedListeners.add(listener);
+	}
+	
+	/**
+	 * Removes a selection listener from the list.
+	 * @param listener The listener instance to remove.
+	 */
+	public void removeSelectionListener(IElevationProfileSelectionListener listener) {
+		if (listener == null) return;
+		
+		selectionChangedListeners.remove(listener);
+	}
+	
+	/**
+	 * Removes all selection listeners.
+	 */
+	public void removeAllSelectionListeners() {
+		selectionChangedListeners.clear();	
+	}
+	
+	protected void fireSelectionChanged(WayPoint selWayPoint) {
+		for (IElevationProfileSelectionListener listener : selectionChangedListeners) {
+			listener.selectedWayPointChanged(selWayPoint);
+		}
+	}
+
+	/* (non-Javadoc)
+	 * @see javax.swing.JComponent#paint(java.awt.Graphics)
+	 */
 	@Override
 	public void paint(Graphics g) {
+		isPainting = true;
 		super.paint(g);
 
@@ -91,7 +194,17 @@
 		} finally {
 			setFont(oldFont);
-		}
-	}
-
+			isPainting = false;
+		}
+	}
+
+	/**
+	 * Draw a string with a specified alignment.
+	 * @param s The text to display.
+	 * @param x The x coordinate.
+	 * @param y The y coordinate.
+	 * @param align The text alignment.
+	 * @param g The graphics context.
+	 * @return The resulting rectangle of the drawn string.
+	 */
 	private Rectangle drawAlignedString(String s, int x, int y,
 			TextAlignment align, Graphics g) {
@@ -115,12 +228,21 @@
 	}
 
+	/**
+	 * Draw a string which is horizontally centered around (x,y).
+	 * @param s The text to display.
+	 * @param x The x coordinate.
+	 * @param y The y coordinate.
+	 * @param g The graphics context.
+	 * @return The resulting rectangle of the drawn string.
+	 */
 	private void drawHCenteredString(String s, int x, int y, Graphics g) {
-		FontMetrics fm = g.getFontMetrics();
-		int xoff = fm.stringWidth(s) / 2;
-		// int yoff = (fm.getAscent() + fm.getDescent()) / 2;
-
-		g.drawString(s, x - xoff, y);
-	}
-
+		drawAlignedString(s, x, y, TextAlignment.Centered, g);
+	}
+
+	/**
+	 * Formats the date in a predefined manner: "21. Oct 2010, 12:10".
+	 * @param date
+	 * @return
+	 */
 	private String formatDate(Date date) {
 		Format formatter = new SimpleDateFormat("d MMM yy, HH:mm");
@@ -129,4 +251,8 @@
 	}
 
+	/**
+	 * Helper function to draw elevation axes.
+	 * @param g
+	 */
 	private void drawElevationLines(Graphics g) {
 		double diff = profile.getHeightDifference();
@@ -257,4 +383,8 @@
 			Color c = renderer.getColorForWaypoint(profile, wpt,
 					ElevationWayPointKind.Plain);
+			
+			if (i == this.selectedIndex) {
+				c = renderer.getColorForWaypoint(profile, wpt, ElevationWayPointKind.Highlighted);
+			}
 			int yEle = getYForEelevation(eleVal);
 			int x = getPlotLeft() + i;
@@ -276,4 +406,8 @@
 	}
 
+	
+	/* (non-Javadoc)
+	 * @see javax.swing.JComponent#paintBorder(java.awt.Graphics)
+	 */
 	@Override
 	protected void paintBorder(Graphics g) {
@@ -284,4 +418,8 @@
 	}
 
+
+	/**
+	 * Determines the size of the plot area depending on the panel size.
+	 */
 	private void createOrUpdatePlotArea() {
 		Dimension caSize = getSize();
@@ -306,5 +444,4 @@
 	public void componentHidden(ComponentEvent arg0) {
 		// TODO Auto-generated method stub
-
 	}
 
@@ -318,5 +455,4 @@
 	public void componentMoved(ComponentEvent arg0) {
 		// TODO Auto-generated method stub
-
 	}
 
@@ -343,3 +479,25 @@
 	}
 
+	@Override
+	public void mouseDragged(MouseEvent arg0) {
+		// TODO Auto-generated method stub
+		
+	}
+
+	@Override
+	public void mouseMoved(MouseEvent arg0) {
+		if (isPainting || arg0.isControlDown() || arg0.isAltDown() || arg0.isShiftDown()) arg0.consume();
+		
+		int x = arg0.getX();
+		int l = this.getX();
+		int pl = this.getPlotLeft();
+		int newIdx = x - l - pl;
+		
+		if (newIdx != this.selectedIndex && newIdx > 0) {
+			this.selectedIndex = newIdx;
+			this.repaint();		
+			fireSelectionChanged(getSelectedWayPoint());
+		}
+	}
+
 }
Index: /applications/editors/josm/plugins/ElevationProfile/src/org/openstreetmap/josm/plugins/elevation/gui/IElevationProfileSelectionListener.java
===================================================================
--- /applications/editors/josm/plugins/ElevationProfile/src/org/openstreetmap/josm/plugins/elevation/gui/IElevationProfileSelectionListener.java	(revision 23721)
+++ /applications/editors/josm/plugins/ElevationProfile/src/org/openstreetmap/josm/plugins/elevation/gui/IElevationProfileSelectionListener.java	(revision 23721)
@@ -0,0 +1,11 @@
+package org.openstreetmap.josm.plugins.elevation.gui;
+
+import org.openstreetmap.josm.data.gpx.WayPoint;
+
+public interface IElevationProfileSelectionListener {
+	/**
+	 * Notifies clients about selected index changed. 
+	 * @param newIndex
+	 */
+	public void selectedWayPointChanged(WayPoint wpt);
+}
