Index: applications/editors/josm/plugins/utilsplugin2/build.xml
===================================================================
--- applications/editors/josm/plugins/utilsplugin2/build.xml	(revision 30416)
+++ applications/editors/josm/plugins/utilsplugin2/build.xml	(revision 30419)
@@ -3,5 +3,5 @@
 
     <!-- enter the SVN commit message -->
-    <property name="commit.message" value="[josm_utilsplugin2]: search parents:/children:; multitagger: select, sync"/>
+    <property name="commit.message" value="[josm_utilsplugin2]: select boundary by double-click; multitagger table highlights"/>
     <!-- enter the *lowest* JOSM version this plugin is currently compatible with -->
     <property name="plugin.main.version" value="7001"/>
Index: applications/editors/josm/plugins/utilsplugin2/nbproject/project.xml
===================================================================
--- applications/editors/josm/plugins/utilsplugin2/nbproject/project.xml	(revision 30416)
+++ applications/editors/josm/plugins/utilsplugin2/nbproject/project.xml	(revision 30419)
@@ -22,4 +22,7 @@
                     <encoding>UTF-8</encoding>
                 </source-folder>
+                <build-file>
+                    <location>../../dist/utilsplugin2.jar</location>
+                </build-file>
             </folders>
             <ide-actions>
@@ -42,4 +45,9 @@
                 </action>
             </ide-actions>
+            <export>
+                <type>jar</type>
+                <location>../../dist/utilsplugin2.jar</location>
+                <build-target>dist</build-target>
+            </export>
             <view>
                 <items>
@@ -66,4 +74,5 @@
                 <package-root>src</package-root>
                 <classpath mode="compile">../../core/src;../../core/dist/josm-custom.jar</classpath>
+                <built-to>../../dist/utilsplugin2.jar</built-to>
                 <source-level>1.7</source-level>
             </compilation-unit>
Index: applications/editors/josm/plugins/utilsplugin2/src/org/openstreetmap/josm/plugins/utilsplugin2/UtilsPlugin2.java
===================================================================
--- applications/editors/josm/plugins/utilsplugin2/src/org/openstreetmap/josm/plugins/utilsplugin2/UtilsPlugin2.java	(revision 30416)
+++ applications/editors/josm/plugins/utilsplugin2/src/org/openstreetmap/josm/plugins/utilsplugin2/UtilsPlugin2.java	(revision 30419)
@@ -2,9 +2,14 @@
 package org.openstreetmap.josm.plugins.utilsplugin2;
 
+import java.awt.event.MouseAdapter;
+import java.awt.event.MouseEvent;
+import java.awt.event.MouseListener;
 import javax.swing.JMenu;
 import javax.swing.JMenuItem;
+import javax.swing.SwingUtilities;
 
 import org.openstreetmap.josm.Main;
 import org.openstreetmap.josm.actions.search.SearchCompiler;
+import org.openstreetmap.josm.data.coor.EastNorth;
 import org.openstreetmap.josm.gui.MainMenu;
 import org.openstreetmap.josm.gui.MapFrame;
@@ -127,5 +132,22 @@
         SearchCompiler.addMatchFactory(new UtilsSimpleMatchFactory());
     }
-
+    
+    MouseListener mouseListener = new MouseAdapter() {
+        @Override
+        public void mouseReleased(final MouseEvent e) {
+            if (e.getButton()==MouseEvent.BUTTON1 && 
+                    e.getClickCount() > 1 && Main.isDisplayingMapView() && Main.map.mapMode == Main.map.mapModeSelect &&
+                    (0 == (e.getModifiersEx() & (MouseEvent.ALT_DOWN_MASK + MouseEvent.CTRL_DOWN_MASK + MouseEvent.SHIFT_DOWN_MASK) ))) {
+                SwingUtilities.invokeLater(new Runnable() {
+                    @Override
+                    public void run() {
+                        EastNorth en = Main.map.mapView.getEastNorth(e.getX(), e.getY());
+                        SelectBoundaryAction.selectByInternalPoint(en);
+                    }
+                });
+            }
+        }
+    };
+    
     @Override
     public void mapFrameInitialized(MapFrame oldFrame, MapFrame newFrame) {
@@ -160,4 +182,7 @@
         drawArc.setEnabled(enabled);
         multiTag.setEnabled(enabled);
+        if (oldFrame!=null && oldFrame.mapView!=null) oldFrame.mapView.removeMouseListener(mouseListener);
+        if (newFrame!=null && newFrame.mapView!=null && Main.pref.getBoolean(UtilsPluginPreferences.PREF_DOUBLECLICK, true))
+            newFrame.mapView.addMouseListener(mouseListener);
     }
     
