Changeset 7921 in josm for trunk/src/org
- Timestamp:
 - 2015-01-03T15:37:32+01:00 (11 years ago)
 - Location:
 - trunk/src/org/openstreetmap/josm
 - Files:
 - 
      
- 2 edited
 
- 
          
  actions/SelectByInternalPointAction.java (modified) (4 diffs)
 - 
          
  gui/SelectionManager.java (modified) (1 diff)
 
 
Legend:
- Unmodified
 - Added
 - Removed
 
- 
      
trunk/src/org/openstreetmap/josm/actions/SelectByInternalPointAction.java
r7828 r7921 5 5 import java.util.ArrayList; 6 6 import java.util.Collection; 7 import java.util.Collections; 7 8 import java.util.TreeMap; 8 9 … … 10 11 import org.openstreetmap.josm.data.coor.EastNorth; 11 12 import org.openstreetmap.josm.data.osm.BBox; 13 import org.openstreetmap.josm.data.osm.DataSet; 12 14 import org.openstreetmap.josm.data.osm.Node; 13 15 import org.openstreetmap.josm.data.osm.OsmPrimitive; … … 30 32 */ 31 33 public static Collection<OsmPrimitive> getSurroundingObjects(EastNorth internalPoint) { 34 final DataSet ds = getCurrentDataSet(); 35 if (ds == null) { 36 return Collections.emptySet(); 37 } 32 38 final Node n = new Node(internalPoint); 33 39 final TreeMap<Double, OsmPrimitive> found = new TreeMap<>(); 34 for (Way w : getCurrentDataSet().getWays()) {40 for (Way w : ds.getWays()) { 35 41 if (w.isUsable() && w.isClosed()) { 36 42 if (Geometry.nodeInsidePolygon(n, w.getNodes())) { … … 39 45 } 40 46 } 41 for (Relation r : getCurrentDataSet().getRelations()) {47 for (Relation r : ds.getRelations()) { 42 48 if (r.isUsable() && r.isMultipolygon()) { 43 49 if (Geometry.isNodeInsideMultiPolygon(n, r, null)) {  - 
      
trunk/src/org/openstreetmap/josm/gui/SelectionManager.java
r7146 r7921 151 151 @Override 152 152 public void mousePressed(MouseEvent e) { 153 if (e.getButton() == MouseEvent.BUTTON1 && e.getClickCount() > 1) { 153 if (e.getButton() == MouseEvent.BUTTON1 && e.getClickCount() > 1 && Main.main.getCurrentDataSet() != null) { 154 154 SelectByInternalPointAction.performSelection(Main.map.mapView.getEastNorth(e.getX(), e.getY()), 155 155 (e.getModifiersEx() & MouseEvent.SHIFT_DOWN_MASK) > 0,  
  Note:
 See   TracChangeset
 for help on using the changeset viewer.
  