|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||
java.lang.Objectjavax.swing.TransferHandler
net.sf.freecol.client.gui.panel.DefaultTransferHandler
public final class DefaultTransferHandler
The transferhandler that is capable of creating ImageSelection objects. Those ImageSelection objects are Transferable. The DefaultTransferHandler should be attached to JPanels or custom JLabels.
| Field Summary | |
|---|---|
static java.lang.String |
COPYRIGHT
|
static java.awt.datatransfer.DataFlavor |
flavor
|
static java.lang.String |
LICENSE
|
static java.lang.String |
REVISION
|
| Fields inherited from class javax.swing.TransferHandler |
|---|
COPY, COPY_OR_MOVE, MOVE, NONE |
| Constructor Summary | |
|---|---|
DefaultTransferHandler(Canvas canvas,
FreeColPanel parentPanel)
The constructor to use. |
|
| Method Summary | |
|---|---|
boolean |
canImport(javax.swing.JComponent comp,
java.awt.datatransfer.DataFlavor[] flavor)
Returns 'true' if the given component can import a selection of the flavor that is indicated by the second parameter, 'false' otherwise. |
java.awt.datatransfer.Transferable |
createTransferable(javax.swing.JComponent comp)
Creates a Transferable (an ImageSelection to be precise) of the data that is represented by the given component and returns that object. |
void |
exportAsDrag(javax.swing.JComponent comp,
java.awt.event.InputEvent e,
int action)
|
int |
getSourceActions(javax.swing.JComponent comp)
Returns the action that can be done to an ImageSelection on the given component. |
boolean |
importData(javax.swing.JComponent comp,
java.awt.datatransfer.Transferable t)
Imports the data represented by the given Transferable into the given component. |
| Methods inherited from class javax.swing.TransferHandler |
|---|
exportDone, exportToClipboard, getCopyAction, getCutAction, getPasteAction, getVisualRepresentation |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Field Detail |
|---|
public static final java.lang.String COPYRIGHT
public static final java.lang.String LICENSE
public static final java.lang.String REVISION
public static final java.awt.datatransfer.DataFlavor flavor
| Constructor Detail |
|---|
public DefaultTransferHandler(Canvas canvas,
FreeColPanel parentPanel)
canvas - The Canvas.parentPanel - The layered pane that holds all kinds of information.| Method Detail |
|---|
public int getSourceActions(javax.swing.JComponent comp)
getSourceActions in class javax.swing.TransferHandler
public boolean canImport(javax.swing.JComponent comp,
java.awt.datatransfer.DataFlavor[] flavor)
canImport in class javax.swing.TransferHandlercomp - The component that needs to be checked.flavor - The flavor that needs to be checked for.
public java.awt.datatransfer.Transferable createTransferable(javax.swing.JComponent comp)
createTransferable in class javax.swing.TransferHandlercomp - The component to create a Transferable of.
public boolean importData(javax.swing.JComponent comp,
java.awt.datatransfer.Transferable t)
importData in class javax.swing.TransferHandlercomp - The component to import the data to.t - The Transferable that holds the data.
public void exportAsDrag(javax.swing.JComponent comp,
java.awt.event.InputEvent e,
int action)
exportAsDrag in class javax.swing.TransferHandler
|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||