Class OsmTransferHandler
java.lang.Object
javax.swing.TransferHandler
org.openstreetmap.josm.gui.datatransfer.AbstractStackTransferHandler
org.openstreetmap.josm.gui.datatransfer.OsmTransferHandler
- All Implemented Interfaces:
Serializable
This transfer handler provides the ability to transfer OSM data. It allows you to receive files, primitives or tags.
- Since:
- 10604
- See Also:
-
Nested Class Summary
Nested classes/interfaces inherited from class javax.swing.TransferHandler
TransferHandler.DropLocation, TransferHandler.TransferSupport -
Field Summary
FieldsFields inherited from class javax.swing.TransferHandler
COPY, COPY_OR_MOVE, LINK, MOVE, NONE -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionprotected Collection<AbstractOsmDataPaster>private booleanimportTags(TransferHandler.TransferSupport support, Collection<? extends OsmPrimitive> primitives) booleanCheck if any primitive data or any other supported data is available in the clipboard.voidpasteOn(OsmDataLayer editLayer, EastNorth mPosition) Paste the current clipboard current at the given positionvoidpasteOn(OsmDataLayer editLayer, EastNorth mPosition, Transferable transferable) Paste the given clipboard current at the given positionvoidpasteTags(Collection<? extends OsmPrimitive> primitives) Paste the given tags on the primitives.Methods inherited from class org.openstreetmap.josm.gui.datatransfer.AbstractStackTransferHandler
canImport, getSourceActions, importData, importDataMethods inherited from class javax.swing.TransferHandler
canImport, createTransferable, exportAsDrag, exportDone, exportToClipboard, getCopyAction, getCutAction, getDragImage, getDragImageOffset, getPasteAction, getVisualRepresentation, importData, setDragImage, setDragImageOffset
-
Field Details
-
SUPPORTED
-
-
Constructor Details
-
OsmTransferHandler
public OsmTransferHandler()
-
-
Method Details
-
getSupportedPasters
- Specified by:
getSupportedPastersin classAbstractStackTransferHandler
-
importTags
private boolean importTags(TransferHandler.TransferSupport support, Collection<? extends OsmPrimitive> primitives) -
pasteOn
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
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
Paste the given tags on the primitives.- Parameters:
primitives- The primitives to paste on.
-
isDataAvailable
Check if any primitive data or any other supported data is available in the clipboard.- Returns:
trueif any flavor is supported.
-