Index: applications/editors/josm/plugins/FastDraw/build.xml
===================================================================
--- applications/editors/josm/plugins/FastDraw/build.xml	(revision 29210)
+++ applications/editors/josm/plugins/FastDraw/build.xml	(revision 29263)
@@ -30,5 +30,5 @@
 <project name="FastDraw" default="dist" basedir=".">
     <!-- enter the SVN commit message -->
-    <property name="commit.message" value="FastDraw: better shortcut handling after core changes"/>
+    <property name="commit.message" value="JOSM/FastDraw: add option (Q) to draw closed polygons"/>
     <!-- enter the *lowest* JOSM version this plugin is currently compatible with -->
     <property name="plugin.main.version" value="5035"/>
Index: applications/editors/josm/plugins/FastDraw/src/org/openstreetmap/josm/plugins/fastdraw/DrawnPolyLine.java
===================================================================
--- applications/editors/josm/plugins/FastDraw/src/org/openstreetmap/josm/plugins/fastdraw/DrawnPolyLine.java	(revision 29210)
+++ applications/editors/josm/plugins/FastDraw/src/org/openstreetmap/josm/plugins/fastdraw/DrawnPolyLine.java	(revision 29263)
@@ -8,5 +8,4 @@
 import java.util.ListIterator;
 import java.util.Set;
-import javax.xml.stream.events.StartDocument;
 import org.openstreetmap.josm.data.coor.LatLon;
 import org.openstreetmap.josm.data.osm.OsmPrimitive;
@@ -380,3 +379,7 @@
     }
 
+    int getPointCount() {
+        return points.size();
+    }
+
 }
Index: applications/editors/josm/plugins/FastDraw/src/org/openstreetmap/josm/plugins/fastdraw/FDSettings.java
===================================================================
--- applications/editors/josm/plugins/FastDraw/src/org/openstreetmap/josm/plugins/fastdraw/FDSettings.java	(revision 29210)
+++ applications/editors/josm/plugins/FastDraw/src/org/openstreetmap/josm/plugins/fastdraw/FDSettings.java	(revision 29263)
@@ -33,4 +33,6 @@
     // option for simplifiction: 0="Autosimplify and wait",
     //1="Simplify and wait", 2="Save as is"
+
+    public boolean drawClosed;
     public int simplifyMode;
     public float lineWidth;
@@ -54,4 +56,5 @@
         fixedClick = Main.pref.getBoolean("fastdraw.fixedclick", false);
         fixedSpacebar = Main.pref.getBoolean("fastdraw.fixedspacebar", false);
+        drawClosed =  Main.pref.getBoolean("fastdraw.drawclosed", false);
         simplifyMode = Main.pref.getInteger("fastdraw.simplifymode", 0);
         lineWidth = (float) Main.pref.getDouble("fastdraw.linewidth", 2);
@@ -76,4 +79,5 @@
          Main.pref.put("fastdraw.fixedclick", fixedClick);
          Main.pref.put("fastdraw.fixedspacebar", fixedSpacebar);
+         Main.pref.put("fastdraw.drawclosed", drawClosed);
          Main.pref.putInteger("fastdraw.simplifymode", simplifyMode);
          Main.pref.putDouble("fastdraw.linewidth",(double)lineWidth);
Index: applications/editors/josm/plugins/FastDraw/src/org/openstreetmap/josm/plugins/fastdraw/FastDrawConfigDialog.java
===================================================================
--- applications/editors/josm/plugins/FastDraw/src/org/openstreetmap/josm/plugins/fastdraw/FastDrawConfigDialog.java	(revision 29210)
+++ applications/editors/josm/plugins/FastDraw/src/org/openstreetmap/josm/plugins/fastdraw/FastDrawConfigDialog.java	(revision 29263)
@@ -5,7 +5,8 @@
 package org.openstreetmap.josm.plugins.fastdraw;
 
-import org.openstreetmap.josm.tools.GBC;
+import java.awt.Component;
 import java.awt.GridBagLayout;
 import javax.swing.JOptionPane;
+import org.openstreetmap.josm.tools.GBC;
 import java.text.NumberFormat;
 import java.text.ParseException;
