Package org.opensourcephysics.tools
Class FileDropHandler
java.lang.Object
javax.swing.TransferHandler
org.opensourcephysics.tools.FileDropHandler
- All Implemented Interfaces:
Serializable
A simple TransferHandler for handling via Drag&Drop.
Create an instance using new FileDropHandler(FileImporter)
where FileImporter is likely a JFrame that implements FileDropHandler.FileImporter
- Author:
- Bob Hanson and Douglas Brown
- See Also:
-
Nested Class Summary
Nested ClassesNested classes/interfaces inherited from class javax.swing.TransferHandler
TransferHandler.DropLocation, TransferHandler.TransferSupport
-
Field Summary
Fields inherited from class javax.swing.TransferHandler
COPY, COPY_OR_MOVE, LINK, MOVE, NONE
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionboolean
canImport
(TransferHandler.TransferSupport support) Check to see that we can import this file.boolean
Methods inherited from class javax.swing.TransferHandler
canImport, createTransferable, exportAsDrag, exportDone, exportToClipboard, getCopyAction, getCutAction, getDragImage, getDragImageOffset, getPasteAction, getSourceActions, getVisualRepresentation, importData, setDragImage, setDragImageOffset
-
Constructor Details
-
FileDropHandler
Constructor.- Parameters:
frame
- the TFrame that will be the drop target
-
-
Method Details
-
canImport
Check to see that we can import this file. It if is NOT a video-type file (mp4, jpg, etc) then set the drop action to COPY rather than MOVE.- Overrides:
canImport
in classTransferHandler
-
importData
- Overrides:
importData
in classTransferHandler
-