Index: applications/editors/josm/plugins/utilsplugin2/src/org/openstreetmap/josm/plugins/utilsplugin2/customurl/UtilsPluginPreferences.java
===================================================================
--- applications/editors/josm/plugins/utilsplugin2/src/org/openstreetmap/josm/plugins/utilsplugin2/customurl/UtilsPluginPreferences.java	(revision 30416)
+++ applications/editors/josm/plugins/utilsplugin2/src/org/openstreetmap/josm/plugins/utilsplugin2/customurl/UtilsPluginPreferences.java	(revision 30419)
@@ -14,8 +14,10 @@
 import org.openstreetmap.josm.gui.widgets.HtmlPanel;
 import java.awt.event.ActionListener;
+import javax.swing.JCheckBox;
 import javax.swing.JPanel;
 import javax.swing.ListSelectionModel;
 import javax.swing.event.TableModelListener;
 import javax.swing.table.DefaultTableModel;
+import org.openstreetmap.josm.Main;
 import org.openstreetmap.josm.gui.preferences.DefaultTabPreferenceSetting;
 import org.openstreetmap.josm.gui.preferences.PreferenceTabbedPane;
@@ -30,7 +32,9 @@
     JButton loadButton;
     JButton saveButton;
+    JCheckBox dblClick = new JCheckBox(tr("Double click selects object by its internal point"));
+    public static final String PREF_DOUBLECLICK = "utilsplugin2.doubleclick";
 
     public UtilsPluginPreferences() {
-        super("utils", tr("Utilsplugin2 settings [TESTING]"), tr("Here you can change some preferences of Utilsplugin2 functions"));
+        super("utils", tr("Utilsplugin2 settings"), tr("Here you can change some preferences of Utilsplugin2 functions"));
     }
 
@@ -38,6 +42,4 @@
     public void addGui(PreferenceTabbedPane gui) {
         JPanel all = new JPanel(new GridBagLayout());
-
-        // FIXME: get rid of hardcoded URLS
 
         URLList.getSelectedURL();
@@ -79,4 +81,7 @@
                 + " Your can manually load settings from file <b>customurl.txt</b> in JOSM folder"));
 
+        dblClick.setSelected(Main.pref.getBoolean(PREF_DOUBLECLICK, true));
+        all.add(dblClick, GBC.std().insets(5,10,0,0));
+        
         all.add(new JLabel(tr("Custom URL configuration")),GBC.std().insets(5,10,0,0));
         all.add(resetButton,GBC.std().insets(25,10,0,0));
@@ -129,5 +134,5 @@
         List<String> lst = readItemsFromTable();
         URLList.updateURLList(lst);
-
+        Main.pref.put(PREF_DOUBLECLICK, dblClick.isSelected());
         return false;
     }
Index: applications/editors/josm/plugins/utilsplugin2/src/org/openstreetmap/josm/plugins/utilsplugin2/multitagger/MultiTagDialog.java
===================================================================
--- applications/editors/josm/plugins/utilsplugin2/src/org/openstreetmap/josm/plugins/utilsplugin2/multitagger/MultiTagDialog.java	(revision 30416)
+++ applications/editors/josm/plugins/utilsplugin2/src/org/openstreetmap/josm/plugins/utilsplugin2/multitagger/MultiTagDialog.java	(revision 30419)
@@ -1,4 +1,5 @@
 package org.openstreetmap.josm.plugins.utilsplugin2.multitagger;
 
