Class OsmTransferHandler
- java.lang.Object
-
- javax.swing.TransferHandler
-
- org.openstreetmap.josm.gui.datatransfer.AbstractStackTransferHandler
-
- org.openstreetmap.josm.gui.datatransfer.OsmTransferHandler
-
- All Implemented Interfaces:
Serializable
public class OsmTransferHandler extends AbstractStackTransferHandler
This transfer handler provides the ability to transfer OSM data. It allows you to receive files, primitives or tags.- Since:
- 10604
- See Also:
- Serialized Form
-
-
Nested Class Summary
-
Nested classes/interfaces inherited from class javax.swing.TransferHandler
TransferHandler.DropLocation, TransferHandler.TransferSupport
-
-
Field Summary
Fields Modifier and Type Field Description private static Collection<AbstractOsmDataPaster>
SUPPORTED
-
Fields inherited from class javax.swing.TransferHandler
COPY, COPY_OR_MOVE, LINK, MOVE, NONE
-
-
Constructor Summary
Constructors Constructor Description OsmTransferHandler()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description protected Collection<AbstractOsmDataPaster>
getSupportedPasters()
private boolean
importTags(TransferHandler.TransferSupport support, Collection<? extends OsmPrimitive> primitives)
boolean
isDataAvailable()
Check if any primitive data or any other supported data is available in the clipboard.void
pasteOn(OsmDataLayer editLayer, EastNorth mPosition)
Paste the current clipboard current at the given positionvoid
pasteOn(OsmDataLayer editLayer, EastNorth mPosition, Transferable transferable)
Paste the given clipboard current at the given positionvoid
pasteTags(Collection<? extends OsmPrimitive> primitives)
Paste the given tags on the primitives.-
Methods inherited from class org.openstreetmap.josm.gui.datatransfer.AbstractStackTransferHandler
canImport, getSourceActions, importData, importData
-
Methods inherited from class javax.swing.TransferHandler
canImport, createTransferable, exportAsDrag, exportDone, exportToClipboard, getCopyAction, getCutAction, getDragImage, getDragImageOffset, getPasteAction, getVisualRepresentation, importData, setDragImage, setDragImageOffset
-
-
-
-
Field Detail
-
SUPPORTED
private static final Collection<AbstractOsmDataPaster> SUPPORTED
-
-
Constructor Detail
-
OsmTransferHandler
public OsmTransferHandler()
-
-
Method Detail
-
getSupportedPasters
protected Collection<AbstractOsmDataPaster> getSupportedPasters()
- Specified by:
getSupportedPasters
in classAbstractStackTransferHandler
-
importTags
private boolean importTags(TransferHandler.TransferSupport support, Collection<? extends OsmPrimitive> primitives)
-
pasteOn
public void pasteOn(OsmDataLayer editLayer, EastNorth mPosition)
Paste the current clipboard current at the given position- Parameters:
editLayer
- The layer to paste on.mPosition
- The position to paste at. If it isnull
, the original position will be used.
-
pasteOn
public void pasteOn(OsmDataLayer editLayer, EastNorth mPosition, Transferable transferable)
Paste the given clipboard current at the given position- Parameters:
editLayer
- The layer to paste on.mPosition
- The position to paste at. If it isnull
, the original position will be used.transferable
- The transferable to use.
-
pasteTags
public void pasteTags(Collection<? extends OsmPrimitive> primitives)
Paste the given tags on the primitives.- Parameters:
primitives
- The primitives to paste on.
-
isDataAvailable
public boolean isDataAvailable()
Check if any primitive data or any other supported data is available in the clipboard.- Returns:
true
if any flavor is supported.
-
-