Index: utils/josm/plugins/mappaint/build.xml
===================================================================
--- utils/josm/plugins/mappaint/build.xml	(revision 1437)
+++ utils/josm/plugins/mappaint/build.xml	(revision 1438)
@@ -12,5 +12,5 @@
 
 	<target name="compile" depends="init">
-		<javac srcdir="src" classpath="${josm}" destdir="build">
+		<javac srcdir="src" classpath="${josm}" destdir="build" debug="true">
 			<include name="**/*.java" />
 		</javac>
Index: utils/josm/plugins/mappaint/src/mappaint/MapPaintVisitor.java
===================================================================
--- utils/josm/plugins/mappaint/src/mappaint/MapPaintVisitor.java	(revision 1437)
+++ utils/josm/plugins/mappaint/src/mappaint/MapPaintVisitor.java	(revision 1438)
@@ -107,4 +107,5 @@
 		for (Segment ls : w.segments)
 		{
+		    if (ls.incomplete) continue;
 			if(first)
 			{
Index: utils/josm/plugins/osmarender/.classpath
===================================================================
--- utils/josm/plugins/osmarender/.classpath	(revision 1438)
+++ utils/josm/plugins/osmarender/.classpath	(revision 1438)
@@ -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/osmarender/.project
===================================================================
--- utils/josm/plugins/osmarender/.project	(revision 1438)
+++ utils/josm/plugins/osmarender/.project	(revision 1438)
@@ -0,0 +1,17 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<projectDescription>
+	<name>osmarender</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/osmarender/build.xml
===================================================================
--- utils/josm/plugins/osmarender/build.xml	(revision 1438)
+++ utils/josm/plugins/osmarender/build.xml	(revision 1438)
@@ -0,0 +1,44 @@
+<project name="osmarender" default="build" basedir=".">
+
+	<property name="josm" location="../../../../editors/josm/dist/josm-custom.jar" />
+	<property name="osmarender" location="../../../osmarender" />
+	<property name="target" location="dist/osmarender.jar" />
+
+
+
+	<target name="init">
+		<mkdir dir="build"></mkdir>
+		<mkdir dir="dist"></mkdir>
+	</target>
+
+	<target name="compile" depends="init">
+		<javac srcdir="src" debug="true" classpath="${josm}" destdir="build">
+			<include name="**/*.java" />
+		</javac>
+	</target>
+
+	<target name="build" depends="compile">
+		<copy todir="build">
+			<fileset dir="${osmarender}">
+				<include name="osmarender.xsl"/>
+				<include name="osm-map-features.xml"/>
+			</fileset>
+		</copy>
+		<jar destfile="${target}" basedir="build">
+			<manifest>
+				<attribute name="Plugin-Class" value="OsmarenderPlugin" />
+				<attribute name="Plugin-Description" value="Launches FireFox to display the current visible screen as a nice SVG image" />
+			</manifest>
+		</jar>
+	</target>
+
+	<target name="clean">
+		<delete dir="build" />
+		<delete dir="dist" />
+	</target>
+
+	<target name="install" depends="build">
+		<copy file="${target}" todir="${user.home}/.josm/plugins"/>
+	</target>
+
+</project>
Index: utils/josm/plugins/osmarender/src/OsmarenderPlugin.java
===================================================================
--- utils/josm/plugins/osmarender/src/OsmarenderPlugin.java	(revision 1438)
+++ utils/josm/plugins/osmarender/src/OsmarenderPlugin.java	(revision 1438)
@@ -0,0 +1,118 @@
+import static org.openstreetmap.josm.tools.I18n.tr;
+
+import java.awt.event.ActionEvent;
+import java.io.FileOutputStream;
+import java.io.IOException;
+import java.util.Collection;
+import java.util.HashSet;
+
+import javax.swing.AbstractAction;
+import javax.swing.JMenu;
+import javax.swing.JMenuBar;
+import javax.swing.JMenuItem;
+import javax.swing.JOptionPane;
+
+import org.openstreetmap.josm.Main;
+import org.openstreetmap.josm.data.Bounds;
+import org.openstreetmap.josm.data.coor.LatLon;
+import org.openstreetmap.josm.data.osm.DataSet;
+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.AddVisitor;
+import org.openstreetmap.josm.gui.MapFrame;
+import org.openstreetmap.josm.io.OsmWriter;
+import org.openstreetmap.josm.plugins.Plugin;
+
+
+public class OsmarenderPlugin extends Plugin {
+
+	private class Action extends AbstractAction {
+
+		public Action() {
+			super("Osmarender");
+		}
+
+		public void actionPerformed(ActionEvent e) {
+			// get all stuff visible on screen
+			LatLon bottomLeft = Main.map.mapView.getLatLon(0,Main.map.mapView.getHeight());
+			LatLon topRight = Main.map.mapView.getLatLon(Main.map.mapView.getWidth(), 0);
+			Bounds b = new Bounds(bottomLeft, topRight);
+			Collection<Node> nodes = new HashSet<Node>();
+			DataSet fromDataSet = new DataSet();
+			AddVisitor adder = new AddVisitor(fromDataSet);
+			for (Node n : Main.ds.nodes) {
+				if (n.coor.isWithin(b)) {
+					n.visit(adder);
+					nodes.add(n);
+				}
+			}
+			Collection<Segment> segments = new HashSet<Segment>();
+			for (Segment s : Main.ds.segments) {
+				if (nodes.contains(s.from) || nodes.contains(s.to)) {
+					s.visit(adder);
+					segments.add(s);
+				}
+			}
+			for (Way w : Main.ds.ways) {
+				for (Segment s : w.segments) {
+					if (segments.contains(s)) {
+						w.visit(adder);
+						break;
+					}
+				}
+			}
+
+			try {
+				// store the stuff in data.osm
+				OsmWriter.output(new FileOutputStream(getPluginDir()+"data.osm"), new OsmWriter.All(fromDataSet, true));
+
+				// launch up the viewer
+				String firefox = Main.pref.get("osmarender.firefox", "firefox");
+				Runtime.getRuntime().exec(firefox+" "+getPluginDir()+"osm-map-features.xml");
+			} catch (IOException e1) {
+				JOptionPane.showMessageDialog(Main.parent, "Could not launch Osmarender.");
+			}
+		}
+	}
+
+	private JMenu view;
+	private JMenuItem osmarenderMenu = new JMenuItem(new Action());
+
+	public OsmarenderPlugin() throws IOException {
+		JMenuBar menu = Main.main.mainMenu;
+		view = null;
+		for (int i = 0; i < menu.getMenuCount(); ++i) {
+			if (menu.getMenu(i) != null && tr("View").equals(menu.getMenu(i).getName())) {
+				view = menu.getMenu(i);
+				break;
+			}
+		}
+		if (view == null) {
+			view = new JMenu(tr("View"));
+			Main.main.mainMenu.add(view, 1);
+			view.setVisible(false);
+		}
+		view.add(osmarenderMenu);
+		osmarenderMenu.setVisible(false);
+
+		// install the xsl and xml file
+		copy("/osmarender.xsl", "osmarender.xsl");
+		copy("/osm-map-features.xml", "osm-map-features.xml");
+	}
+
+	@Override
+	public void mapFrameInitialized(MapFrame oldFrame, MapFrame newFrame) {
+		if (oldFrame != null && newFrame == null) {
+			// disable
+			osmarenderMenu.setVisible(false);
+			if (view.getMenuComponentCount() == 1)
+				view.setVisible(false);
+		} else if (oldFrame == null && newFrame != null) {
+			// enable
+			osmarenderMenu.setVisible(true);
+			if (view.getMenuComponentCount() == 1)
+				view.setVisible(true);
+		}
+	}
+}
