Class PrimitiveTransferData
java.lang.Object
org.openstreetmap.josm.gui.datatransfer.data.PrimitiveTransferData
- All Implemented Interfaces:
Serializable
A list of primitives that are transferred. The list allows you to implicitly add primitives.
It distinguishes between primitives that were directly added and implicitly added ones.
- Since:
- 10604
- See Also:
-
Nested Class Summary
Nested ClassesModifier and TypeClassDescriptionprivate static final classprivate static interface -
Field Summary
FieldsModifier and TypeFieldDescriptionstatic final DataFlavorThe data flavor used to represent this class.private final ArrayList<PrimitiveData>private final ArrayList<PrimitiveData>private static final long -
Constructor Summary
ConstructorsModifierConstructorDescriptionprivatePrimitiveTransferData(Collection<? extends OsmPrimitive> primitives, PrimitiveTransferData.ReferenceGetter referencedGetter) Create the new transfer data. -
Method Summary
Modifier and TypeMethodDescriptiongetAll()Gets a List of all primitives added to this set.Compute the center of all nodes.static PrimitiveTransferDatagetData(Collection<? extends OsmPrimitive> primitives) Creates a newPrimitiveTransferDataobject that only contains the primitives.static PrimitiveTransferDatagetDataWithReferences(Collection<? extends OsmPrimitive> primitives) Creates a newPrimitiveTransferDataobject that contains the primitives and all references.Gets all primitives directly added.Gets all primitives that were added because they were referenced.booleanTests whether this set contains any primitives that have invalid data.
-
Field Details
-
serialVersionUID
- See Also:
-
DATA_FLAVOR
The data flavor used to represent this class. -
direct
-
referenced
-
-
Constructor Details
-
PrimitiveTransferData
private PrimitiveTransferData(Collection<? extends OsmPrimitive> primitives, PrimitiveTransferData.ReferenceGetter referencedGetter) Create the new transfer data.- Parameters:
primitives- The primitives to transferreferencedGetter- A function that allows to get the primitives referenced by the primitives variable. It will be queried recursively.
-
-
Method Details
-
getDirectlyAdded
Gets all primitives directly added.- Returns:
- The primitives
-
getReferenced
Gets all primitives that were added because they were referenced.- Returns:
- The primitives
-
getAll
Gets a List of all primitives added to this set.- Returns:
- That list.
-
getData
Creates a newPrimitiveTransferDataobject that only contains the primitives.- Parameters:
primitives- The primitives to contain.- Returns:
- That set.
-
getDataWithReferences
public static PrimitiveTransferData getDataWithReferences(Collection<? extends OsmPrimitive> primitives) Creates a newPrimitiveTransferDataobject that contains the primitives and all references.- Parameters:
primitives- The primitives to contain.- Returns:
- That set.
-
getCenter
Compute the center of all nodes.- Returns:
- The center or null if this buffer has no location.
-
hasIncompleteData
Tests whether this set contains any primitives that have invalid data.- Returns:
trueif invalid data is contained in this set.
-