Package org.openstreetmap.josm.data.osm

Examples of org.openstreetmap.josm.data.osm.Tag


     *
     * @return a tag representing the current resolution. Null, if this resolution is not resolved yet
     */
    public Tag getResolution() {
        switch(type) {
        case KEEP_ALL: return new Tag(getKey(), tags.getJoinedValues(getKey()));
        case KEEP_ONE: return new Tag(getKey(),value);
        case KEEP_NONE: return new Tag(getKey(), "");
        case UNDECIDED: return null;
        }
        return null;
    }
View Full Code Here


            return false;
        }

        @Override
        public void addCommands(List<Tag> changedTags) {
            changedTags.add(new Tag(key, value));
        }
View Full Code Here

                LAST_VALUES.put(key, v);
            }
            if (v.equals(originalValue) || (originalValue == null && v.length() == 0))
                return;

            changedTags.add(new Tag(key, v));
        }
View Full Code Here

        @Override public void addCommands(List<Tag> changedTags) {
            // if the user hasn't changed anything, don't create a command.
            if (check.getState() == initialState && !def) return;

            // otherwise change things according to the selected value.
            changedTags.add(new Tag(key,
                    check.getState() == QuadStateCheckBox.State.SELECTED ? value_on :
                        check.getState() == QuadStateCheckBox.State.NOT_SELECTED ? value_off :
                            null));
        }
View Full Code Here

                return;

            if (!"false".equals(use_last_as_default)) {
                LAST_VALUES.put(key, value);
            }
            changedTags.add(new Tag(key, value));
        }
View Full Code Here

    @SuppressWarnings("unchecked")
    public Tag getSelectedProperty() {
        int row = tagTable.getSelectedRow();
        if (row == -1) return null;
        TreeMap<String, Integer> map = (TreeMap<String, Integer>) tagData.getValueAt(row, 1);
        return new Tag(
                tagData.getValueAt(row, 0).toString(),
                map.size() > 1 ? "" : map.keySet().iterator().next());
    }
View Full Code Here

        }

        @Override
        protected Collection<String> getString(OsmPrimitive p, String key) {
            String v = p.get(key);
            return v == null ? null : Collections.singleton(new Tag(key, v).toString());
        }
View Full Code Here

        @Override
        protected Collection<String> getString(OsmPrimitive p, String key) {
            List<String> r = new LinkedList<>();
            for (Entry<String, String> kv : p.getKeys().entrySet()) {
                r.add(new Tag(kv.getKey(), kv.getValue()).toString());
            }
            return r;
        }
View Full Code Here

        Map<OsmPrimitive, List<TagCorrection>> tagCorrectionsMap = new HashMap<>();

        List<TagCorrection> tagCorrections = new ArrayList<>();
        for (String key : way.keySet()) {
            String value = way.get(key);
            Tag newTag = TagSwitcher.apply(key, value);
            String newKey = newTag.getKey();
            String newValue = newTag.getValue();

            boolean needsCorrection = !key.equals(newKey);
            if (way.get(newKey) != null && way.get(newKey).equals(newValue)) {
                needsCorrection = false;
            }
View Full Code Here

                    if (!value.equals(newValue)) {
                        break;
                    }
                }
            }
            return new Tag(newKey, newValue);
        }
View Full Code Here

TOP

Related Classes of org.openstreetmap.josm.data.osm.Tag

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.