Changeset 34782 in osm for applications/editors/josm/plugins/utilsplugin2
- Timestamp:
- 2018-12-15T17:55:04+01:00 (6 years ago)
- Location:
- applications/editors/josm/plugins/utilsplugin2/src/org/openstreetmap/josm/plugins/utilsplugin2/actions
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
applications/editors/josm/plugins/utilsplugin2/src/org/openstreetmap/josm/plugins/utilsplugin2/actions/SplitOnIntersectionsAction.java
r34780 r34782 41 41 public SplitOnIntersectionsAction() { 42 42 super(TITLE, "dumbutils/splitonintersections", TOOL_DESC, 43 Shortcut.registerShortcut("tools:splitonintersections", tr("Tool: {0}", TITLE), 44 KeyEvent.VK_P, Shortcut.ALT_CTRL_SHIFT),true);43 Shortcut.registerShortcut("tools:splitonintersections", tr("Tool: {0}", TITLE), KeyEvent.VK_P, Shortcut.ALT_CTRL_SHIFT), 44 true); 45 45 } 46 46 … … 88 88 } 89 89 90 91 92 93 94 90 if (splitWays.isEmpty()) { 91 new Notification(tr("The selection cannot be used for action ''{0}''", TOOL_DESC)) 92 .setIcon(JOptionPane.WARNING_MESSAGE).show(); 93 return; 94 } 95 95 96 96 // fix #16006: Don't generate SequenceCommand when ways are part of the same relation. 97 97 boolean createSequenceCommand = true; 98 98 Set<Relation> allWayRefs = new HashSet<>(); … … 103 103 } 104 104 for (Entry<Way, List<Node>> entry : splitWays.entrySet()) { 105 106 107 108 109 105 SplitWayCommand cmd = SplitWayCommand.split(entry.getKey(), entry.getValue(), selectedWays); 106 if (!createSequenceCommand) { 107 UndoRedoHandler.getInstance().add(cmd); 108 } 109 list.add(cmd); 110 110 } 111 111 … … 114 114 UndoRedoHandler.getInstance().add(list.size() == 1 ? list.get(0) : new SequenceCommand(TITLE, list)); 115 115 } else { 116 117 118 119 116 new Notification( 117 tr("Affected ways are members of the same relation. {0} actions were created for this split.", 118 list.size())).setIcon(JOptionPane.WARNING_MESSAGE).show(); 119 } 120 120 getLayerManager().getEditDataSet().clearSelection(); 121 121 } -
applications/editors/josm/plugins/utilsplugin2/src/org/openstreetmap/josm/plugins/utilsplugin2/actions/TagBufferAction.java
r34768 r34782 80 80 @Override 81 81 protected void updateEnabledState(Collection<? extends OsmPrimitive> selection) { 82 83 84 tagsToPaste = new TagCollection(oldTags);85 86 87 82 TagCollection oldTags = getCommonTags(selectionBuf); 83 if (!oldTags.isEmpty()) { 84 tagsToPaste = new TagCollection(oldTags); 85 } 86 selectionBuf.clear(); 87 selectionBuf.addAll(selection); 88 88 89 89 setEnabled(!selection.isEmpty() && !tagsToPaste.isEmpty()); … … 95 95 */ 96 96 private static TagCollection getCommonTags(Set<OsmPrimitive> selection) { 97 98 99 //// Fix #8350 - only care about tagged objects100 97 if (selection.isEmpty()) 98 return EmptyTags; 99 // Fix #8350 - only care about tagged objects 100 return TagCollection.commonToAllPrimitives(SubclassFilteredCollection.filter(selection, p -> p.isTagged())); 101 101 } 102 102 }
Note:
See TracChangeset
for help on using the changeset viewer.