@@ -42,4 +43,6 @@
         JCheckBox fixedClickCb = new JCheckBox(tr("Add fixed points on click"));
         JCheckBox fixedSpaceCb = new JCheckBox(tr("Add fixed points on spacebar"));
+        JCheckBox drawClosedCb = new JCheckBox(tr("Draw closed polygons only"));
+        
         all.add(label1,GBC.std().insets(10,0,0,0));
         all.add(text1, GBC.eol().fill(GBC.HORIZONTAL).insets(5,0,0,5));
@@ -54,4 +57,5 @@
         all.add(fixedClickCb,GBC.eop().insets(20,0,0,0));
         all.add(fixedSpaceCb,GBC.eop().insets(20,0,0,0));
+        all.add(drawClosedCb,GBC.eop().insets(20,0,0,0));
         
         text1.setValue(settings.epsilonMult);
@@ -61,6 +65,7 @@
         fixedClickCb.setSelected(settings.fixedClick);
         fixedSpaceCb.setSelected(settings.fixedSpacebar);
+        drawClosedCb.setSelected(settings.drawClosed);
         combo1.setSelectedIndex(settings.simplifyMode);
-
+        
         ExtendedDialog dialog = new ExtendedDialog(Main.parent,
                 tr("FastDraw settings"),
@@ -84,4 +89,5 @@
             settings.fixedClick=fixedClickCb.isSelected();
             settings.fixedSpacebar=fixedSpaceCb.isSelected();
+            settings.drawClosed=drawClosedCb.isSelected();
             settings.simplifyMode=combo1.getSelectedIndex();
             settings.savePrefs();
Index: applications/editors/josm/plugins/FastDraw/src/org/openstreetmap/josm/plugins/fastdraw/FastDrawingMode.java
===================================================================
--- applications/editors/josm/plugins/FastDraw/src/org/openstreetmap/josm/plugins/fastdraw/FastDrawingMode.java	(revision 29210)
+++ applications/editors/josm/plugins/FastDraw/src/org/openstreetmap/josm/plugins/fastdraw/FastDrawingMode.java	(revision 29263)
@@ -127,5 +127,5 @@
         mv = Main.map.mapView;
         line.setMv(mv);
-
+        
         if (getCurrentDataSet() == null) return;
 
@@ -195,5 +195,5 @@
             g.setStroke(strokeForOriginal);
         }
-
+        
         Point p1, p2;
         LatLon pp1, pp2;
@@ -308,4 +308,5 @@
             return;
         }
+        autoCloseIfNeeded();
 
         if (ctrl && shift) {newDrawing();repaint();return;}
@@ -427,5 +428,5 @@
             }
         }
-        //statusText = getLatLon(e).toString();        updateStatusLine();
+        autoCloseIfNeeded();
     }
 
@@ -721,19 +722,5 @@
         Main.map.mapView.repaint();
     }
-// </editor-fold>
-
-// <editor-fold defaultstate="collapsed" desc="Helper functions">
-
-    private Node getNearestNode(Point point, double maxDist) {
-       Node nd = Main.map.mapView.getNearestNode(point, OsmPrimitive.isSelectablePredicate);
-       if (nd!=null && line.getPoint(nd.getCoor()).distance(point)<=maxDist) return nd;
-       else return null;
-    }
-
-    LatLon getLatLon(MouseEvent e) {
-        return mv.getLatLon(e.getX(), e.getY());
-    }
-// </editor-fold>
-
+    
     private void tryToLoadWay() {
         updateCursor();
@@ -749,4 +736,23 @@
     }
 
+    private void autoCloseIfNeeded() {
+        if (settings.drawClosed && line.getPointCount()>1 && !line.isClosed()) {
+            line.closeLine();
+        }
+    }
+// </editor-fold>
+
+// <editor-fold defaultstate="collapsed" desc="Helper functions">
+
+    private Node getNearestNode(Point point, double maxDist) {
+       Node nd = Main.map.mapView.getNearestNode(point, OsmPrimitive.isSelectablePredicate);
+       if (nd!=null && line.getPoint(nd.getCoor()).distance(point)<=maxDist) return nd;
+       else return null;
+    }
+
+    LatLon getLatLon(MouseEvent e) {
+        return mv.getLatLon(e.getX(), e.getY());
+    }
+// </editor-fold>
 
 }
