Changeset 31653 in osm for applications/editors/josm
- Timestamp:
- 2015-10-19T20:48:07+02:00 (9 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
applications/editors/josm/plugins/utilsplugin2/src/org/openstreetmap/josm/plugins/utilsplugin2/actions/TagBufferAction.java
r31026 r31653 5 5 import java.util.*; 6 6 import java.awt.event.KeyEvent; 7 import org.openstreetmap.josm.tools.Predicate; 7 8 import org.openstreetmap.josm.tools.Shortcut; 8 9 import java.awt.event.ActionEvent; 9 10 import org.openstreetmap.josm.actions.JosmAction; 10 11 import org.openstreetmap.josm.data.osm.OsmPrimitive; 12 import org.openstreetmap.josm.tools.Utils; 11 13 import static org.openstreetmap.josm.tools.I18n.tr; 12 14 … … 18 20 public class TagBufferAction extends JosmAction { 19 21 private static final String TITLE = tr("Copy tags from previous selection"); 22 private static final Predicate<OsmPrimitive> IS_TAGGED_PREDICATE = new Predicate<OsmPrimitive>() { 23 @Override 24 public boolean evaluate(OsmPrimitive object) { 25 return object.isTagged(); 26 } 27 }; 20 28 private Map<String, String> tags = new HashMap<>(); 21 29 private Map<String, String> currentTags = new HashMap<>(); … … 94 102 private void rememberSelectionTags() { 95 103 // Fix #8350 - only care about tagged objects 96 Collection<OsmPrimitive> selectedTaggedObjects = new ArrayList<>(getCurrentDataSet().getSelected()); 97 for (Iterator<OsmPrimitive> it = selectedTaggedObjects.iterator(); it.hasNext(); ) { 98 if (!it.next().isTagged()) { 99 it.remove(); 100 } 101 } 104 final Collection<OsmPrimitive> selectedTaggedObjects = Utils.filter(getCurrentDataSet().getSelected(), IS_TAGGED_PREDICATE); 102 105 if( !selectedTaggedObjects.isEmpty() ) { 103 106 currentTags.clear();
Note:
See TracChangeset
for help on using the changeset viewer.