+import java.awt.Color;
 import java.awt.Component;
 import java.awt.Dimension;
@@ -20,4 +21,5 @@
 import static javax.swing.Action.SHORT_DESCRIPTION;
 import javax.swing.BoxLayout;
+import javax.swing.DefaultCellEditor;
 import javax.swing.JButton;
 import javax.swing.JComponent;
@@ -49,6 +51,8 @@
 import org.openstreetmap.josm.gui.widgets.PopupMenuLauncher;
 import org.openstreetmap.josm.tools.GBC;
+import static org.openstreetmap.josm.tools.I18n.marktr;
 import static org.openstreetmap.josm.tools.I18n.tr;
 import org.openstreetmap.josm.tools.ImageProvider;
+import org.openstreetmap.josm.tools.Shortcut;
 import org.openstreetmap.josm.tools.WindowGeometry;
 
@@ -116,4 +120,5 @@
         t.setColumnSelectionAllowed(true);
         t.setDefaultRenderer(OsmPrimitiveType.class, new PrimitiveTypeIconRenderer());
+        t.setDefaultRenderer(String.class, new ColoredRenderer());
         t.putClientProperty("terminateEditOnFocusLost", Boolean.TRUE);
         t.getSelectionModel().addListSelectionListener(selectionListener);
@@ -346,4 +351,27 @@
         initAutocompletion();
         tableModel.fireTableDataChanged();
-    }    
+    }
+    
+    class ColoredRenderer extends DefaultTableCellRenderer {
+        private final Color highlightColor = 
+                Main.pref.getColor( marktr("Multitag Background: highlight"),
+                        new Color(255,255,200));
+        @Override
+        public Component getTableCellRendererComponent(JTable table, Object value, boolean
+                isSelected, boolean hasFocus, int row, int column) {
+            int row1 = tbl.convertRowIndexToModel(row);
+            JLabel label = (JLabel) super.getTableCellRendererComponent(
+                table, value, isSelected, hasFocus, row, column);
+            if (tbl.isRowSelected(row1) && !tbl.isColumnSelected(column)) {
+                label.setBackground(highlightColor);
+            } else {
+                if (isSelected) {
+                    label.setBackground(Main.pref.getUIColor("Table.selectionBackground"));
+                } else {
+                    label.setBackground(Main.pref.getUIColor("Table.background"));
+                }
+            }
+            return label;
+        }
+    }
 }
Index: applications/editors/josm/plugins/utilsplugin2/src/org/openstreetmap/josm/plugins/utilsplugin2/selection/NodeWayUtils.java
===================================================================
--- applications/editors/josm/plugins/utilsplugin2/src/org/openstreetmap/josm/plugins/utilsplugin2/selection/NodeWayUtils.java	(revision 30416)
+++ applications/editors/josm/plugins/utilsplugin2/src/org/openstreetmap/josm/plugins/utilsplugin2/selection/NodeWayUtils.java	(revision 30419)
@@ -176,5 +176,5 @@
         int s = newNodes.size();
         for (Way w: initWays) {
-                newNodes.addAll(w.getNodes());
+            newNodes.addAll(w.getNodes());
         }
         return newNodes.size()-s;
@@ -182,28 +182,28 @@
 
     public static void addWaysIntersectingWaysRecursively
