|
artoflife pre0.1.0-dev | |||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object | +--javax.swing.TransferHandler | +--org.artoflife.gui.population.PopulationViewTransferHandler
Handles transfer of Individuals from a
PopulationView
for
DnD and clipboard operations. Creates
PaintableIndividualTransferables only for
Individuals with a
org.artoflife.gp.paintable.PaintablePhenotype
.
Field Summary |
Fields inherited from class javax.swing.TransferHandler |
COPY, COPY_OR_MOVE, MOVE, NONE |
Constructor Summary | |
PopulationViewTransferHandler()
|
Method Summary | |
boolean |
canImport(javax.swing.JComponent comp,
java.awt.datatransfer.DataFlavor[] transferFlavors)
A PopulationView can import two flavors: PaintableIndividualTransferable.SERIALISED_INDIVIDUAL_FLAVOR PaintableIndividualTransferable.INDIVIDUAL_FILE_FLAVOR |
protected java.awt.datatransfer.Transferable |
createTransferable(javax.swing.JComponent c)
|
protected void |
exportDone(javax.swing.JComponent source,
java.awt.datatransfer.Transferable data,
int action)
After a drop has been completed (or an export done, which is overkill since this includes clipboard operations), clear the per-VM drag state held in PopulationView. |
int |
getSourceActions(javax.swing.JComponent c)
|
javax.swing.Icon |
getVisualRepresentation(java.awt.datatransfer.Transferable t)
|
boolean |
importData(javax.swing.JComponent comp,
java.awt.datatransfer.Transferable t)
Called by the default javax.swing.TransferHandler.DropHandler but we install a custom PopulationViewDropTargetListener that calls
importData(JComponent, Transferable, Point) instead,
so this method will fail if called (assertion failure). |
boolean |
importData(javax.swing.JComponent comp,
java.awt.datatransfer.Transferable t,
java.awt.Point location)
An alternative to the usual importData(JComponent, Transferable)
called by the default DropHandler, but not when
a PopulationView uses one of these TransferHandlers
to handle DnD. |
Methods inherited from class javax.swing.TransferHandler |
exportAsDrag, exportToClipboard, getCopyAction, getCutAction, getPasteAction |
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
public PopulationViewTransferHandler()
Method Detail |
public boolean canImport(javax.swing.JComponent comp, java.awt.datatransfer.DataFlavor[] transferFlavors)
canImport
in class javax.swing.TransferHandler
comp
- must be a PopulationView
, else assertion failureTransferHandler.canImport(JComponent, DataFlavor[])
protected java.awt.datatransfer.Transferable createTransferable(javax.swing.JComponent c)
createTransferable
in class javax.swing.TransferHandler
c
- must be a PopulationView
, else assertion failure
org.artoflife.gui.population.PaintableIndividualTransferable
for the currently
selected Individual which must not be nullTransferHandler.createTransferable(JComponent)
protected void exportDone(javax.swing.JComponent source, java.awt.datatransfer.Transferable data, int action)
exportDone
in class javax.swing.TransferHandler
TransferHandler.exportDone(JComponent, Transferable, int)
public int getSourceActions(javax.swing.JComponent c)
getSourceActions
in class javax.swing.TransferHandler
TransferHandler.getSourceActions(JComponent)
public javax.swing.Icon getVisualRepresentation(java.awt.datatransfer.Transferable t)
getVisualRepresentation
in class javax.swing.TransferHandler
TransferHandler.getVisualRepresentation(Transferable)
public boolean importData(javax.swing.JComponent comp, java.awt.datatransfer.Transferable t)
PopulationViewDropTargetListener
that calls
importData(JComponent, Transferable, Point)
instead,
so this method will fail if called (assertion failure).
importData
in class javax.swing.TransferHandler
public boolean importData(javax.swing.JComponent comp, java.awt.datatransfer.Transferable t, java.awt.Point location)
importData(JComponent, Transferable)
called by the default DropHandler, but not when
a PopulationView uses one of these TransferHandlers
to handle DnD.
Note that the INDIVIDUAL_FILE_FLAVOR handling accepts multiple files.
canImport(JComponent, DataFlavor[])
,
TransferHandler.importData(JComponent, Transferable)
|
artoflife pre0.1.0-dev | |||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |