Ignore:
Timestamp:
2014-05-19T17:27:56+02:00 (10 years ago)
Author:
simon04
Message:

see #10037 - Add double-click selection mode - based on akks's implementation in utilsplugin2

This allows to select polygons/multipolygons by a double-click on an internal point.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/org/openstreetmap/josm/gui/SelectionManager.java

    r7005 r7144  
    1515import java.util.LinkedList;
    1616
     17import org.openstreetmap.josm.Main;
     18import org.openstreetmap.josm.actions.SelectByInternalAction;
    1719import org.openstreetmap.josm.data.osm.Node;
    1820import org.openstreetmap.josm.data.osm.OsmPrimitive;
     
    149151    @Override
    150152    public void mousePressed(MouseEvent e) {
    151         if (e.getButton() == MouseEvent.BUTTON1) {
     153        if (e.getButton() == MouseEvent.BUTTON1 && e.getClickCount() > 1) {
     154            SelectByInternalAction.performSelection(Main.map.mapView.getEastNorth(e.getX(), e.getY()),
     155                    (e.getModifiersEx() & MouseEvent.SHIFT_DOWN_MASK) > 0,
     156                    (e.getModifiersEx() & MouseEvent.CTRL_DOWN_MASK) > 0);
     157        } else if (e.getButton() == MouseEvent.BUTTON1) {
    152158            mousePosStart = mousePos = e.getPoint();
    153159
Note: See TracChangeset for help on using the changeset viewer.