-            (Collection<Way> allWays, Collection<Way> initWays, Set<Way> newWays) {
-            Set<Way> foundWays = new HashSet<Way>();
-            foundWays.addAll(initWays);
-            newWays.addAll(initWays);
-            Set<Way> newFoundWays;
-
-            int level=0,c;
-            do {
-                 c=0;
-                 newFoundWays = new HashSet<Way>();
-                 for (Way w : foundWays){
-                      c+=addWaysIntersectingWay(allWays, w, newFoundWays,newWays);
-                 }
-                 foundWays = newFoundWays;
-                 newWays.addAll(newFoundWays);
-                 level++;
+        (Collection<Way> allWays, Collection<Way> initWays, Set<Way> newWays) {
+        Set<Way> foundWays = new HashSet<Way>();
+        foundWays.addAll(initWays);
+        newWays.addAll(initWays);
+        Set<Way> newFoundWays;
+
+        int level=0,c;
+        do {
+             c=0;
+             newFoundWays = new HashSet<Way>();
+             for (Way w : foundWays){
+                  c+=addWaysIntersectingWay(allWays, w, newFoundWays,newWays);
+             }
+             foundWays = newFoundWays;
+             newWays.addAll(newFoundWays);
+             level++;
 //                 System.out.printf("%d: %d ways added to selection intersectiong\n",level,c);
-                 if (c>maxWays1) {
-                        new Notification(
-                            tr("Too many ways are added: {0}!",c)
-                            ).setIcon(JOptionPane.WARNING_MESSAGE).show();  
-                       return;
-                 }
-            } while ( c >0 && level < maxLevel );
+             if (c>maxWays1) {
+                    new Notification(
+                        tr("Too many ways are added: {0}!",c)
+                        ).setIcon(JOptionPane.WARNING_MESSAGE).show();  
+                   return;
+             }
+        } while ( c >0 && level < maxLevel );
     }
 
@@ -211,24 +211,24 @@
             (Collection<Way> initWays, Set<Way> newWays)
     {
-            //long t = System.currentTimeMillis();
-            int level=0,c;
-            newWays.addAll(initWays);
-            do {
-                 c=0;
-                 Set<Way> foundWays = new HashSet<Way>();
-                 foundWays.addAll(newWays);
-                 for (Way w : foundWays){
-                      c+=addWaysConnectedToWay(w, newWays);
-                 }
-                 level++;
+        //long t = System.currentTimeMillis();
+        int level=0,c;
+        newWays.addAll(initWays);
+        do {
+             c=0;
+             Set<Way> foundWays = new HashSet<Way>();
+             foundWays.addAll(newWays);
+             for (Way w : foundWays){
+                  c+=addWaysConnectedToWay(w, newWays);
+             }
+             level++;
 //                 System.out.printf("%d: %d ways added to selection\n",level,c);
-                 if (c>maxWays) {
-                        new Notification(
-                            tr("Too many ways are added: {0}!",c)
-                            ).setIcon(JOptionPane.WARNING_MESSAGE).show();                       
-                       return;
-                 }
-            } while ( c >0 && level < maxLevel );
-           // System.out.println("time = "+(System.currentTimeMillis()-t)+" ways = "+newWays.size());
+             if (c>maxWays) {
+                new Notification(
+                    tr("Too many ways are added: {0}!",c)
+                    ).setIcon(JOptionPane.WARNING_MESSAGE).show();                       
+               return;
+             }
+        } while ( c >0 && level < maxLevel );
+       // System.out.println("time = "+(System.currentTimeMillis()-t)+" ways = "+newWays.size());
     }
 
@@ -344,19 +344,16 @@
         }
     }
-
+    
+    static boolean isPointInsideMultipolygon(EastNorth p, Relation rel) {
+        Set<Way> usedWays = OsmPrimitive.getFilteredSet(rel.getMemberPrimitives(), Way.class);
+        return isPointInsidePolygon(p, buildPointList(usedWays));
+    }
+            
     static void addAllInsideMultipolygon(DataSet data, Relation rel, Set<Way> newWays, Set<Node> newNodes) {
         if (!rel.isMultipolygon()) return;
         BBox box = rel.getBBox();
-        Set<Way> usedWays = OsmPrimitive.getFilteredSet(rel.getMemberPrimitives(), Way.class);
-        List<EastNorth> polyPoints = new ArrayList<EastNorth>(10000);
-        
-        for (Way way: usedWays) {
-            List<Node> polyNodes = way.getNodes();
-            // converts all points to EastNorth
-            for (Node n: polyNodes) polyPoints.add(n.getEastNorth());
-            polyPoints.add(null); // next segment indicator
-        }
-        
-        
+        Collection<Way> usedWays = rel.getMemberPrimitives(Way.class);
+        List<EastNorth> polyPoints = buildPointList(usedWays);
+       
         List<Node> searchNodes = data.searchNodes(box);
         Set<Node> newestNodes = new HashSet<Node>();
@@ -387,9 +384,5 @@
         if (!way.isClosed()) return;
         BBox box = way.getBBox();
-        List<Node> polyNodes = way.getNodes();
-        List<EastNorth> polyPoints = new ArrayList<EastNorth>(polyNodes.size()+5);
-        
-        // converts all points to EastNorth
-        for (Node n: polyNodes) polyPoints.add(n.getEastNorth());  
+        Iterable<EastNorth> polyPoints = getWayPoints(way);
         
         List<Node> searchNodes = data.searchNodes(box);
@@ -414,14 +407,16 @@
     }
     
