Index: applications/editors/josm/plugins/buildings_tools/.settings/org.eclipse.jdt.core.prefs
===================================================================
--- applications/editors/josm/plugins/buildings_tools/.settings/org.eclipse.jdt.core.prefs	(revision 24240)
+++ applications/editors/josm/plugins/buildings_tools/.settings/org.eclipse.jdt.core.prefs	(revision 24243)
@@ -1,3 +1,3 @@
-#Fri Sep 24 19:30:08 MSD 2010
+#Mon Nov 15 17:53:13 MSK 2010
 eclipse.preferences.version=1
 org.eclipse.jdt.core.formatter.align_type_members_on_columns=false
Index: applications/editors/josm/plugins/buildings_tools/.settings/org.eclipse.jdt.ui.prefs
===================================================================
--- applications/editors/josm/plugins/buildings_tools/.settings/org.eclipse.jdt.ui.prefs	(revision 24240)
+++ applications/editors/josm/plugins/buildings_tools/.settings/org.eclipse.jdt.ui.prefs	(revision 24243)
@@ -1,6 +1,6 @@
-#Sat Jun 19 21:24:56 MSD 2010
+#Mon Nov 15 17:59:59 MSK 2010
 eclipse.preferences.version=1
 editor_save_participant_org.eclipse.jdt.ui.postsavelistener.cleanup=true
-formatter_profile=_BTProf
+formatter_profile=_My Profile
 formatter_settings_version=11
 sp_cleanup.add_default_serial_version_id=true
@@ -11,4 +11,5 @@
 sp_cleanup.add_missing_nls_tags=false
 sp_cleanup.add_missing_override_annotations=true
+sp_cleanup.add_missing_override_annotations_interface_methods=true
 sp_cleanup.add_serial_version_id=false
 sp_cleanup.always_use_blocks=true
@@ -19,13 +20,13 @@
 sp_cleanup.correct_indentation=false
 sp_cleanup.format_source_code=true
-sp_cleanup.format_source_code_changes_only=false
+sp_cleanup.format_source_code_changes_only=true
 sp_cleanup.make_local_variable_final=false
 sp_cleanup.make_parameters_final=false
 sp_cleanup.make_private_fields_final=true
 sp_cleanup.make_type_abstract_if_missing_method=false
-sp_cleanup.make_variable_declarations_final=true
+sp_cleanup.make_variable_declarations_final=false
 sp_cleanup.never_use_blocks=false
 sp_cleanup.never_use_parentheses_in_expressions=true
-sp_cleanup.on_save_use_additional_actions=false
+sp_cleanup.on_save_use_additional_actions=true
 sp_cleanup.organize_imports=false
 sp_cleanup.qualify_static_field_accesses_with_declaring_class=false
@@ -35,5 +36,5 @@
 sp_cleanup.qualify_static_method_accesses_with_declaring_class=false
 sp_cleanup.remove_private_constructors=true
-sp_cleanup.remove_trailing_whitespaces=false
+sp_cleanup.remove_trailing_whitespaces=true
 sp_cleanup.remove_trailing_whitespaces_all=true
 sp_cleanup.remove_trailing_whitespaces_ignore_empty=false
Index: applications/editors/josm/plugins/buildings_tools/src/buildings_tools/AddressDialog.java
===================================================================
--- applications/editors/josm/plugins/buildings_tools/src/buildings_tools/AddressDialog.java	(revision 24240)
+++ applications/editors/josm/plugins/buildings_tools/src/buildings_tools/AddressDialog.java	(revision 24243)
@@ -4,21 +4,12 @@
 
 import java.awt.Choice;
-import java.awt.Component;
-import java.awt.GridBagLayout;
-import java.awt.Insets;
 import java.text.NumberFormat;
 import java.text.ParseException;
 
 import javax.swing.JTextField;
-import javax.swing.JLabel;
-import javax.swing.JPanel;
-
-import org.openstreetmap.josm.Main;
-import org.openstreetmap.josm.gui.ExtendedDialog;
-import org.openstreetmap.josm.tools.GBC;
 
 @SuppressWarnings("serial")
