public class FurnitureCatalogTransferHandler extends VisualTransferHandler
TransferHandler.DropLocation, TransferHandler.TransferSupport
COPY, COPY_OR_MOVE, LINK, MOVE, NONE
Constructor and Description |
---|
FurnitureCatalogTransferHandler(ContentManager contentManager,
FurnitureCatalogController catalogController,
FurnitureController furnitureController)
Creates a handler able to transfer catalog selected furniture.
|
Modifier and Type | Method and Description |
---|---|
boolean |
canImport(JComponent destination,
DataFlavor[] flavors)
Returns
true if flavors contains
DataFlavor.javaFileListFlavor flavor. |
protected Transferable |
createTransferable(JComponent source)
Returns a
transferable object
that contains a copy of the selected furniture in catalog. |
int |
getSourceActions(JComponent source)
Returns
COPY . |
Icon |
getVisualRepresentation(Transferable transferable)
Returns the icon of the piece of furniture of
transferable
for HOME_FLAVOR flavor if it contains
only one piece of furniture. |
boolean |
importData(JComponent destination,
Transferable transferable)
Add to catalog the furniture contained in
transferable . |
exportAsDrag
canImport, exportDone, exportToClipboard, getCopyAction, getCutAction, getDragImage, getDragImageOffset, getPasteAction, importData, setDragImage, setDragImageOffset
public FurnitureCatalogTransferHandler(ContentManager contentManager, FurnitureCatalogController catalogController, FurnitureController furnitureController)
public int getSourceActions(JComponent source)
COPY
.getSourceActions
in class TransferHandler
public Icon getVisualRepresentation(Transferable transferable)
transferable
for HOME_FLAVOR
flavor if it contains
only one piece of furniture.getVisualRepresentation
in class TransferHandler
null
.protected Transferable createTransferable(JComponent source)
transferable object
that contains a copy of the selected furniture in catalog.createTransferable
in class TransferHandler
public boolean canImport(JComponent destination, DataFlavor[] flavors)
true
if flavors contains
DataFlavor.javaFileListFlavor
flavor.canImport
in class TransferHandler
public boolean importData(JComponent destination, Transferable transferable)
transferable
.importData
in class TransferHandler
© Copyrights 2006-2017 Emmanuel PUYBARET / eTeks
Distributed under GNU General Public License