-    public static boolean isPointInsidePolygon(EastNorth point, List<EastNorth> polygonPoints) {
+    public static boolean isPointInsidePolygon(EastNorth point, Iterable<EastNorth> polygonPoints) {
         int n = getRayIntersectionsCount(point, polygonPoints);
         if (n<0) return true; // we are near node or near edge
         return (n%2==1);
     }
-    
+
     /**
+     * @param point - point to start an OX-parallel  ray
+     * @param polygonPoints - poits forming bundary, use null to split unconnected segmants
      * @return 0 =  not inside polygon, 1 = strictly inside, 2 = near edge, 3 = near vertex
      */
-    public static int getRayIntersectionsCount(EastNorth point, List<EastNorth> polygonPoints) {
+    public static int getRayIntersectionsCount(EastNorth point, Iterable<EastNorth> polygonPoints) {
         if (point==null) return 0;
         EastNorth oldPoint = null;
@@ -512,5 +507,29 @@
     }
 
-
-
+    private static List<EastNorth> buildPointList(Iterable<Way> ways) {
+        ArrayList<EastNorth> points = new ArrayList<EastNorth>(1000);
+        for (Way way: ways) {
+            for (EastNorth en: getWayPoints(way)) points.add(en);
+            points.add(null); // next segment indicator
+        }
+        return points;
+    }
+    
+    public static Iterable<EastNorth> getWayPoints(final Way w) {
+        return new Iterable<EastNorth>() {
+            @Override
+            public Iterator<EastNorth> iterator() {
+                return new Iterator<EastNorth>() {
+                    int idx = 0;
+                    @Override public boolean hasNext() {
+                        return idx < w.getNodesCount();
+                    }
+                    @Override public EastNorth next() {
+                        return w.getNode(idx++).getEastNorth();
+                    }
+                };
+            }
+        };
+    }
+    
 }
Index: applications/editors/josm/plugins/utilsplugin2/src/org/openstreetmap/josm/plugins/utilsplugin2/selection/SelectBoundaryAction.java
===================================================================
--- applications/editors/josm/plugins/utilsplugin2/src/org/openstreetmap/josm/plugins/utilsplugin2/selection/SelectBoundaryAction.java	(revision 30416)
+++ applications/editors/josm/plugins/utilsplugin2/src/org/openstreetmap/josm/plugins/utilsplugin2/selection/SelectBoundaryAction.java	(revision 30419)
@@ -2,4 +2,5 @@
 package org.openstreetmap.josm.plugins.utilsplugin2.selection;
 
+import java.awt.Point;
 import static org.openstreetmap.josm.gui.help.HelpUtil.ht;
 import static org.openstreetmap.josm.tools.I18n.tr;
@@ -7,20 +8,23 @@
 import java.awt.event.ActionEvent;
 import java.awt.event.KeyEvent;
-import java.util.ArrayList;
-import java.util.Arrays;
 import java.util.Collection;
+import java.util.Collections;
 import java.util.HashSet;
-import java.util.List;
 import java.util.Set;
+import java.util.TreeMap;
 
 import javax.swing.JOptionPane;
+import org.openstreetmap.josm.Main;
 
-import org.openstreetmap.josm.Main;
 import org.openstreetmap.josm.actions.JosmAction;
+import org.openstreetmap.josm.data.coor.EastNorth;
+import org.openstreetmap.josm.data.osm.BBox;
 import org.openstreetmap.josm.data.osm.Node;
 import org.openstreetmap.josm.data.osm.OsmPrimitive;
 import org.openstreetmap.josm.data.osm.Relation;
+import org.openstreetmap.josm.data.osm.RelationMember;
 import org.openstreetmap.josm.data.osm.Way;
 import org.openstreetmap.josm.gui.Notification;
+import org.openstreetmap.josm.tools.Geometry;
 
 import org.openstreetmap.josm.tools.Shortcut;
@@ -39,5 +43,42 @@
         putValue("help", ht("/Action/SelectAreaBoundary"));
     }
