public static class PasteTagsAction.TagPaster extends Object
Modifier and Type | Field and Description |
---|---|
private List<Tag> |
commands |
private Collection<PrimitiveData> |
source |
private Collection<OsmPrimitive> |
target |
Constructor and Description |
---|
TagPaster(Collection<PrimitiveData> source,
Collection<OsmPrimitive> target) |
Modifier and Type | Method and Description |
---|---|
protected void |
buildChangeCommand(Collection<? extends OsmPrimitive> selection,
TagCollection tc) |
protected boolean |
canPasteFromHeterogeneousSourceWithoutConflict(Collection<OsmPrimitive> targets)
Replies true if this a heterogeneous source can be pasted without conflict to targets
|
List<Tag> |
execute() |
protected <T extends PrimitiveData> |
getSourcePrimitivesByType(OsmPrimitiveType type)
Replies all primitives of type
type in the current selection. |
protected Map<OsmPrimitiveType,Integer> |
getSourceStatistics() |
protected <T extends OsmPrimitive> |
getSourceTagsByType(OsmPrimitiveType type)
Replies the collection of tags for all primitives of type
type in the current
selection |
protected Map<OsmPrimitiveType,Integer> |
getTargetStatistics() |
protected <T extends OsmPrimitive> |
hasSourceTagsByType(OsmPrimitiveType type)
Replies true if there is at least one tag in the current selection for primitives of
type
type |
protected <T extends OsmPrimitive> |
hasTargetPrimitives(Class<T> type)
Replies true if there is at least one primitive of type
type
is in the target collection |
protected boolean |
isHeteogeneousSource()
Replies true if the source for tag pasting is heterogeneous, i.e. if it doesn't consist of
OsmPrimitive s of exactly one type |
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.pasteBuffer s selection consisting
of one type of OsmPrimitive s only). |
private final Collection<PrimitiveData> source
private final Collection<OsmPrimitive> target
public TagPaster(Collection<PrimitiveData> source, Collection<OsmPrimitive> target)
protected boolean isHeteogeneousSource()
OsmPrimitive
s of exactly one typeprotected <T extends PrimitiveData> Collection<? extends PrimitiveData> getSourcePrimitivesByType(OsmPrimitiveType type)
type
in the current selection.T
- type
- the typetype
in the current selection.protected <T extends OsmPrimitive> TagCollection getSourceTagsByType(OsmPrimitiveType type)
type
in the current
selectionT
- type
- the typetype
in the current
selectionprotected <T extends OsmPrimitive> boolean hasSourceTagsByType(OsmPrimitiveType type)
type
T
- type
- the typetype
protected void buildChangeCommand(Collection<? extends OsmPrimitive> selection, TagCollection tc)
protected Map<OsmPrimitiveType,Integer> getSourceStatistics()
protected Map<OsmPrimitiveType,Integer> getTargetStatistics()
protected void pasteFromHomogeneousSource()
Main.pasteBuffer
s selection consisting
of one type of OsmPrimitive
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.protected <T extends OsmPrimitive> boolean hasTargetPrimitives(Class<T> type)
type
is in the target collectionT
- type
- the type to look fortype
in the collection
selection
protected boolean canPasteFromHeterogeneousSourceWithoutConflict(Collection<OsmPrimitive> targets)
targets
- the collection of target primitivesprotected void pasteFromHeterogeneousSource()