Index: /LICENSE
===================================================================
--- /LICENSE	(revision 35)
+++ /LICENSE	(revision 36)
@@ -1,9 +1,8 @@
 JOSM and all files included in this archive and the source archive from
 
-http://www.eigenheimstrasse.de/josm/josm-beta.jar
-http://www.eigenheimstrasse.de/josm/josm-beta-src.zip
-
-except the JDOM files and parts of UTM.java are copyrighted 2005 by 
-Immanuel Scholz. (Munich, 04.10.2005)
+http://www.eigenheimstrasse.de/josm
+
+except the JDOM files and parts of UTM.java are copyrighted 2005-2006
+by Immanuel Scholz.
 
 The files are distributed under the terms of the following License:
Index: /README
===================================================================
--- /README	(revision 35)
+++ /README	(revision 36)
@@ -7,7 +7,6 @@
 To run JOSM, you need:
 
-* josm-beta.jar
+* The jar file (e.g. josm-latest.jar)
 * The latest Java Runtime Environment 1.5. 
-
 
 
@@ -45,5 +44,5 @@
 
 Under Linux open a shell, go to the file directory and type
-"java -jar josm-beta.jar" to launch. If this don't help, try to set
+"java -jar josm-latest.jar" to launch. If this don't help, try to set
 you JAVA_HOME variable to the java location (the root location, not
 the bin. "/usr/lib/sun-j2se5.0-jdk" if you used the prebuild 
@@ -56,7 +55,6 @@
 ---------------------
 
-Download it from http://www.eigenheimstrasse.de/josm/josm-beta-src.zip
-or directly from the subversion at 
-http://www.eigenheimstrasse.de/svn/josm. The beta was Revision 12.
+Download it directly from the subversion at 
+http://www.eigenheimstrasse.de/svn/josm.
 
 
@@ -69,3 +67,2 @@
 
 Imi.
-
Index: /src/org/openstreetmap/josm/data/Preferences.java
===================================================================
--- /src/org/openstreetmap/josm/data/Preferences.java	(revision 35)
+++ /src/org/openstreetmap/josm/data/Preferences.java	(revision 36)
@@ -19,4 +19,5 @@
 import org.jdom.output.XMLOutputter;
 import org.openstreetmap.josm.data.projection.LatitudeLongitude;
+import org.openstreetmap.josm.data.projection.Mercator;
 import org.openstreetmap.josm.data.projection.Projection;
 import org.openstreetmap.josm.data.projection.UTM;
@@ -69,4 +70,5 @@
 	 */
 	public static final Projection[] allProjections = new Projection[]{
+		new Mercator(),
 		new UTM(),
 		new LatitudeLongitude()
Index: /src/org/openstreetmap/josm/data/osm/LineSegment.java
===================================================================
--- /src/org/openstreetmap/josm/data/osm/LineSegment.java	(revision 35)
+++ /src/org/openstreetmap/josm/data/osm/LineSegment.java	(revision 36)
@@ -1,4 +1,5 @@
 package org.openstreetmap.josm.data.osm;
 
+import org.openstreetmap.josm.data.GeoPoint;
 import org.openstreetmap.josm.data.osm.visitor.Visitor;
 
@@ -35,3 +36,18 @@
 		visitor.visit(this);
 	}
+	
+	/**
+	 * @return <code>true</code>, if the <code>ls</code> occupy
+	 * exactly the same place as <code>this</code>.
+	 */
+	public boolean equalPlace(LineSegment ls) {
+		if (equals(ls))
+			return true;
+		GeoPoint s1 = start.coor;
+		GeoPoint s2 = ls.start.coor;
+		GeoPoint e1 = end.coor;
+		GeoPoint e2 = ls.end.coor;
+		return ((s1.equalsLatLon(s2) && e1.equalsLatLon(e2)) ||
+				(s1.equalsLatLon(e2) && e1.equalsLatLon(s2)));
+	}
 }	
Index: /src/org/openstreetmap/josm/data/projection/Mercator.java
===================================================================
--- /src/org/openstreetmap/josm/data/projection/Mercator.java	(revision 36)
+++ /src/org/openstreetmap/josm/data/projection/Mercator.java	(revision 36)
@@ -0,0 +1,43 @@
+package org.openstreetmap.josm.data.projection;
+
+import javax.swing.JComponent;
+
+import org.openstreetmap.josm.data.GeoPoint;
+
+/**
+ * Implement Mercator Projection code, coded after documentation
+ * from wikipedia.
+ * 
+ * The center of the mercator projection is always the 0° 
+ * coordinate.
+ * 
+ * @author imi
+ */
+public class Mercator extends Projection {
+
+	@Override
+	public void latlon2xy(GeoPoint p) {
+		p.x = p.lon*Math.PI/180;
+		p.y = Math.log(Math.tan(Math.PI/4+p.lat*Math.PI/360));
+	}
+
+	@Override
+	public void xy2latlon(GeoPoint p) {
+		p.lon = p.x*180/Math.PI;
+		p.lat = Math.atan(Math.sinh(p.y))*180/Math.PI;
+	}
+
+	@Override
+	public String toString() {
+		return "Mercator";
+	}
+
+	@Override
+	public JComponent getConfigurationPanel() {
+		return null;
+	}
+
+	@Override
+	public void commitConfigurationPanel() {
+	}
+}
Index: /src/org/openstreetmap/josm/gui/MapStatus.java
===================================================================
--- /src/org/openstreetmap/josm/gui/MapStatus.java	(revision 35)
+++ /src/org/openstreetmap/josm/gui/MapStatus.java	(revision 36)
@@ -2,4 +2,6 @@
 
 import java.awt.AWTEvent;