-
+    
+    public static void selectByInternalPoint(EastNorth e) {
+        //Node n= new Node(e);
+        TreeMap<Double, OsmPrimitive> found = new TreeMap<>();
+        for (Way w: getCurrentDataSet().getWays()) {
+            if (w.isUsable() && w.isClosed() )  {
+                //if (Geometry.nodeInsidePolygon(n, w.getNodes())) {
+                if (NodeWayUtils.isPointInsidePolygon(e, NodeWayUtils.getWayPoints(w))) {
+                    found.put(Geometry.closedWayArea(w), w);
+                }
+            }
+        }
+        for (Relation r: getCurrentDataSet().getRelations()) {
+            if (r.isUsable() && r.isMultipolygon())  {
+                //if (Geometry.isNodeInsideMultiPolygon(n, r, null)) {
+                if (NodeWayUtils.isPointInsideMultipolygon(e, r)) {
+                    for (RelationMember m: r.getMembers()) {
+                        if (m.isWay() && m.getWay().isClosed()) {
+                            found.values().remove(m.getWay());
+                        }
+                    }
+                    // estimate multipolygon size by its bounding box area
+                    BBox bBox = r.getBBox();
+                    EastNorth en1 = Main.map.mapView.getProjection().latlon2eastNorth(bBox.getTopLeft());
+                    EastNorth en2 = Main.map.mapView.getProjection().latlon2eastNorth(bBox.getBottomRight());
+                    double s = Math.abs((en1.east()-en2.east())*(en1.north()-en2.north()));
+                    if (s==0) s=1e8;
+                    found.put(s, r);
+                }
+            }
+        }
+        
+        if (!found.isEmpty()) {
+            getCurrentDataSet().setSelected(Collections.singletonList(
+                found.firstEntry().getValue()));
+        }
+    }
+    
     @Override
     public void actionPerformed(ActionEvent e) {
@@ -45,5 +86,5 @@
         Set<Node> selectedNodes = OsmPrimitive.getFilteredSet(getCurrentDataSet().getSelected(), Node.class);
         
-        Set<Way> newWays = new HashSet<Way>();
+        Set<Way> newWays = new HashSet<>();
         
         Way w=null;
@@ -53,9 +94,13 @@
                 for (OsmPrimitive p : selectedNodes.iterator().next().getReferrers()) {
                     if (p instanceof Way && p.isSelectable()) {
-                        //if (w!=null) return; // ifwe want only one way
+                        //if (w!=null) return; // if we want only one way
                         w=(Way) p;
                         break;
                     }
                 }
+            } else {
+                Point p = Main.map.mapView.getMousePosition();
+                selectByInternalPoint(Main.map.mapView.getEastNorth(p.x, p.y));
+                return;
             }
         } else if (selectedWays.size()==1)  {
@@ -95,5 +140,6 @@
             setEnabled(false);
         } else {
-            updateEnabledState(getCurrentDataSet().getSelected());
+            setEnabled(true);
+           // updateEnabledState(getCurrentDataSet().getSelected());
         }
     }
@@ -102,8 +148,9 @@
     protected void updateEnabledState(Collection<? extends OsmPrimitive> selection) {
         if (selection == null) {
-            setEnabled(false);
+         //   setEnabled(false);
             return;
         }
-        setEnabled(!selection.isEmpty());
+        setEnabled(true);
+        //setEnabled(!selection.isEmpty());
     }
 }
