Index: /utils/josm/annotation_presets/presets.pre
===================================================================
--- /utils/josm/annotation_presets/presets.pre	(revision 1436)
+++ /utils/josm/annotation_presets/presets.pre	(revision 1436)
@@ -0,0 +1,112 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<annotations>
+<item name="Highway">
+	<label text="highway"/>
+	<combo key="highway" text="Type" values="unclassified,residential,service,unsurfaced,secondary,secondary_link,primary,primary_link,trunk,trunk_link,motorway,motorway_link"/>
+	<check key="oneway" text="Oneway?" values="1,-1"/>
+</item>
+<item name="Road Number">
+	<label text="Road Number"/>
+	<text key="ref" text="Number"/>
+	<combo key="source:ref" text="Source" values="landsat,photograph,local knowledge,common knowledge,dictaphone"/>
+	<text key="source_ref:ref" text="Source url"/>
+</item>
+<item name="Road Name">
+	<label text="Road Name"/>
+	<text key="name" text="Name"/>
+	<combo key="source:name" text="Source" values="landsat,photograph,local knowledge,common knowledge,dictaphone"/>
+	<text key="source_ref:name" text="Source url"/>
+</item>
+<item name="Roundabout">
+	<label text="Roundabout"/>
+	<key key="junction" value="roundabout"/>
+	<combo key="highway" text="Type" values="secondary,primary,trunk,motorway_link,residential,unclassified,service"/>
+</item>
+<item name="Footway">
+	<label text="Footway"/>
+	<combo key="highway" text="Type" values="footway,steps,cycleway,bridleway,byway"/>
+</item>
+<item name="Place">
+	<label text="Place"/>
+	<combo key="place" text="Type" values="hamlet,village,town,city,county,state"/>
+	<text key="name" text="Name"/>
+	<combo key="source:name" text="Name source" values="landsat,photograph,local knowledge,common knowledge,dictaphone"/>
+	<text key="source_ref:name" text="Name source url"/>
+</item>
+<item name="Gate">
+	<label text="Gate"/>
+	<key key="highway" value="gate"/>
+</item>
+<item name="Parking">
+	<label text="Parking"/>
+	<key key="amenity" value="parking"/>
+</item>
+<item name="Telephone">
+	<label text="Telephone"/>
+	<key key="amenity" value="telephone"/>
+	<text key="post_code" text="Post code"/>
+</item>
+<item name="Post Box">
+	<label text="Post Box"/>
+	<key key="amenity" value="post_box"/>
+	<text key="ref" text="Letter box number"/>
+</item>
+<item name="Church">
+	<label text="Church"/>
+	<key key="amenity" value="place_of_worship"/>
+	<combo key="denomination" text="Type" values="church_of_england,catholic,muslim,hindu,buddist,sikh,jewish,&lt;other - please specify&gt;"/>
+	<text key="name" text="Name"/>
+	<combo key="source:name" text="Name source" values="landsat,photograph,local knowledge,common knowledge,dictaphone"/>
+	<text key="source_ref:name" text="Name source url"/>
+</item>
+<item name="Waterway">
+	<label text="Waterway"/>
+	<combo key="waterway" text="Type" values="river,canal,drain,"/>
+	<text key="name" text="Name"/>
+	<combo key="source:name" text="Name source" values="landsat,photograph,local knowledge,common knowledge,dictaphone"/>
+	<text key="source_ref:name" text="Name source url"/>
+</item>
+<item name="Railway">
+	<label text="Railway"/>
+	<combo key="railway" text="Type" values="rail,tram,light_rail,subway,preserved,disused,abandoned,narrow_gauge"/>
+	<text key="name" text="Name"/>
+	<combo key="source:name" text="Name source" values="landsat,photograph,local knowledge,common knowledge,dictaphone"/>
+	<text key="source_ref:name" text="Name source url"/>
+</item>
+<item name="Railway Feature">
+	<label text="Railway Stations, halts, etc"/>
+	<combo key="railway" text="Type" values="station,halt,viaduct,crossing"/>
+	<text key="name" text="Name"/>
+	<combo key="source:name" text="Name source" values="landsat,photograph,local knowledge,common knowledge,dictaphone"/>
+	<text key="source_ref:name" text="Name source url"/>
+</item>
+<item name="Data Source">
+	<label text="Way/Segment/Node Data Source, if not GPS trackpoints"/>
+	<combo key="source" text="Name source" values="landsat,photograph,local knowledge,common knowledge,dictaphone"/>
+	<text key="source_ref" text="Source url"/>
+</item>
+<item name="Street Name Source">
+	<label text="Street Name Source."/>
+	<combo key="source:name" text="Name source" values="landsat,photograph,local knowledge,common knowledge,dictaphone"/>
+	<text key="source_ref:name" text="Name source url"/>
+</item>
+<item name="Road Number Source">
+	<label text="Road Number Source."/>
+	<combo key="source:ref" text="Number source" values="landsat,photograph,local knowledge,common knowledge,dictaphone"/>
+	<text key="source_ref:ref" text="Number source url"/>
+</item>
+<item name="Power Line">
+	<label text="Power Line"/>
+	<key key="power" value="line"/>
+	<text key="voltage" text="Voltage"/>
+</item>
+<item name="Pylon">
+	<label text="Power Line Pylon"/>
+	<key key="power" value="tower"/>
+	<text key="ref" text="Tower Id"/>
+</item>
+<item name="Layer">
+	<label text="Layer indicates whether a feature is above or below another feature"/>
+	<combo key="layer" text="Layer" values="-5,-4,-3,-2,-1,0,1,2,3,4,5"/>
+</item>
+</annotations>
Index: /utils/josm/plugins/landsat/.classpath
===================================================================
--- /utils/josm/plugins/landsat/.classpath	(revision 1436)
+++ /utils/josm/plugins/landsat/.classpath	(revision 1436)
@@ -0,0 +1,7 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<classpath>
+	<classpathentry kind="src" path="src"/>
+	<classpathentry kind="con" path="org.eclipse.jdt.launching.JRE_CONTAINER"/>
+	<classpathentry combineaccessrules="false" kind="src" path="/josm"/>
+	<classpathentry kind="output" path="bin"/>
+</classpath>
Index: /utils/josm/plugins/landsat/.project
===================================================================
--- /utils/josm/plugins/landsat/.project	(revision 1436)
+++ /utils/josm/plugins/landsat/.project	(revision 1436)
@@ -0,0 +1,17 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<projectDescription>
+	<name>landsat</name>
+	<comment></comment>
+	<projects>
+	</projects>
+	<buildSpec>
+		<buildCommand>
+			<name>org.eclipse.jdt.core.javabuilder</name>
+			<arguments>
+			</arguments>
+		</buildCommand>
+	</buildSpec>
+	<natures>
+		<nature>org.eclipse.jdt.core.javanature</nature>
+	</natures>
+</projectDescription>
Index: /utils/josm/plugins/landsat/build.xml
===================================================================
--- /utils/josm/plugins/landsat/build.xml	(revision 1436)
+++ /utils/josm/plugins/landsat/build.xml	(revision 1436)
@@ -0,0 +1,40 @@
+<project name="landsat" default="build" basedir=".">
+
+	<!-- point to your JOSM directory -->
+	<property name="josm" location="../josm/bin" />
+
+
+
+	<target name="init">
+		<mkdir dir="build"></mkdir>
+		<mkdir dir="dist"></mkdir>
+	</target>
+
+	<target name="compile" depends="init">
+		<javac srcdir="src" classpath="${josm}" debug="true" destdir="build">
+			<include name="**/*.java" />
+		</javac>
+	</target>
+
+	<target name="build" depends="compile">
+		<copy todir="build/images" >
+			<fileset dir="images" />
+		</copy>
+		<jar destfile="dist/landsat.jar" basedir="build">
+			<manifest>
+				<attribute name="Plugin-Class" value="landsat.LandsatPlugin" />
+				<attribute name="Plugin-Description" value="Provide a background layer that displays bitmaps downloaded from&lt;br&gt;a WMS Server, e.g. the Landsat pictures. Beware, that these&lt;br&gt;bitmaps can be off by up to 150 metres" />
+			</manifest>
+		</jar>
+	</target>
+
+	<target name="clean">
+		<delete dir="build" />
+		<delete dir="dist" />
+	</target>
+
+	<target name="install" depends="build">
+		<copy file="dist/landsat.jar" todir="${user.home}/.josm/plugins"/>
+	</target>
+
+</project>
Index: /utils/josm/plugins/landsat/src/landsat/DownloadLandsatTask.java
===================================================================
--- /utils/josm/plugins/landsat/src/landsat/DownloadLandsatTask.java	(revision 1436)
+++ /utils/josm/plugins/landsat/src/landsat/DownloadLandsatTask.java	(revision 1436)
@@ -0,0 +1,56 @@
+package landsat;
+
+import static org.openstreetmap.josm.tools.I18n.tr;
+
+import java.io.IOException;
+
+import javax.swing.JCheckBox;
+
+import org.openstreetmap.josm.Main;
+import org.openstreetmap.josm.actions.DownloadAction;
+import org.openstreetmap.josm.actions.DownloadAction.DownloadTask;
+import org.openstreetmap.josm.gui.PleaseWaitRunnable;
+
+public class DownloadLandsatTask extends PleaseWaitRunnable implements DownloadTask {
+
+	private LandsatLayer landsatLayer;
+	private double minlat, minlon, maxlat, maxlon;
+	private JCheckBox checkBox = new JCheckBox(tr("Landsat background images"));
+
+	public DownloadLandsatTask() {
+		super(tr("Downloading data"));
+		landsatLayer = new LandsatLayer
+		("http://onearth.jpl.nasa.gov/wms.cgi?request=GetMap&"+
+				"layers=global_mosaic&styles=&srs=EPSG:4326&"+
+		"format=image/jpeg");
+	}
+
+	@Override public void realRun() throws IOException {
+		landsatLayer.grab(minlat,minlon,maxlat,maxlon);
+	}
+
+	@Override protected void finish() {
+		if (landsatLayer != null)
+			Main.main.addLayer(landsatLayer);
+	}
+
+	@Override protected void cancel() {
+	}
+
+
+	public void download(DownloadAction action, double minlat, double minlon, double maxlat, double maxlon) {
+		this.minlat=minlat;
+		this.minlon=minlon;
+		this.maxlat=maxlat;
+		this.maxlon=maxlon;
+		Main.worker.execute(this);
+	}
+
+	public JCheckBox getCheckBox() {
+		return checkBox;
+	}
+
+	public String getPreferencesSuffix() {
+		return "landsat";
+	}
+}
Index: /utils/josm/plugins/landsat/src/landsat/LandsatImage.java
===================================================================
--- /utils/josm/plugins/landsat/src/landsat/LandsatImage.java	(revision 1436)
+++ /utils/josm/plugins/landsat/src/landsat/LandsatImage.java	(revision 1436)
@@ -0,0 +1,143 @@
+package landsat;
+
+import java.awt.Graphics;
+import java.awt.Image;
+import java.awt.Point;
+import java.io.IOException;
+import java.io.InputStream;
+import java.net.MalformedURLException;
+import java.net.URL;
+
+import javax.imageio.ImageIO;
+
+import org.openstreetmap.josm.Main;
+import org.openstreetmap.josm.data.coor.EastNorth;
+import org.openstreetmap.josm.data.coor.LatLon;
+import org.openstreetmap.josm.gui.NavigatableComponent;
+
+public class LandsatImage
+{
+	String constURL;
+	Image theImage;
+	double grabbedScale;
+	EastNorth topLeft;
+
+	public LandsatImage(String constURL)
+	{
+		this.constURL = constURL;
+	}
+
+	public void grab(NavigatableComponent nc) throws IOException
+	{
+
+		EastNorth topLeft  = nc.getEastNorth(0,0);
+		grabbedScale =  nc.getScale();  // scale is enPerPixel
+
+		this.topLeft = topLeft;
+
+		try
+		{
+			URL url = getURL(nc);
+			doGrab(url);
+		}
+		catch(MalformedURLException e)
+		{
+			System.out.println("Illegal url. Error="+e);
+		}
+	}
+
+	public void grab(NavigatableComponent nc,double minlat,double minlon,
+			double maxlat,double maxlon) throws IOException
+			{
+		LatLon p = new LatLon(minlat,minlon),
+		p2 = new LatLon(maxlat,maxlon);
+
+		grabbedScale = nc.getScale(); // enPerPixel
+
+		topLeft = Main.proj.latlon2eastNorth(new LatLon(maxlat,minlon));
+		EastNorth bottomRight = Main.proj.latlon2eastNorth
+		(new LatLon(minlat,maxlon));
+
+		int widthPx = (int)((bottomRight.east()-topLeft.east())/grabbedScale),
+		heightPx = (int)
+		((topLeft.north()-bottomRight.north()) / grabbedScale);
+
+		try
+		{
+			URL url =  doGetURL(p,p2,widthPx,heightPx);
+			doGrab(url);
+		}
+		catch(MalformedURLException e)
+		{
+			System.out.println("Illegal url. Error="+e);
+		}
+			}
+
+	private URL getURL(NavigatableComponent nc) throws MalformedURLException
+	{
+		double widthEN = nc.getWidth()*grabbedScale,
+		heightEN = nc.getHeight()*grabbedScale;
+		LatLon p = Main.proj.eastNorth2latlon(new EastNorth
+				(topLeft.east(), topLeft.north()-heightEN));
+		LatLon p2 = Main.proj.eastNorth2latlon(new EastNorth
+				(topLeft.east()+widthEN, topLeft.north()));
+		return doGetURL(p,p2,(int)(widthEN/grabbedScale),
+				(int)(heightEN/grabbedScale) );
+	}
+
+	private URL doGetURL(LatLon p, LatLon p2,int w, int h)
+	throws MalformedURLException
+	{
+		String str = constURL + "&bbox=" + p.lon() +"," + p.lat() + ","+
+		p2.lon()+","+p2.lat() + "&width=" + w
+		+ "&height=" + h;
+		return new URL(str);
+	}
+
+	private void doGrab (URL url) throws IOException
+	{
+		InputStream is = url.openStream();
+		theImage = ImageIO.read(is) ;
+		is.close();
+		Main.map.repaint();
+	}
+
+	public void paint(Graphics g,NavigatableComponent nc) /*,EastNorth bottomLeft,
+		   int x1, int y1, int x2, int y2) */
+	{
+		if(theImage!=null)
+		{
+			/*
+			System.out.println("x1="+x1+" y1="+y1+" x2="+x2+" y2="+y2+
+								" img w="+theImage.getWidth(null) +
+								" img h="+theImage.getHeight(null)) ;
+			 */
+			double zoomInFactor = grabbedScale / nc.getScale();
+
+			// Find the image x and y of the supplied bottom left
+			// This will be the difference in EastNorth units, divided by the
+			// grabbed scale in EastNorth/pixel.
+
+			/*
+			double ix = (bottomLeft.east()-this.bottomLeft.east())/grabbedScale,
+			   	   iy = theImage.getHeight(null) -
+				 ((bottomLeft.north() - this.bottomLeft.north())/grabbedScale);
+
+			g.drawImage(theImage,x1,y1,x2,y2,(int)ix,(int)iy,
+					(int)(ix+((x2-x1)/zoomInFactor)),
+					(int)(iy+((y2-y1)/zoomInFactor)), null);
+			 */
+			int w = theImage.getWidth(null), h=theImage.getHeight(null);
+			Point p = nc.getPoint(topLeft);
+			/*
+			System.out.println("topleft: e=" + topLeft.east() + " n="+
+							topLeft.north());
+			System.out.println("Drawing at "+p.x+","+p.y);
+			 */
+			g.drawImage(theImage,p.x,p.y,
+					(int)(p.x+w*zoomInFactor),
+					(int)(p.y+h*zoomInFactor),
+					0,0,w,h,null);
+		}
+	}
+}
Index: /utils/josm/plugins/landsat/src/landsat/LandsatLayer.java
===================================================================
--- /utils/josm/plugins/landsat/src/landsat/LandsatLayer.java	(revision 1436)
+++ /utils/josm/plugins/landsat/src/landsat/LandsatLayer.java	(revision 1436)
@@ -0,0 +1,99 @@
+package landsat;
+
+import static org.openstreetmap.josm.tools.I18n.tr;
+
+import java.awt.Component;
+import java.awt.Graphics;
+import java.awt.Toolkit;
+import java.io.IOException;
+
+import javax.swing.Icon;
+import javax.swing.ImageIcon;
+import javax.swing.JMenuItem;
+import javax.swing.JSeparator;
+
+import org.openstreetmap.josm.Main;
+import org.openstreetmap.josm.data.osm.visitor.BoundingXYVisitor;
+import org.openstreetmap.josm.data.projection.Projection;
+import org.openstreetmap.josm.gui.MapView;
+import org.openstreetmap.josm.gui.dialogs.LayerList;
+import org.openstreetmap.josm.gui.dialogs.LayerListPopup;
+import org.openstreetmap.josm.gui.layer.Layer;
+
+/**
+ * This is a layer that grabs the current screen from an WMS server. The data
+ * fetched this way is tiled and managerd to the disc to reduce server load.
+ */
+public class LandsatLayer extends Layer {
+
+	private static Icon icon = new ImageIcon(Toolkit.getDefaultToolkit().createImage(LandsatPlugin.class.getResource("/images/wms.png")));
+
+	private final LandsatImage landsatImage;
+
+	private final String url;
+
+
+	public LandsatLayer(String url) {
+		super(url.indexOf('/') != -1 ? url.substring(url.indexOf('/')+1) : url);
+
+		// to calculate the world dimension, we assume that the projection does
+		// not have problems with translating longitude to a correct scale.
+		// Next to that, the projection must be linear dependend on the lat/lon
+		// unprojected scale.
+		if (Projection.MAX_LON != 180)
+			throw new IllegalArgumentException(tr
+					("Wrong longitude transformation for tile manager. "+
+							"Can't operate on {0}",Main.proj));
+
+		this.url = url;
+		landsatImage = new LandsatImage(url);
+	}
+
+	public void grab() throws IOException
+	{
+		MapView mv = Main.map.mapView;
+		landsatImage.grab(mv);
+	}
+
+	public void grab(double minlat,double minlon,double maxlat,double maxlon)
+	throws IOException
+	{
+		MapView mv = Main.map.mapView;
+		landsatImage.grab(mv,minlat,minlon,maxlat,maxlon);
+	}
+
+	@Override public Icon getIcon() {
+		return icon;
+	}
+
+	@Override public String getToolTipText() {
+		return tr("WMS layer: {0}", url);
+	}
+
+	@Override public boolean isMergable(Layer other) {
+		return false;
+	}
+
+	@Override public void mergeFrom(Layer from) {
+	}
+
+	@Override public void paint(Graphics g, final MapView mv) {
+		landsatImage.paint(g,mv);
+	}
+
+	@Override public void visitBoundingBox(BoundingXYVisitor v) {
+		// doesn't have a bounding box
+	}
+
+	@Override public Object getInfoComponent() {
+		return getToolTipText();
+	}
+
+	@Override public Component[] getMenuEntries() {
+		return new Component[]{
+				new JMenuItem(new LayerList.ShowHideLayerAction(this)),
+				new JMenuItem(new LayerList.DeleteLayerAction(this)),
+				new JSeparator(),
+				new JMenuItem(new LayerListPopup.InfoAction(this))};
+	}
+}
Index: /utils/josm/plugins/landsat/src/landsat/LandsatPlugin.java
===================================================================
--- /utils/josm/plugins/landsat/src/landsat/LandsatPlugin.java	(revision 1436)
+++ /utils/josm/plugins/landsat/src/landsat/LandsatPlugin.java	(revision 1436)
@@ -0,0 +1,11 @@
+package landsat;
+
+import org.openstreetmap.josm.Main;
+import org.openstreetmap.josm.plugins.Plugin;
+
+public class LandsatPlugin extends Plugin {
+
+	public LandsatPlugin() {
+		Main.main.downloadAction.downloadTasks.add(new DownloadLandsatTask());
+	}
+}
Index: /utils/josm/plugins/mappaint/.classpath
===================================================================
--- /utils/josm/plugins/mappaint/.classpath	(revision 1436)
+++ /utils/josm/plugins/mappaint/.classpath	(revision 1436)
@@ -0,0 +1,7 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<classpath>
+	<classpathentry kind="src" path="src"/>
+	<classpathentry kind="con" path="org.eclipse.jdt.launching.JRE_CONTAINER"/>
+	<classpathentry combineaccessrules="false" kind="src" path="/josm"/>
+	<classpathentry kind="output" path="bin"/>
+</classpath>
Index: /utils/josm/plugins/mappaint/.externalToolBuilders/Ant.launch
===================================================================
--- /utils/josm/plugins/mappaint/.externalToolBuilders/Ant.launch	(revision 1436)
+++ /utils/josm/plugins/mappaint/.externalToolBuilders/Ant.launch	(revision 1436)
@@ -0,0 +1,22 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<launchConfiguration type="org.eclipse.ant.AntBuilderLaunchConfigurationType">
+<booleanAttribute key="org.eclipse.debug.ui.ATTR_LAUNCH_IN_BACKGROUND" value="false"/>
+<booleanAttribute key="org.eclipse.jdt.launching.DEFAULT_CLASSPATH" value="true"/>
+<booleanAttribute key="org.eclipse.ant.ui.DEFAULT_VM_INSTALL" value="false"/>
+<stringAttribute key="org.eclipse.ui.externaltools.ATTR_RUN_BUILD_KINDS" value="full,incremental,auto,clean"/>
+<listAttribute key="org.eclipse.debug.core.MAPPED_RESOURCE_TYPES">
+<listEntry value="1"/>
+</listAttribute>
+<booleanAttribute key="org.eclipse.ant.ui.ATTR_TARGETS_UPDATED" value="true"/>
+<stringAttribute key="org.eclipse.ui.externaltools.ATTR_WORKING_DIRECTORY" value="${workspace_loc:/mappaint}"/>
+<booleanAttribute key="org.eclipse.debug.core.appendEnvironmentVariables" value="true"/>
+<booleanAttribute key="org.eclipse.ui.externaltools.ATTR_TRIGGERS_CONFIGURED" value="true"/>
+<stringAttribute key="org.eclipse.jdt.launching.CLASSPATH_PROVIDER" value="org.eclipse.ant.ui.AntClasspathProvider"/>
+<booleanAttribute key="org.eclipse.ui.externaltools.ATTR_BUILDER_ENABLED" value="false"/>
+<stringAttribute key="org.eclipse.ant.ui.ATTR_ANT_CLEAN_TARGETS" value="clean,"/>
+<stringAttribute key="org.eclipse.jdt.launching.PROJECT_ATTR" value="mappaint"/>
+<listAttribute key="org.eclipse.debug.core.MAPPED_RESOURCE_PATHS">
+<listEntry value="/mappaint/build.xml"/>
+</listAttribute>
+<stringAttribute key="org.eclipse.ui.externaltools.ATTR_LOCATION" value="${workspace_loc:/mappaint/build.xml}"/>
+</launchConfiguration>
Index: /utils/josm/plugins/mappaint/.project
===================================================================
--- /utils/josm/plugins/mappaint/.project	(revision 1436)
+++ /utils/josm/plugins/mappaint/.project	(revision 1436)
@@ -0,0 +1,26 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<projectDescription>
+	<name>mappaint</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>
+			<arguments>
+				<dictionary>
+					<key>LaunchConfigHandle</key>
+					<value>&lt;project&gt;/.externalToolBuilders/Ant.launch</value>
+				</dictionary>
+			</arguments>
+		</buildCommand>
+	</buildSpec>
+	<natures>
+		<nature>org.eclipse.jdt.core.javanature</nature>
+	</natures>
+</projectDescription>
Index: /utils/josm/plugins/mappaint/.settings/org.eclipse.jdt.core.prefs
===================================================================
--- /utils/josm/plugins/mappaint/.settings/org.eclipse.jdt.core.prefs	(revision 1436)
+++ /utils/josm/plugins/mappaint/.settings/org.eclipse.jdt.core.prefs	(revision 1436)
@@ -0,0 +1,52 @@
+#Thu Oct 05 20:50:49 CEST 2006
+eclipse.preferences.version=1
+org.eclipse.jdt.core.compiler.problem.annotationSuperInterface=warning
+org.eclipse.jdt.core.compiler.problem.autoboxing=ignore
+org.eclipse.jdt.core.compiler.problem.deprecation=warning
+org.eclipse.jdt.core.compiler.problem.deprecationInDeprecatedCode=disabled
+org.eclipse.jdt.core.compiler.problem.deprecationWhenOverridingDeprecatedMethod=disabled
+org.eclipse.jdt.core.compiler.problem.discouragedReference=warning
+org.eclipse.jdt.core.compiler.problem.emptyStatement=warning
+org.eclipse.jdt.core.compiler.problem.fallthroughCase=ignore
+org.eclipse.jdt.core.compiler.problem.fieldHiding=ignore
+org.eclipse.jdt.core.compiler.problem.finalParameterBound=warning
+org.eclipse.jdt.core.compiler.problem.finallyBlockNotCompletingNormally=warning
+org.eclipse.jdt.core.compiler.problem.forbiddenReference=error
+org.eclipse.jdt.core.compiler.problem.hiddenCatchBlock=warning
+org.eclipse.jdt.core.compiler.problem.incompatibleNonInheritedInterfaceMethod=warning
+org.eclipse.jdt.core.compiler.problem.incompleteEnumSwitch=ignore
+org.eclipse.jdt.core.compiler.problem.indirectStaticAccess=ignore
+org.eclipse.jdt.core.compiler.problem.localVariableHiding=ignore
+org.eclipse.jdt.core.compiler.problem.methodWithConstructorName=warning
+org.eclipse.jdt.core.compiler.problem.missingDeprecatedAnnotation=warning
+org.eclipse.jdt.core.compiler.problem.missingOverrideAnnotation=ignore
+org.eclipse.jdt.core.compiler.problem.missingSerialVersion=ignore
+org.eclipse.jdt.core.compiler.problem.noEffectAssignment=warning
+org.eclipse.jdt.core.compiler.problem.noImplicitStringConversion=warning
+org.eclipse.jdt.core.compiler.problem.nonExternalizedStringLiteral=ignore
+org.eclipse.jdt.core.compiler.problem.nullReference=ignore
+org.eclipse.jdt.core.compiler.problem.overridingPackageDefaultMethod=warning
+org.eclipse.jdt.core.compiler.problem.parameterAssignment=ignore
+org.eclipse.jdt.core.compiler.problem.possibleAccidentalBooleanAssignment=warning
+org.eclipse.jdt.core.compiler.problem.rawTypeReference=warning
+org.eclipse.jdt.core.compiler.problem.specialParameterHidingField=disabled
+org.eclipse.jdt.core.compiler.problem.staticAccessReceiver=warning
+org.eclipse.jdt.core.compiler.problem.suppressWarnings=enabled
+org.eclipse.jdt.core.compiler.problem.syntheticAccessEmulation=ignore
+org.eclipse.jdt.core.compiler.problem.typeParameterHiding=warning
+org.eclipse.jdt.core.compiler.problem.uncheckedTypeOperation=warning
+org.eclipse.jdt.core.compiler.problem.undocumentedEmptyBlock=ignore
+org.eclipse.jdt.core.compiler.problem.unhandledWarningToken=warning
+org.eclipse.jdt.core.compiler.problem.unnecessaryElse=warning
+org.eclipse.jdt.core.compiler.problem.unnecessaryTypeCheck=warning
+org.eclipse.jdt.core.compiler.problem.unqualifiedFieldAccess=ignore
+org.eclipse.jdt.core.compiler.problem.unusedDeclaredThrownException=warning
+org.eclipse.jdt.core.compiler.problem.unusedDeclaredThrownExceptionWhenOverriding=enabled
+org.eclipse.jdt.core.compiler.problem.unusedImport=warning
+org.eclipse.jdt.core.compiler.problem.unusedLabel=warning
+org.eclipse.jdt.core.compiler.problem.unusedLocal=warning
+org.eclipse.jdt.core.compiler.problem.unusedParameter=ignore
+org.eclipse.jdt.core.compiler.problem.unusedParameterWhenImplementingAbstract=disabled
+org.eclipse.jdt.core.compiler.problem.unusedParameterWhenOverridingConcrete=disabled
+org.eclipse.jdt.core.compiler.problem.unusedPrivateMember=warning
+org.eclipse.jdt.core.compiler.problem.varargsArgumentNeedCast=warning
Index: /utils/josm/plugins/mappaint/build.xml
===================================================================
--- /utils/josm/plugins/mappaint/build.xml	(revision 1436)
+++ /utils/josm/plugins/mappaint/build.xml	(revision 1436)
@@ -0,0 +1,40 @@
+<project name="mappaint" default="build" basedir=".">
+
+	<!-- point to your JOSM directory -->
+	<property name="josm" location="../josm/bin" />
+
+
+
+	<target name="init">
+		<mkdir dir="build"></mkdir>
+		<mkdir dir="dist"></mkdir>
+	</target>
+
+	<target name="compile" depends="init">
+		<javac srcdir="src" classpath="${josm}" destdir="build">
+			<include name="**/*.java" />
+		</javac>
+	</target>
+
+	<target name="build" depends="compile">
+		<copy todir="build/images">
+			<fileset dir="images"></fileset>
+		</copy>
+		<jar destfile="dist/mappaint.jar" basedir="build">
+			<manifest>
+				<attribute name="Plugin-Class" value="mappaint.MapPaintPlugin" />
+				<attribute name="Plugin-Description" value="An alternative render for the map with colouring, line thickness and icons.&lt;br&gt;You need an elemstyle.xml saved into ~/.josm/plugins/mappaint/" />
+			</manifest>
+		</jar>
+	</target>
+
+	<target name="clean">
+		<delete dir="build" />
+		<delete dir="dist" />
+	</target>
+
+	<target name="install" depends="build">
+		<copy file="dist/mappaint.jar" todir="${user.home}/.josm/plugins"/>
+	</target>
+
+</project>
Index: /utils/josm/plugins/mappaint/src/mappaint/AreaElemStyle.java
===================================================================
--- /utils/josm/plugins/mappaint/src/mappaint/AreaElemStyle.java	(revision 1436)
+++ /utils/josm/plugins/mappaint/src/mappaint/AreaElemStyle.java	(revision 1436)
@@ -0,0 +1,22 @@
+package mappaint;
+import java.awt.Color;
+
+public class AreaElemStyle extends ElemStyle
+{
+	Color colour;
+
+	public AreaElemStyle (Color colour)
+	{
+		this.colour = colour;
+	}
+
+	public Color getColour()
+	{
+		return colour;
+	}
+
+	@Override public String toString()
+	{
+		return "AreaElemStyle:   colour=" + colour;
+	}
+}
Index: /utils/josm/plugins/mappaint/src/mappaint/ElemStyle.java
===================================================================
--- /utils/josm/plugins/mappaint/src/mappaint/ElemStyle.java	(revision 1436)
+++ /utils/josm/plugins/mappaint/src/mappaint/ElemStyle.java	(revision 1436)
@@ -0,0 +1,9 @@
+package mappaint;
+
+// nothing in here yet
+abstract public class ElemStyle
+{
+}
+
+
+
Index: /utils/josm/plugins/mappaint/src/mappaint/ElemStyleHandler.java
===================================================================
--- /utils/josm/plugins/mappaint/src/mappaint/ElemStyleHandler.java	(revision 1436)
+++ /utils/josm/plugins/mappaint/src/mappaint/ElemStyleHandler.java	(revision 1436)
@@ -0,0 +1,142 @@
+package mappaint;
+
+import java.awt.Color;
+import java.awt.Toolkit;
+import java.net.URL;
+
+import javax.swing.ImageIcon;
+
+import org.openstreetmap.josm.tools.ColorHelper;
+import org.xml.sax.Attributes;
+import org.xml.sax.helpers.DefaultHandler;
+
+public class ElemStyleHandler extends DefaultHandler
+{
+	boolean inDoc, inRule, inCondition, inElemStyle, inLine, inIcon, inArea;
+	ElemStyle curStyle;
+	ElemStyles styles;
+	String curWidth, curKey, curValue;
+	ImageIcon curIcon;
+	Color curColour;
+	boolean curAnnotate;
+
+	public ElemStyleHandler(  )
+	{
+		inDoc=inRule=inCondition=inElemStyle=inLine=inIcon=inArea=false;
+		styles = new ElemStyles();
+	}
+
+	public void setElemStyles(ElemStyles styles)
+	{
+		this.styles = styles;
+	}
+
+	/*
+	ElemStyles getElemStyles()
+	{
+		return styles;
+	}
+	*/
+
+	@Override public void startDocument()
+	{
+		inDoc = true;
+	}
+
+	@Override public void endDocument()
+	{
+		inDoc = false;
+	}
+
+	@Override public void startElement(String uri,String name, String qName, 
+									Attributes atts)	
+	{
+		if(inDoc==true)
+		{
+			if(qName.equals("rule"))
+			{
+				inRule=true;
+			}
+			else if (qName.equals("condition") && inRule)
+			{
+				inCondition=true;
+				for(int count=0; count<atts.getLength(); count++)
+				{
+					if(atts.getQName(count).equals("k"))
+						curKey = atts.getValue(count);		
+					else if(atts.getQName(count).equals("v"))
+						curValue = atts.getValue(count);		
+				}
+			}
+			else if (qName.equals("line"))
+			{
+				inLine = true;
+				for(int count=0; count<atts.getLength(); count++)
+				{
+					if(atts.getQName(count).equals("width"))
+						curWidth = atts.getValue(count);
+					else if (atts.getQName(count).equals("colour"))
+						curColour=ColorHelper.html2color(atts.getValue(count));
+				}
+			}
+			else if (qName.equals("icon"))
+			{
+				inIcon = true;
+				for(int count=0; count<atts.getLength(); count++)
+				{
+					if(atts.getQName(count).equals("src")) {
+						URL path = getClass().getResource("/images/nodes/"+atts.getValue(count));
+						curIcon = new ImageIcon(Toolkit.getDefaultToolkit().createImage(path));
+					} else if (atts.getQName(count).equals("annotate"))
+						curAnnotate = Boolean.parseBoolean
+										(atts.getValue(count));
+				}
+			}
+			else if (qName.equals("area"))
+			{
+				inArea = true;
+				for(int count=0; count<atts.getLength(); count++)
+				{
+					if (atts.getQName(count).equals("colour"))
+						curColour=ColorHelper.html2color(atts.getValue(count));
+				}
+			}
+		}
+	}
+
+
+	@Override public void endElement(String uri,String name, String qName)
+	{
+		if(inRule && qName.equals("rule"))
+		{
+			inRule = false;
+			styles.add (curKey, curValue, curStyle);
+		}
+		else if (inCondition && qName.equals("condition"))
+			inCondition = false;
+		else if (inLine && qName.equals("line"))
+		{
+			inLine = false;
+			curStyle = new LineElemStyle(Integer.parseInt(curWidth), curColour);
+		}
+		else if (inIcon && qName.equals("icon"))
+		{
+			inIcon = false;
+			curStyle = new IconElemStyle(curIcon,curAnnotate);
+		}
+		else if (inArea && qName.equals("area"))
+		{
+			inArea = false;
+			curStyle = new AreaElemStyle (curColour);
+		}
+
+	}
+
+	@Override public void characters(char ch[], int start, int length)
+	{
+	}
+}
+////////////////////////////////////////////////////////////////////////////////
+
+
+
Index: /utils/josm/plugins/mappaint/src/mappaint/ElemStyles.java
===================================================================
--- /utils/josm/plugins/mappaint/src/mappaint/ElemStyles.java	(revision 1436)
+++ /utils/josm/plugins/mappaint/src/mappaint/ElemStyles.java	(revision 1436)
@@ -0,0 +1,39 @@
+package mappaint;
+
+import java.util.HashMap;
+import java.util.Iterator;
+
+import org.openstreetmap.josm.data.osm.OsmPrimitive;
+public class ElemStyles
+{
+	HashMap<String, ElemStyle> styles;
+
+	public ElemStyles()
+	{
+		styles = new HashMap<String, ElemStyle>();
+	}
+
+	public void add (String k, String v, ElemStyle style)
+	{
+		String key = k + "=" + v;
+		styles.put(key, style);
+	}
+
+	public ElemStyle getStyle (OsmPrimitive p)
+	{
+		if(p.keys!=null)
+		{
+			Iterator<String> iterator = p.keys.keySet().iterator();
+			while(iterator.hasNext())	
+			{
+				String key = iterator.next();
+				String kv = key + "=" + p.keys.get(key);
+				if(styles.containsKey(kv))
+				{
+					return styles.get(kv);
+				}
+			}
+		}
+		return null;
+	}
+}
Index: /utils/josm/plugins/mappaint/src/mappaint/IconElemStyle.java
===================================================================
--- /utils/josm/plugins/mappaint/src/mappaint/IconElemStyle.java	(revision 1436)
+++ /utils/josm/plugins/mappaint/src/mappaint/IconElemStyle.java	(revision 1436)
@@ -0,0 +1,29 @@
+package mappaint;
+import javax.swing.ImageIcon;
+
+public class IconElemStyle extends ElemStyle
+{
+	ImageIcon icon;
+	boolean annotate;
+
+	public IconElemStyle (ImageIcon icon, boolean annotate)
+	{
+		this.icon=icon;
+		this.annotate=annotate;
+	}	
+	
+	public ImageIcon getIcon()
+	{
+		return icon;
+	}
+
+	public boolean doAnnotate()
+	{
+		return annotate;
+	}
+
+	@Override public String toString()
+	{
+		return "LineElemStyle:  icon= " + icon +  " annotate=" + annotate;
+	}
+}
Index: /utils/josm/plugins/mappaint/src/mappaint/LineElemStyle.java
===================================================================
--- /utils/josm/plugins/mappaint/src/mappaint/LineElemStyle.java	(revision 1436)
+++ /utils/josm/plugins/mappaint/src/mappaint/LineElemStyle.java	(revision 1436)
@@ -0,0 +1,29 @@
+package mappaint;
+import java.awt.Color;
+
+public class LineElemStyle extends ElemStyle
+{
+	int width;
+	Color colour;
+
+	public LineElemStyle (int width, Color colour)
+	{
+		this.width = width;
+		this.colour = colour;
+	}
+
+	public int getWidth()
+	{
+		return width;
+	}
+
+	public Color getColour()
+	{
+		return colour;
+	}
+
+	@Override public String toString()
+	{
+		return "LineElemStyle:  width= " + width +  " colour=" + colour;
+	}
+}
Index: /utils/josm/plugins/mappaint/src/mappaint/MapPaintPlugin.java
===================================================================
--- /utils/josm/plugins/mappaint/src/mappaint/MapPaintPlugin.java	(revision 1436)
+++ /utils/josm/plugins/mappaint/src/mappaint/MapPaintPlugin.java	(revision 1436)
@@ -0,0 +1,56 @@
+package mappaint;
+
+import java.io.File;
+import java.io.FileReader;
+
+import org.openstreetmap.josm.gui.MapFrame;
+import org.openstreetmap.josm.gui.MapView.LayerChangeListener;
+import org.openstreetmap.josm.gui.layer.Layer;
+import org.openstreetmap.josm.gui.layer.OsmDataLayer;
+import org.openstreetmap.josm.plugins.Plugin;
+import org.xml.sax.InputSource;
+import org.xml.sax.XMLReader;
+import org.xml.sax.helpers.XMLReaderFactory;
+
+public class MapPaintPlugin extends Plugin implements LayerChangeListener {
+
+	public static ElemStyles elemStyles = new ElemStyles();
+
+	public MapPaintPlugin() {
+		String elemStylesFile = getPluginDir()+"elemstyles.xml";
+		File f = new File(elemStylesFile);
+		if (f.exists())
+		{
+			try
+			{
+				XMLReader xmlReader = XMLReaderFactory.createXMLReader();
+				ElemStyleHandler handler = new ElemStyleHandler();
+				xmlReader.setContentHandler(handler);
+				xmlReader.setErrorHandler(handler);
+				handler.setElemStyles(elemStyles);
+				// temporary only!
+				xmlReader.parse(new InputSource(new FileReader(f)));
+			}
+			catch (Exception e)
+			{
+				throw new RuntimeException(e);
+			}
+		}
+	}
+
+	public void mapFrameInitialized(MapFrame oldFrame, MapFrame newFrame) {
+		if (newFrame != null)
+			newFrame.mapView.addLayerChangeListener(this);
+		else
+			oldFrame.mapView.removeLayerChangeListener(this);
+	}
+
+	public void activeLayerChange(Layer oldLayer, Layer newLayer) {}
+
+	public void layerAdded(Layer newLayer) {
+		if (newLayer instanceof OsmDataLayer)
+			((OsmDataLayer)newLayer).setMapPainter(new MapPaintVisitor());
+    }
+
+	public void layerRemoved(Layer oldLayer) {}
+}
Index: /utils/josm/plugins/mappaint/src/mappaint/MapPaintVisitor.java
===================================================================
--- /utils/josm/plugins/mappaint/src/mappaint/MapPaintVisitor.java	(revision 1436)
+++ /utils/josm/plugins/mappaint/src/mappaint/MapPaintVisitor.java	(revision 1436)
@@ -0,0 +1,186 @@
+package mappaint;
+
+import java.awt.BasicStroke;
+import java.awt.Color;
+import java.awt.Font;
+import java.awt.Graphics2D;
+import java.awt.Point;
+import java.awt.Polygon;
+
+import javax.swing.ImageIcon;
+
+import org.openstreetmap.josm.Main;
+import org.openstreetmap.josm.data.osm.Node;
+import org.openstreetmap.josm.data.osm.Segment;
+import org.openstreetmap.josm.data.osm.Way;
+import org.openstreetmap.josm.data.osm.visitor.SimplePaintVisitor;
+
+/**
+ * A visitor that paints the OSM components in a map-like style.
+ */
+
+public class MapPaintVisitor extends SimplePaintVisitor {
+
+	/**
+	 * Draw a small rectangle. 
+	 * White if selected (as always) or red otherwise.
+	 * 
+	 * @param n The node to draw.
+	 */
+	// Altered from SimplePaintVisitor
+	@Override public void visit(Node n) {
+		ElemStyle nodeStyle = MapPaintPlugin.elemStyles.getStyle(n);
+		if(nodeStyle!=null)
+		{
+			if(nodeStyle instanceof IconElemStyle)
+			{
+				drawNode(n, ((IconElemStyle)nodeStyle).getIcon());
+			}
+			else
+			{
+				// throw some sort of exception
+			}
+		}
+		else
+		{
+			drawNode(n, n.selected ? getPreferencesColor("selected", 
+									Color.YELLOW)
+				: getPreferencesColor("node", Color.RED));
+		}
+	}
+
+	/**
+	 * Draw just a line between the points.
+	 * White if selected (as always) or grey otherwise.
+	 * Want to make un-wayed segments stand out less than ways.
+	 */
+	@Override public void visit(Segment ls) {
+		drawSegment(ls, Color.GRAY);
+	}
+
+	/**
+	 * Draw a line for all segments, according to tags.
+	 * @param w The way to draw.
+	 */
+	// Altered from SimplePaintVisitor
+	@Override public void visit(Way w) {
+		Color colour = Color.GRAY;
+		int width=1;
+		boolean area=false;
+		ElemStyle wayStyle = MapPaintPlugin.elemStyles.getStyle(w);
+		if(wayStyle!=null)
+		{
+			if(wayStyle instanceof LineElemStyle)
+			{
+				colour = ((LineElemStyle)wayStyle).getColour();
+				width = ((LineElemStyle)wayStyle).getWidth();
+			}
+			else if (wayStyle instanceof AreaElemStyle)
+			{
+				colour = ((AreaElemStyle)wayStyle).getColour();
+				area = true;
+			}
+		}
+
+		if(area)
+		{
+			drawWayAsArea(w,colour);
+		}
+		else
+		{
+			for (Segment ls : w.segments)
+			{
+				if (!ls.selected) // selected already in good color
+					drawSegment(ls, w.selected ? 
+						getPreferencesColor("selected", Color.YELLOW) : colour,
+						width);
+			}
+		}
+	}
+
+	// This assumes that all segments are aligned in the same direction!
+	protected void drawWayAsArea(Way w, Color colour)
+	{
+		Polygon polygon = new Polygon();
+		Point p;
+		boolean first=true;
+		for (Segment ls : w.segments)
+		{
+			if(first)
+			{
+				p = nc.getPoint(ls.from.eastNorth);
+				polygon.addPoint(p.x,p.y);
+				first=false;
+			}
+			p = nc.getPoint(ls.to.eastNorth);
+			polygon.addPoint(p.x,p.y);
+		}
+
+		g.setColor( w.selected ? 
+						getPreferencesColor("selected", Color.YELLOW) : colour);
+
+		g.fillPolygon(polygon);
+	}
+
+	// NEW
+	protected void drawNode(Node n, ImageIcon icon) {
+		Point p = nc.getPoint(n.eastNorth);
+		int w = icon.getIconWidth(), h=icon.getIconHeight();
+		icon.paintIcon ( Main.map.mapView, g, p.x-w/2, p.y-h/2 );
+		String name = (n.keys==null) ? null : n.keys.get("name");
+		if (name!=null)
+		{
+			g.setColor(Color.WHITE);
+			g.setFont (new Font("Helvetica", Font.PLAIN, 8));
+			g.drawString (name, p.x+w/2+2, p.y+h/2+2);
+		}
+		if (n.selected)
+		{
+			g.setColor (  getPreferencesColor("selected", Color.YELLOW) );
+			g.drawRect (p.x-w/2-2,p.y-w/2-2, w+4, h+4);
+		}
+	}
+
+	/**
+	 * Draw a line with the given color.
+	 */
+	// Altered - now specify width 
+	@Override protected void drawSegment(Segment ls, Color col) {
+			drawSegment(ls,col,1);
+	}
+
+	// Altered - now specify width 
+	private void drawSegment (Segment ls, Color col, int width) {
+		Graphics2D g2d = (Graphics2D)g;
+		if (ls.incomplete)
+			return;
+		if (ls.selected)
+			col = getPreferencesColor("selected", Color.YELLOW);
+		g.setColor(col);
+		//g.setWidth(width);
+		g2d.setStroke(new BasicStroke(width));
+		Point p1 = nc.getPoint(ls.from.eastNorth);
+		Point p2 = nc.getPoint(ls.to.eastNorth);
+		g.drawLine(p1.x, p1.y, p2.x, p2.y);
+
+		if (Main.pref.getBoolean("draw.segment.direction")) {
+			double t = Math.atan2(p2.y-p1.y, p2.x-p1.x) + Math.PI;
+	        g.drawLine(p2.x,p2.y, (int)(p2.x + 10*Math.cos(t-PHI)), (int)(p2.y + 10*Math.sin(t-PHI)));
+	        g.drawLine(p2.x,p2.y, (int)(p2.x + 10*Math.cos(t+PHI)), (int)(p2.y + 10*Math.sin(t+PHI)));
+		}
+	}
+
+
+	/**
+	 * Draw the node as small rectangle with the given color.
+	 *
+	 * @param n		The node to draw.
+	 * @param color The color of the node.
+	 */
+	@Override public void drawNode(Node n, Color color) {
+		Point p = nc.getPoint(n.eastNorth);
+		g.setColor(color);
+		g.drawRect(p.x-1, p.y-1, 2, 2);
+	}
+
+}
