Class PrimitiveTagTransferPaster.TagPasteSupport
- java.lang.Object
-
- org.openstreetmap.josm.gui.datatransfer.importers.PrimitiveTagTransferPaster.TagPasteSupport
-
- Enclosing class:
- PrimitiveTagTransferPaster
private static class PrimitiveTagTransferPaster.TagPasteSupport extends Object
-
-
Field Summary
Fields Modifier and Type Field Description private PrimitiveTagTransferData
data
private Collection<? extends IPrimitive>
selection
private List<Tag>
tags
-
Constructor Summary
Constructors Constructor Description TagPasteSupport(PrimitiveTagTransferData data, Collection<? extends IPrimitive> selection)
Constructs a newTagPasteSupport
.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description protected void
buildTags(TagCollection tc)
protected boolean
canPasteFromHeterogeneousSourceWithoutConflict()
Replies true if this a heterogeneous source can be pasted without conflict to targetsList<Tag>
execute()
Performs the paste operation.protected Map<OsmPrimitiveType,Integer>
getTargetStatistics()
protected boolean
hasTargetPrimitives(OsmPrimitiveType type)
Replies true if there is at least one primitive of typetype
is in the target collectionprotected void
pasteFromHeterogeneousSource()
Pastes the tags in the current selection of the paste buffer to a set of target primitives.protected void
pasteFromHomogeneousSource()
Pastes the tags from a homogeneous source (the selection consisting of one type ofOsmPrimitive
s only).String
toString()
-
-
-
Field Detail
-
data
private final PrimitiveTagTransferData data
-
selection
private final Collection<? extends IPrimitive> selection
-
-
Constructor Detail
-
TagPasteSupport
TagPasteSupport(PrimitiveTagTransferData data, Collection<? extends IPrimitive> selection)
Constructs a newTagPasteSupport
.- Parameters:
data
- source tags to pasteselection
- target primitives
-
-
Method Detail
-
pasteFromHomogeneousSource
protected void pasteFromHomogeneousSource()
Pastes the tags from a homogeneous source (the selection consisting of one type ofOsmPrimitive
s only). Tags from a homogeneous source can be pasted to a heterogeneous target. All target primitives, regardless of their type, receive the same tags.
-
canPasteFromHeterogeneousSourceWithoutConflict
protected boolean canPasteFromHeterogeneousSourceWithoutConflict()
Replies true if this a heterogeneous source can be pasted without conflict to targets- Returns:
- true if this a heterogeneous source can be pasted without conflicts to targets
-
pasteFromHeterogeneousSource
protected void pasteFromHeterogeneousSource()
Pastes the tags in the current selection of the paste buffer to a set of target primitives.
-
getTargetStatistics
protected Map<OsmPrimitiveType,Integer> getTargetStatistics()
-
hasTargetPrimitives
protected boolean hasTargetPrimitives(OsmPrimitiveType type)
Replies true if there is at least one primitive of typetype
is in the target collection- Parameters:
type
- the type to look for- Returns:
- true if there is at least one primitive of type
type
in the collectionselection
-
buildTags
protected void buildTags(TagCollection tc)
-
-