Changeset 11385 in josm for trunk/src/org/openstreetmap/josm/actions
- Timestamp:
- 2016-12-13T01:57:37+01:00 (7 years ago)
- Location:
- trunk/src/org/openstreetmap/josm/actions
- Files:
-
- 7 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/org/openstreetmap/josm/actions/MergeLayerAction.java
r11290 r11385 49 49 if (sourceLayer != null && !sourceLayer.equals(targetLayer)) { 50 50 if (sourceLayer instanceof OsmDataLayer && targetLayer instanceof OsmDataLayer 51 && ((OsmDataLayer) sourceLayer).isUploadDiscouraged() != ((OsmDataLayer) targetLayer).isUploadDiscouraged() ) {52 if (Boolean.TRUE.equals(GuiHelper.runInEDTAndWaitAndReturn(() ->51 && ((OsmDataLayer) sourceLayer).isUploadDiscouraged() != ((OsmDataLayer) targetLayer).isUploadDiscouraged() 52 && Boolean.TRUE.equals(GuiHelper.runInEDTAndWaitAndReturn(() -> 53 53 warnMergingUploadDiscouragedLayers(sourceLayer, targetLayer)))) { 54 break; 55 } 54 break; 56 55 } 57 56 targetLayer.mergeFrom(sourceLayer); -
trunk/src/org/openstreetmap/josm/actions/SimplifyWayAction.java
r11118 r11385 194 194 } 195 195 196 if ((newNodes.size() > 3) && (newNodes.get(0) == newNodes.get(newNodes.size() - 1))) { 197 // Closed way, check if the first node could also be simplified ... 198 if (!isRequiredNode(w, newNodes.get(0))) { 199 final List<Node> l1 = Arrays.asList(newNodes.get(newNodes.size() - 2), newNodes.get(0), newNodes.get(1)); 200 final List<Node> l2 = new ArrayList<>(3); 201 buildSimplifiedNodeList(l1, 0, 2, threshold, l2); 202 if (!l2.contains(newNodes.get(0))) { 203 newNodes.remove(0); 204 newNodes.set(newNodes.size() - 1, newNodes.get(0)); // close the way 205 } 196 // Closed way, check if the first node could also be simplified ... 197 if (newNodes.size() > 3 && newNodes.get(0) == newNodes.get(newNodes.size() - 1) && !isRequiredNode(w, newNodes.get(0))) { 198 final List<Node> l1 = Arrays.asList(newNodes.get(newNodes.size() - 2), newNodes.get(0), newNodes.get(1)); 199 final List<Node> l2 = new ArrayList<>(3); 200 buildSimplifiedNodeList(l1, 0, 2, threshold, l2); 201 if (!l2.contains(newNodes.get(0))) { 202 newNodes.remove(0); 203 newNodes.set(newNodes.size() - 1, newNodes.get(0)); // close the way 206 204 } 207 205 } -
trunk/src/org/openstreetmap/josm/actions/UploadAction.java
r10446 r11385 187 187 */ 188 188 public static boolean checkPreUploadConditions(AbstractModifiableLayer layer, APIDataSet apiData) { 189 if (layer.isUploadDiscouraged()) { 190 if (warnUploadDiscouraged(layer)) { 191 return false; 192 } 189 if (layer.isUploadDiscouraged() && warnUploadDiscouraged(layer)) { 190 return false; 193 191 } 194 192 if (layer instanceof OsmDataLayer) { -
trunk/src/org/openstreetmap/josm/actions/UploadSelectionAction.java
r11109 r11385 91 91 if (!isEnabled()) 92 92 return; 93 if (editLayer.isUploadDiscouraged()) { 94 if (UploadAction.warnUploadDiscouraged(editLayer)) { 95 return; 96 } 93 if (editLayer.isUploadDiscouraged() && UploadAction.warnUploadDiscouraged(editLayer)) { 94 return; 97 95 } 98 96 Collection<OsmPrimitive> modifiedCandidates = getModifiedPrimitives(editLayer.data.getAllSelected()); -
trunk/src/org/openstreetmap/josm/actions/mapmode/ParallelWays.java
r10247 r11385 75 75 for (int i = 0; i < sortedNodesPath.size(); i++) { 76 76 Node n = sortedNodesPath.get(i); 77 if (i < sortedNodesPath.size()-1) { 78 if (sortedNodesPath.get(i+1).getCoor().equals(n.getCoor())) { 79 removedNodes.add(n); 80 for (Way w : ways) { 81 w.removeNode(n); 82 } 83 continue; 77 if (i < sortedNodesPath.size()-1 && sortedNodesPath.get(i+1).getCoor().equals(n.getCoor())) { 78 removedNodes.add(n); 79 for (Way w : ways) { 80 w.removeNode(n); 84 81 } 82 continue; 85 83 } 86 84 if (!removedNodes.contains(n)) { -
trunk/src/org/openstreetmap/josm/actions/mapmode/SelectAction.java
r10827 r11385 253 253 254 254 virtualManager.clear(); 255 if (mode == Mode.MOVE) { 256 if (!dragInProgress() && virtualManager.activateVirtualNodeNearPoint(e.getPoint())) { 257 DataSet ds = getLayerManager().getEditDataSet(); 258 if (ds != null && drawTargetHighlight) { 259 ds.setHighlightedVirtualNodes(virtualManager.virtualWays); 260 } 261 mv.setNewCursor(SelectActionCursor.virtual_node.cursor(), this); 262 // don't highlight anything else if a virtual node will be 263 return repaintIfRequired(newHighlights); 264 } 255 if (mode == Mode.MOVE && !dragInProgress() && virtualManager.activateVirtualNodeNearPoint(e.getPoint())) { 256 DataSet ds = getLayerManager().getEditDataSet(); 257 if (ds != null && drawTargetHighlight) { 258 ds.setHighlightedVirtualNodes(virtualManager.virtualWays); 259 } 260 mv.setNewCursor(SelectActionCursor.virtual_node.cursor(), this); 261 // don't highlight anything else if a virtual node will be 262 return repaintIfRequired(newHighlights); 265 263 } 266 264 -
trunk/src/org/openstreetmap/josm/actions/search/SearchCompiler.java
r11288 r11385 849 849 case ANY_VALUE_REGEXP: 850 850 case EXACT_REGEXP: 851 for (String key: osm.keySet()) { 852 if (keyPattern.matcher(key).matches()) { 853 if (mode == Mode.ANY_VALUE_REGEXP 854 || valuePattern.matcher(osm.get(key)).matches()) 855 return true; 856 } 851 for (String k : osm.keySet()) { 852 if (keyPattern.matcher(k).matches() 853 && (mode == Mode.ANY_VALUE_REGEXP || valuePattern.matcher(osm.get(k)).matches())) 854 return true; 857 855 } 858 856 return false;
Note:
See TracChangeset
for help on using the changeset viewer.