public static class PasteTagsAction.TagPaster extends java.lang.Object
| Modifier and Type | Field and Description |
|---|---|
private java.util.Collection<PrimitiveData> |
source |
private java.util.List<Tag> |
tags |
private java.util.Collection<OsmPrimitive> |
target |
| Constructor and Description |
|---|
TagPaster(java.util.Collection<PrimitiveData> source,
java.util.Collection<OsmPrimitive> target)
Constructs a new
TagPaster. |
| Modifier and Type | Method and Description |
|---|---|
protected void |
buildTags(TagCollection tc) |
protected boolean |
canPasteFromHeterogeneousSourceWithoutConflict()
Replies true if this a heterogeneous source can be pasted without conflict to targets
|
java.util.List<Tag> |
execute()
Performs the paste operation.
|
protected java.util.Collection<? extends PrimitiveData> |
getSourcePrimitivesByType(OsmPrimitiveType type)
Replies all primitives of type
type in the current selection. |
protected java.util.Map<OsmPrimitiveType,java.lang.Integer> |
getSourceStatistics() |
protected TagCollection |
getSourceTagsByType(OsmPrimitiveType type)
Replies the collection of tags for all primitives of type
type in the current
selection |
protected java.util.Map<OsmPrimitiveType,java.lang.Integer> |
getTargetStatistics() |
protected boolean |
hasSourceTagsByType(OsmPrimitiveType type)
Replies true if there is at least one tag in the current selection for primitives of
type
type |
protected boolean |
hasTargetPrimitives(java.lang.Class<? extends OsmPrimitive> type)
Replies true if there is at least one primitive of type
type
is in the target collection |
protected boolean |
isHeterogeneousSource()
Determines if the source for tag pasting is heterogeneous, i.e.
|
protected 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
Main.pasteBuffers selection consisting
of one type of OsmPrimitives only). |
private final java.util.Collection<PrimitiveData> source
private final java.util.Collection<OsmPrimitive> target
public TagPaster(java.util.Collection<PrimitiveData> source, java.util.Collection<OsmPrimitive> target)
TagPaster.source - source primitivestarget - target primitivesprotected boolean isHeterogeneousSource()
OsmPrimitives of exactly one typeprotected java.util.Collection<? extends PrimitiveData> getSourcePrimitivesByType(OsmPrimitiveType type)
type in the current selection.type - the typetype in the current selection.protected TagCollection getSourceTagsByType(OsmPrimitiveType type)
type in the current
selectiontype - the typetype in the current
selectionprotected boolean hasSourceTagsByType(OsmPrimitiveType type)
typetype - the typetypeprotected void buildTags(TagCollection tc)
protected java.util.Map<OsmPrimitiveType,java.lang.Integer> getSourceStatistics()
protected java.util.Map<OsmPrimitiveType,java.lang.Integer> getTargetStatistics()
protected void pasteFromHomogeneousSource()
Main.pasteBuffers selection consisting
of one type of OsmPrimitives only).
Tags from a homogeneous source can be pasted to a heterogeneous target. All target primitives,
regardless of their type, receive the same tags.protected boolean hasTargetPrimitives(java.lang.Class<? extends OsmPrimitive> type)
type
is in the target collectiontype - the type to look fortype in the collection
selectionprotected boolean canPasteFromHeterogeneousSourceWithoutConflict()
protected void pasteFromHeterogeneousSource()