public class FurnitureCatalogTransferHandler extends VisualTransferHandler
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(javax.swing.JComponent destination,
java.awt.datatransfer.DataFlavor[] flavors)
Returns
true if flavors contains
DataFlavor.javaFileListFlavor flavor. |
protected java.awt.datatransfer.Transferable |
createTransferable(javax.swing.JComponent source)
Returns a
transferable object
that contains a copy of the selected furniture in catalog. |
int |
getSourceActions(javax.swing.JComponent source)
Returns
COPY . |
javax.swing.Icon |
getVisualRepresentation(java.awt.datatransfer.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(javax.swing.JComponent destination,
java.awt.datatransfer.Transferable transferable)
Add to catalog the furniture contained in
transferable . |
exportAsDrag
public FurnitureCatalogTransferHandler(ContentManager contentManager, FurnitureCatalogController catalogController, FurnitureController furnitureController)
public int getSourceActions(javax.swing.JComponent source)
COPY
.getSourceActions
in class javax.swing.TransferHandler
public javax.swing.Icon getVisualRepresentation(java.awt.datatransfer.Transferable transferable)
transferable
for HOME_FLAVOR
flavor if it contains
only one piece of furniture.getVisualRepresentation
in class javax.swing.TransferHandler
null
.protected java.awt.datatransfer.Transferable createTransferable(javax.swing.JComponent source)
transferable object
that contains a copy of the selected furniture in catalog.createTransferable
in class javax.swing.TransferHandler
public boolean canImport(javax.swing.JComponent destination, java.awt.datatransfer.DataFlavor[] flavors)
true
if flavors contains
DataFlavor.javaFileListFlavor
flavor.canImport
in class javax.swing.TransferHandler
public boolean importData(javax.swing.JComponent destination, java.awt.datatransfer.Transferable transferable)
transferable
.importData
in class javax.swing.TransferHandler
© Copyright 2024 Space Mushrooms
Distributed under GNU General Public License