Changeset 7389 in josm for trunk/src/org/openstreetmap
- Timestamp:
- 2014-08-13T23:07:06+02:00 (10 years ago)
- Location:
- trunk/src/org/openstreetmap/josm
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/org/openstreetmap/josm/actions/mapmode/SelectAction.java
r7218 r7389 233 233 private boolean giveUserFeedback(MouseEvent e, int modifiers) { 234 234 Collection<OsmPrimitive> c = asColl( 235 mv.getNearestNodeOrWay(e.getPoint(), OsmPrimitive.isSelectablePredicate, true));235 mv.getNearestNodeOrWay(e.getPoint(), mv.isSelectablePredicate, true)); 236 236 237 237 updateKeyModifiers(modifiers); … … 406 406 // primitives under cursor are stored in c collection 407 407 408 OsmPrimitive nearestPrimitive = mv.getNearestNodeOrWay(e.getPoint(), OsmPrimitive.isSelectablePredicate, true);408 OsmPrimitive nearestPrimitive = mv.getNearestNodeOrWay(e.getPoint(), mv.isSelectablePredicate, true); 409 409 410 410 determineMapMode(nearestPrimitive!=null); … … 687 687 Collection<OsmPrimitive> selection = getCurrentDataSet().getSelectedNodesAndWays(); 688 688 if (selection.isEmpty()) { // if nothing was selected to drag, just select nearest node/way to the cursor 689 OsmPrimitive nearestPrimitive = mv.getNearestNodeOrWay(mv.getPoint(startEN), OsmPrimitive.isSelectablePredicate, true);689 OsmPrimitive nearestPrimitive = mv.getNearestNodeOrWay(mv.getPoint(startEN), mv.isSelectablePredicate, true); 690 690 getCurrentDataSet().setSelected(nearestPrimitive); 691 691 } … … 858 858 Collection<Node> target = mv.getNearestNodes(p, 859 859 getCurrentDataSet().getSelectedNodes(), 860 OsmPrimitive.isSelectablePredicate);860 mv.isSelectablePredicate); 861 861 return target.isEmpty() ? null : target.iterator().next(); 862 862 } … … 964 964 if (waitForMouseUpParameter) { 965 965 // prefer a selected nearest node or way, if possible 966 osm = mv.getNearestNodeOrWay(p, OsmPrimitive.isSelectablePredicate, true);966 osm = mv.getNearestNodeOrWay(p, mv.isSelectablePredicate, true); 967 967 } 968 968 } else { 969 969 // Alt + left mouse button pressed: we need to build cycle list 970 cycleList = mv.getAllNearest(p, OsmPrimitive.isSelectablePredicate);970 cycleList = mv.getAllNearest(p, mv.isSelectablePredicate); 971 971 972 972 if (cycleList.size() > 1) { … … 1104 1104 1105 1105 Way w = null; 1106 for (WaySegment ws : mv.getNearestWaySegments(p, OsmPrimitive.isSelectablePredicate)) {1106 for (WaySegment ws : mv.getNearestWaySegments(p, mv.isSelectablePredicate)) { 1107 1107 w = ws.way; 1108 1108 -
trunk/src/org/openstreetmap/josm/gui/NavigatableComponent.java
r7135 r7389 48 48 import org.openstreetmap.josm.gui.download.DownloadDialog; 49 49 import org.openstreetmap.josm.gui.help.Helpful; 50 import org.openstreetmap.josm.gui.mappaint.MapPaintStyles; 50 51 import org.openstreetmap.josm.gui.preferences.projection.ProjectionPreference; 51 52 import org.openstreetmap.josm.tools.Predicate; … … 83 84 void systemOfMeasurementChanged(String oldSoM, String newSoM); 84 85 } 86 87 public Predicate<OsmPrimitive> isSelectablePredicate = new Predicate<OsmPrimitive>() { 88 @Override 89 public boolean evaluate(OsmPrimitive prim) { 90 if (!prim.isSelectable()) return false; 91 // if it isn't displayed on screen, you cannot click on it 92 return !MapPaintStyles.getStyles().get(prim, getDist100Pixel(), NavigatableComponent.this).isEmpty(); 93 } 94 }; 85 95 86 96 public static final IntegerProperty PROP_SNAP_DISTANCE = new IntegerProperty("mappaint.node.snap-distance", 10);
Note:
See TracChangeset
for help on using the changeset viewer.