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. |
exportAsDragpublic FurnitureCatalogTransferHandler(ContentManager contentManager, FurnitureCatalogController catalogController, FurnitureController furnitureController)
public int getSourceActions(javax.swing.JComponent source)
COPY.getSourceActions in class javax.swing.TransferHandlerpublic 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.TransferHandlernull.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.TransferHandlerpublic boolean canImport(javax.swing.JComponent destination,
java.awt.datatransfer.DataFlavor[] flavors)
true if flavors contains
DataFlavor.javaFileListFlavor flavor.canImport in class javax.swing.TransferHandlerpublic 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