-public class AddressDialog extends ExtendedDialog {
-    private static String lhousenum,lstreetname;
+public class AddressDialog extends MyDialog {
+    private static String lhousenum, lstreetname;
     private static boolean inc = true;
     private JTextField housenum = new JTextField();
@@ -26,22 +17,9 @@
     private Choice cincdec = new Choice();
 
-    private JPanel panel = new JPanel(new GridBagLayout());
-    private void addLabelled(String str, Component c) {
-        JLabel label = new JLabel(str);
-        panel.add(label, GBC.std());
-        label.setLabelFor(c);
-        panel.add(c, GBC.eol().fill(GBC.HORIZONTAL));
-    }
+    public AddressDialog() {
+        super(tr("Building address"));
 
-    public AddressDialog() {
-        super(Main.parent, tr("Building address"),
-                new String[] { tr("OK"), tr("Cancel") },
-                true);
-
-        contentInsets = new Insets(15,15,5,15);
-        setButtonIcons(new String[] {"ok.png", "cancel.png" });
-
-        addLabelled(tr("House number:"),housenum);
-        addLabelled(tr("Street Name:"),streetname);
+        addLabelled(tr("House number:"), housenum);
+        addLabelled(tr("Street Name:"), streetname);
         housenum.setText(nextHouseNum());
         streetname.setText(lstreetname);
@@ -49,17 +27,20 @@
         cincdec.add(tr("Increment"));
         cincdec.add(tr("Decrement"));
-        cincdec.select(inc?0:1);
+        cincdec.select(inc ? 0 : 1);
         addLabelled(tr("Numbers:"), cincdec);
 
         setContent(panel);
         setupDialog();
-        setVisible(true);
     }
 
     private static String nextHouseNum() {
-        if (lhousenum==null) return "";
+        if (lhousenum == null)
+            return "";
         try {
             Integer num = NumberFormat.getInstance().parse(lhousenum).intValue();
-            if (inc) num=num+2; else num = num-2;
+            if (inc)
+                num = num + 2;
+            else
+                num = num - 2;
             return num.toString();
         } catch (ParseException e) {
@@ -67,4 +48,5 @@
         }
     }
+
     public void saveValues() {
         lhousenum = housenum.getText();
@@ -72,7 +54,9 @@
         inc = cincdec.getSelectedIndex() == 0;
     }
+
     public String getHouseNum() {
         return housenum.getText();
     }
+
     public String getStreetName() {
         return streetname.getText();
Index: applications/editors/josm/plugins/buildings_tools/src/buildings_tools/AdvancedSettingsDialog.java
===================================================================
--- applications/editors/josm/plugins/buildings_tools/src/buildings_tools/AdvancedSettingsDialog.java	(revision 24240)
+++ applications/editors/josm/plugins/buildings_tools/src/buildings_tools/AdvancedSettingsDialog.java	(revision 24243)
@@ -3,32 +3,22 @@
 import static org.openstreetmap.josm.tools.I18n.tr;
 
-import java.awt.GridBagLayout;
-import java.awt.Insets;
 import java.util.Map.Entry;
 
 import javax.swing.JCheckBox;
 import javax.swing.JLabel;
-import javax.swing.JPanel;
 
-import org.openstreetmap.josm.Main;
-import org.openstreetmap.josm.gui.ExtendedDialog;
 import org.openstreetmap.josm.gui.tagging.TagEditorModel;
 import org.openstreetmap.josm.gui.tagging.TagEditorPanel;
 import org.openstreetmap.josm.tools.GBC;
 
-public class AdvancedSettingsDialog extends ExtendedDialog {
-    private TagEditorModel tagsModel = new TagEditorModel();
+public class AdvancedSettingsDialog extends MyDialog {
+    private final TagEditorModel tagsModel = new TagEditorModel();
 
-    private JCheckBox cBigMode = new JCheckBox(tr("Big buildings mode"));
-    private JCheckBox cSoftCur = new JCheckBox(tr("Rotate crosshair"));
+    private final JCheckBox cBigMode = new JCheckBox(tr("Big buildings mode"));
+    private final JCheckBox cSoftCur = new JCheckBox(tr("Rotate crosshair"));
 
     public AdvancedSettingsDialog() {
-        super(Main.parent, tr("Advanced settings"),
-                new String[] { tr("OK"), tr("Cancel") },
-                true);
-        contentInsets = new Insets(15, 15, 5, 15);
-        setButtonIcons(new String[] { "ok.png", "cancel.png" });
+        super(tr("Advanced settings"));
 
-        final JPanel panel = new JPanel(new GridBagLayout());
         panel.add(new JLabel(tr("Buildings tags:")), GBC.eol().fill(GBC.HORIZONTAL));
 
@@ -44,8 +34,6 @@
         cSoftCur.setSelected(ToolSettings.isSoftCursor());
 
-        setContent(panel);
-
         setupDialog();
-        setVisible(true);
+        showDialog();
     }
 
Index: applications/editors/josm/plugins/buildings_tools/src/buildings_tools/BuildingSizeDialog.java
===================================================================
--- applications/editors/josm/plugins/buildings_tools/src/buildings_tools/BuildingSizeDialog.java	(revision 24240)
+++ applications/editors/josm/plugins/buildings_tools/src/buildings_tools/BuildingSizeDialog.java	(revision 24243)
@@ -3,7 +3,4 @@
 import static org.openstreetmap.josm.tools.I18n.tr;
 
-import java.awt.Component;
-import java.awt.GridBagLayout;
-import java.awt.Insets;
 import java.awt.event.ActionEvent;
 import java.awt.event.ActionListener;
@@ -14,13 +11,9 @@
 import javax.swing.JFormattedTextField;
 import javax.swing.JCheckBox;
-import javax.swing.JLabel;
-import javax.swing.JPanel;
 
-import org.openstreetmap.josm.Main;
-import org.openstreetmap.josm.gui.ExtendedDialog;
 import org.openstreetmap.josm.tools.GBC;
 
 @SuppressWarnings("serial")
-public class BuildingSizeDialog extends ExtendedDialog {
+public class BuildingSizeDialog extends MyDialog {
     private JFormattedTextField twidth = new JFormattedTextField(NumberFormat.getInstance());
     private JFormattedTextField tlenstep = new JFormattedTextField(NumberFormat.getInstance());
@@ -28,21 +21,9 @@
     private JCheckBox cAutoSelect = new JCheckBox(tr("Auto-select building"));
 
-    static void addLabelled(JPanel panel, String str, Component c) {
-        JLabel label = new JLabel(str);
-        panel.add(label, GBC.std());
-        label.setLabelFor(c);
-        panel.add(c, GBC.eol().fill(GBC.HORIZONTAL));
-    }
+    public BuildingSizeDialog() {
+        super(tr("Set buildings size"));
 
-    public BuildingSizeDialog() {
-        super(Main.parent, tr("Set buildings size"),
-                new String[] { tr("OK"), tr("Cancel") },
-                true);
-        contentInsets = new Insets(15, 15, 5, 15);
-        setButtonIcons(new String[] { "ok.png", "cancel.png" });
-
-        final JPanel panel = new JPanel(new GridBagLayout());
-        addLabelled(panel, tr("Buildings width:"), twidth);
-        addLabelled(panel, tr("Length step:"), tlenstep);
+        addLabelled(tr("Buildings width:"), twidth);
+        addLabelled(tr("Length step:"), tlenstep);
         panel.add(caddr, GBC.eol().fill(GBC.HORIZONTAL));
         panel.add(cAutoSelect, GBC.eol().fill(GBC.HORIZONTAL));
@@ -65,7 +46,6 @@
         panel.add(bAdv, GBC.eol().insets(0, 5, 0, 0).anchor(GBC.EAST));
 
-        setContent(panel);
         setupDialog();
-        setVisible(true);
+        showDialog();
     }
 
Index: applications/editors/josm/plugins/buildings_tools/src/buildings_tools/BuildingsToolsPlugin.java
===================================================================
--- applications/editors/josm/plugins/buildings_tools/src/buildings_tools/BuildingsToolsPlugin.java	(revision 24240)
+++ applications/editors/josm/plugins/buildings_tools/src/buildings_tools/BuildingsToolsPlugin.java	(revision 24243)
@@ -17,4 +17,5 @@
         return proj.latlon2eastNorth(p);
     }
+
     public static LatLon eastNorth2latlon(EastNorth p) {
         return proj.eastNorth2latlon(p);
@@ -26,6 +27,8 @@
         MainMenu.add(Main.main.menu.editMenu, new BuildingSizeAction());
     }
-    @Override public void mapFrameInitialized(MapFrame oldFrame, MapFrame newFrame) {
-        if (oldFrame==null && newFrame!=null) {
+
+    @Override
+    public void mapFrameInitialized(MapFrame oldFrame, MapFrame newFrame) {
+        if (oldFrame == null && newFrame != null) {
             Main.map.addMapMode(new IconToggleButton(new DrawBuildingAction(Main.map)));
         }
Index: applications/editors/josm/plugins/buildings_tools/src/buildings_tools/DrawBuildingAction.java
===================================================================
--- applications/editors/josm/plugins/buildings_tools/src/buildings_tools/DrawBuildingAction.java	(revision 24240)
+++ applications/editors/josm/plugins/buildings_tools/src/buildings_tools/DrawBuildingAction.java	(revision 24243)
@@ -54,9 +54,10 @@
     private Mode nextMode = Mode.None;
 
-    private Color selectedColor;
+    private final Color selectedColor;
     private Point drawStartPos;
     private Point mousePos;
     private boolean isCtrlDown;
     private boolean isShiftDown;
+    private boolean isAltDown;
 
     Building building = new Building();
@@ -96,4 +97,5 @@
             // We invoke this to prevent strange things from happening
             EventQueue.invokeLater(new Runnable() {
+                @Override
                 public void run() {
                     // Don't change cursor when mode has changed already
@@ -108,17 +110,19 @@
     }
 
-    private static void showAddrDialog(Way w) {
+    private void showAddrDialog(Way w) {
         AddressDialog dlg = new AddressDialog();
-        int answer = dlg.getValue();
-        if (answer == 1) {
-            dlg.saveValues();
-            String tmp;
-            tmp = dlg.getHouseNum();
-            if (tmp != null && tmp != "")
-                w.put("addr:housenumber", tmp);
-            tmp = dlg.getStreetName();
-            if (tmp != null && tmp != "")
-                w.put("addr:street", tmp);
-        }
+        if (!isAltDown) {
+            dlg.showDialog();
+            if (dlg.getValue() != 1)
+                return;
+        }
+        dlg.saveValues();
+        String tmp;
+        tmp = dlg.getHouseNum();
+        if (tmp != null && tmp != "")
+            w.put("addr:housenumber", tmp);
+        tmp = dlg.getStreetName();
+        if (tmp != null && tmp != "")
+            w.put("addr:street", tmp);
     }
 
@@ -169,4 +173,5 @@
     }
 
+    @Override
     public void eventDispatched(AWTEvent arg0) {
         if (!(arg0 instanceof KeyEvent))
@@ -184,4 +189,5 @@
                 Main.map.mapView.repaint();
         }
+        isAltDown = (modifiers & KeyEvent.ALT_DOWN_MASK) != 0;
 
         if (ev.getKeyCode() == KeyEvent.VK_ESCAPE && ev.getID() == KeyEvent.KEY_PRESSED) {
@@ -239,4 +245,5 @@
             isCtrlDown = e.isControlDown();
             isShiftDown = e.isShiftDown();
+            isAltDown = e.isAltDown();
         }
         if (mode == Mode.None) {
@@ -255,4 +262,5 @@
     }
 
+    @Override
     public void paint(Graphics2D g, MapView mv, Bounds bbox) {
         if (mode == Mode.None)
@@ -453,4 +461,5 @@
     }
 
+    @Override
     public void selectionChanged(Collection<? extends OsmPrimitive> newSelection) {
         updateSnap(newSelection);
Index: applications/editors/josm/plugins/buildings_tools/src/buildings_tools/MyDialog.java
===================================================================
--- applications/editors/josm/plugins/buildings_tools/src/buildings_tools/MyDialog.java	(revision 24243)
+++ applications/editors/josm/plugins/buildings_tools/src/buildings_tools/MyDialog.java	(revision 24243)
@@ -0,0 +1,37 @@
+package buildings_tools;
+
+import static org.openstreetmap.josm.tools.I18n.tr;
+
+import java.awt.Component;
+import java.awt.GridBagLayout;
+import java.awt.Insets;
+
+import javax.swing.JLabel;
+import javax.swing.JPanel;
+
+import org.openstreetmap.josm.Main;
+import org.openstreetmap.josm.gui.ExtendedDialog;
+import org.openstreetmap.josm.tools.GBC;
+
+public class MyDialog extends ExtendedDialog {
+    private static final String[] buttonTexts = new String[] { tr("OK"), tr("Cancel") };
+    private static final String[] buttonIcons = new String[] { "ok.png", "cancel.png" };
+
+    protected JPanel panel = new JPanel(new GridBagLayout());
+
+    protected void addLabelled(String str, Component c) {
+        JLabel label = new JLabel(str);
+        panel.add(label, GBC.std());
+        label.setLabelFor(c);
+        panel.add(c, GBC.eol().fill(GBC.HORIZONTAL));
+    }
+
+    public MyDialog(String title) {
+        super(Main.parent, title, buttonTexts, true);
+        contentInsets = new Insets(15, 15, 5, 15);
+        setButtonIcons(buttonIcons);
+
+        setContent(panel);
+        setDefaultButton(1);
+    }
+}
