Class AbstractTagPaster
- java.lang.Object
-
- org.openstreetmap.josm.gui.datatransfer.importers.AbstractOsmDataPaster
-
- org.openstreetmap.josm.gui.datatransfer.importers.AbstractTagPaster
-
- Direct Known Subclasses:
PrimitiveTagTransferPaster
,TagTransferPaster
,TextTagPaster
public abstract class AbstractTagPaster extends AbstractOsmDataPaster
This transfer support allows us to transfer tags to the selected primitives- Since:
- 10604
-
-
Field Summary
-
Fields inherited from class org.openstreetmap.josm.gui.datatransfer.importers.AbstractOsmDataPaster
df
-
-
Constructor Summary
Constructors Constructor Description AbstractTagPaster(DataFlavor df)
-
Method Summary
All Methods Static Methods Instance Methods Abstract Methods Concrete Methods Modifier and Type Method Description protected static void
commitCommands(Collection<? extends OsmPrimitive> selection, List<Command> commands)
Create and execute SequenceCommand with descriptive titleprotected abstract Map<String,String>
getTags(TransferHandler.TransferSupport support)
Gets the tags that should be pasted.boolean
importData(TransferHandler.TransferSupport support, OsmDataLayer layer, EastNorth pasteAt)
Attempts to import the given transfer data.boolean
importTagsOn(TransferHandler.TransferSupport support, Collection<? extends OsmPrimitive> selection)
Imports only if this import changes the tags only.-
Methods inherited from class org.openstreetmap.josm.gui.datatransfer.importers.AbstractOsmDataPaster
supports, supports
-
-
-
-
Constructor Detail
-
AbstractTagPaster
AbstractTagPaster(DataFlavor df)
-
-
Method Detail
-
importData
public boolean importData(TransferHandler.TransferSupport support, OsmDataLayer layer, EastNorth pasteAt) throws UnsupportedFlavorException, IOException
Description copied from class:AbstractOsmDataPaster
Attempts to import the given transfer data.- Specified by:
importData
in classAbstractOsmDataPaster
- Parameters:
support
- The transfer support to import from.layer
- The layer to paste at. May be null.pasteAt
- The position to paste at.- Returns:
true
if the import was successful.- Throws:
UnsupportedFlavorException
- if the requested data flavor is not supportedIOException
- if an I/O error occurs
-
importTagsOn
public boolean importTagsOn(TransferHandler.TransferSupport support, Collection<? extends OsmPrimitive> selection) throws UnsupportedFlavorException, IOException
Description copied from class:AbstractOsmDataPaster
Imports only if this import changes the tags only. Does nothing if more than tags would be changed.- Overrides:
importTagsOn
in classAbstractOsmDataPaster
- Parameters:
support
- The supportselection
- The primitives to apply on.- Returns:
true
if an import was done.- Throws:
UnsupportedFlavorException
- if the requested data flavor is not supportedIOException
- if an I/O error occurs
-
commitCommands
protected static void commitCommands(Collection<? extends OsmPrimitive> selection, List<Command> commands)
Create and execute SequenceCommand with descriptive title- Parameters:
selection
- selected primitivescommands
- the commands to perform in a sequential command- Since:
- 10737
-
getTags
protected abstract Map<String,String> getTags(TransferHandler.TransferSupport support) throws UnsupportedFlavorException, IOException
Gets the tags that should be pasted.- Parameters:
support
- The TransferSupport to get the tags from.- Returns:
- The tags
- Throws:
UnsupportedFlavorException
- if the requested data flavor is not supportedIOException
- if an I/O error occurs
-
-