+import java.awt.Font;
+import java.awt.GridBagLayout;
 import java.awt.Point;
 import java.awt.Toolkit;
@@ -10,4 +12,5 @@
 import java.beans.PropertyChangeEvent;
 import java.beans.PropertyChangeListener;
+import java.util.Collection;
 import java.util.Map.Entry;
 
@@ -63,9 +66,5 @@
 		 * The last object displayed in status line.
 		 */
-		OsmPrimitive osmStatus;
-		/**
-		 * A visitor to retrieve name information about the osm primitive
-		 */
-		private SelectionComponentVisitor visitor = new SelectionComponentVisitor();
+		Collection<OsmPrimitive> osmStatus;
 		/**
 		 * The old modifiers, that was pressed the last time this collector ran.
@@ -96,11 +95,19 @@
 				if ((ms.modifiers & MouseEvent.CTRL_DOWN_MASK) != 0 || ms.mousePos == null)
 					continue; // freeze display when holding down ctrl
-				OsmPrimitive osm = mv.getNearest(ms.mousePos, (ms.modifiers & MouseEvent.ALT_DOWN_MASK) != 0);
-				if (osm == osmStatus && ms.modifiers == oldModifiers)
+				Collection<OsmPrimitive> osms = mv.getAllNearest(ms.mousePos);
+				
+				if (osms == null && osmStatus == null && ms.modifiers == oldModifiers)
 					continue;
-				osmStatus = osm;
+				if (osms != null && osms.equals(osmStatus) && ms.modifiers == oldModifiers)
+					continue;
+
+				osmStatus = osms;
 				oldModifiers = ms.modifiers;
-				if (osm != null) {
-					osm.visit(visitor);
+				
+				// Set the text label in the bottom status bar
+				OsmPrimitive osmNearest = mv.getNearest(ms.mousePos, (ms.modifiers & MouseEvent.ALT_DOWN_MASK) != 0);
+				if (osmNearest != null) {
+					SelectionComponentVisitor visitor = new SelectionComponentVisitor();
+					osmNearest.visit(visitor);
 					nameText.setText(visitor.name);
 				} else
@@ -108,23 +115,29 @@
 				
 				// Popup Information
-				if ((ms.modifiers & MouseEvent.BUTTON2_DOWN_MASK) != 0 && osm != null) {
+				if ((ms.modifiers & MouseEvent.BUTTON2_DOWN_MASK) != 0 && osms != null) {
 					if (popup != null)
 						popup.hide();
 					
-					StringBuilder text = new StringBuilder("<html>");
-					text.append(visitor.name);
-					if (osm.keys != null) {
-						for (Entry<Key, String> e : osm.keys.entrySet()) {
-							text.append("<br>");
-							text.append(e.getKey().name);
-							text.append("=");
-							text.append(e.getValue());
-						}
+					JPanel c = new JPanel(new GridBagLayout());
+					for (OsmPrimitive osm : osms) {
+						SelectionComponentVisitor visitor = new SelectionComponentVisitor();
+						osm.visit(visitor);
+						StringBuilder text = new StringBuilder("<html>");
+						if (osm.id == 0 || osm.modified || osm.modifiedProperties)
+							visitor.name = "<i><b>"+visitor.name+"*</b></i>";
+						text.append(visitor.name);
+						if (osm.id != 0)
+							text.append("<br>id="+osm.id);
+						if (osm.keys != null)
+							for (Entry<Key, String> e : osm.keys.entrySet())
+								text.append("<br>"+e.getKey().name+"="+e.getValue());
+						JLabel l = new JLabel(text.toString()+"</html>", visitor.icon, JLabel.HORIZONTAL);
+						l.setFont(l.getFont().deriveFont(Font.PLAIN));
+						l.setVerticalTextPosition(JLabel.TOP);
+						c.add(l, GBC.eol());
 					}
-					JLabel l = new JLabel(text.toString(), visitor.icon, JLabel.HORIZONTAL);
-					l.setVerticalTextPosition(JLabel.TOP);
 					
 					Point p = mv.getLocationOnScreen();
-					popup = PopupFactory.getSharedInstance().getPopup(mv, l, p.x+ms.mousePos.x+16, p.y+ms.mousePos.y+16);
+					popup = PopupFactory.getSharedInstance().getPopup(mv, c, p.x+ms.mousePos.x+16, p.y+ms.mousePos.y+16);
 					popup.show();
 				} else if (popup != null) {
Index: /src/org/openstreetmap/josm/gui/MapView.java
===================================================================
--- /src/org/openstreetmap/josm/gui/MapView.java	(revision 35)
+++ /src/org/openstreetmap/josm/gui/MapView.java	(revision 36)
@@ -11,4 +11,5 @@
 import java.util.Collection;
 import java.util.Collections;
+import java.util.HashSet;
 import java.util.LinkedList;
 
@@ -137,4 +138,5 @@
 		// autoselect the new layer
 		setActiveLayer(layer);
+		recalculateCenterScale();
 	}
 
@@ -292,4 +294,56 @@
 	}
 
+	/**
+	 * @return A list of all objects that are nearest to 
+	 * the mouse. To do this, first the nearest object is 
+	 * determined.
+	 * 
+	 * If its a node, return all line segments and
+	 * streets the node is part of, as well as all nodes
+	 * (with their line segments and tracks) with the same
+	 * location.
+	 * 
+	 * If its a line segment, return all tracks this segment 
+	 * belongs to as well as all line segments that are between
+	 * the same nodes (in both direction) with all their tracks.
+	 * 
+	 * @return A collection of all items or <code>null</code>
+	 * 		if no item under or near the point. The returned
+	 * 		list is never empty.
+	 */
+	public Collection<OsmPrimitive> getAllNearest(Point p) {
+		OsmPrimitive osm = getNearest(p, false);
+		if (osm == null)
+			return null;
+		Collection<OsmPrimitive> c = new HashSet<OsmPrimitive>();
+		c.add(osm);
+		if (osm instanceof Node) {
+			Node node = (Node)osm;
+			for (Node n : Main.main.ds.nodes)
+				if (n.coor.equalsLatLon(node.coor))
+					c.add(n);
+			for (LineSegment ls : Main.main.ds.lineSegments)
+				// line segments never match nodes, so they are skipped by contains
+				if (c.contains(ls.start) || c.contains(ls.end))
+					c.add(ls);
+		} 
+		if (osm instanceof LineSegment) {
+			LineSegment line = (LineSegment)osm;
+			for (LineSegment ls : Main.main.ds.lineSegments)
+				if (ls.equalPlace(line))
+					c.add(ls);
+		}
+		if (osm instanceof Node || osm instanceof LineSegment) {
+			for (Track t : Main.main.ds.tracks) {
+				for (LineSegment ls : t.segments) {
+					if (c.contains(ls)) {
+						c.add(t);
+						break;
+					}
+				}
+			}
+		}
+		return c;
+	}
 	
 	/**
Index: /src/org/openstreetmap/josm/gui/dialogs/PropertiesDialog.java
===================================================================
--- /src/org/openstreetmap/josm/gui/dialogs/PropertiesDialog.java	(revision 35)
+++ /src/org/openstreetmap/josm/gui/dialogs/PropertiesDialog.java	(revision 36)
@@ -96,5 +96,5 @@
 
 		final JOptionPane optionPane = new JOptionPane(p, JOptionPane.QUESTION_MESSAGE, JOptionPane.OK_CANCEL_OPTION);
-		final JDialog dlg = optionPane.createDialog(PropertiesDialog.this, "Change values?");
+		final JDialog dlg = optionPane.createDialog(Main.main, "Change values?");
 		dlg.addWindowFocusListener(new WindowFocusListener(){
 			public void windowGainedFocus(WindowEvent e) {
@@ -162,5 +162,5 @@
 		JTextField values = new JTextField();
 		p2.add(values, BorderLayout.CENTER);
-		int answer = JOptionPane.showConfirmDialog(PropertiesDialog.this, p, 
+		int answer = JOptionPane.showConfirmDialog(Main.main, p, 
 				"Change values?", JOptionPane.OK_CANCEL_OPTION); 
 		if (answer != JOptionPane.OK_OPTION)
@@ -251,10 +251,10 @@
 				else if (e.getActionCommand().equals("Edit")) {
 					if (sel == -1)
-						JOptionPane.showMessageDialog(PropertiesDialog.this, "Please select the row to edit.");
+						JOptionPane.showMessageDialog(Main.main, "Please select the row to edit.");
 					else
 						edit(sel);
 				} else if (e.getActionCommand().equals("Delete")) {
 					if (sel == -1)
-						JOptionPane.showMessageDialog(PropertiesDialog.this, "Please select the row to delete.");
+						JOptionPane.showMessageDialog(Main.main, "Please select the row to delete.");
 					else
 						delete(sel);
