csheets.ui.sheet
Class CellTransferable

java.lang.Object
  extended by csheets.ui.sheet.CellTransferable
All Implemented Interfaces:
ClipboardOwner, Transferable

public class CellTransferable
extends Object
implements Transferable, ClipboardOwner

A transferable for transferring a range of cells. Cells are transferred either as objects locally within the Java VM, or exported as strings.

Author:
Einar Pehrson

Field Summary
static DataFlavor LOCAL_CELL_FLAVOR
          The data flavor for local transfer of cells
static DataFlavor SERIAL_CELL_FLAVOR
          The data flavor for serialized transfer of cells
 
Constructor Summary
CellTransferable(Cell[][] cells)
          Creates a new cell transferable.
 
Method Summary
 Object getTransferData(DataFlavor flavor)
           
 DataFlavor[] getTransferDataFlavors()
           
 boolean isDataFlavorSupported(DataFlavor flavor)
           
 void lostOwnership(Clipboard clipboard, Transferable contents)
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

LOCAL_CELL_FLAVOR

public static final DataFlavor LOCAL_CELL_FLAVOR
The data flavor for local transfer of cells


SERIAL_CELL_FLAVOR

public static final DataFlavor SERIAL_CELL_FLAVOR
The data flavor for serialized transfer of cells

Constructor Detail

CellTransferable

public CellTransferable(Cell[][] cells)
Creates a new cell transferable.

Parameters:
cells - the cells to transfer
Method Detail

getTransferData

public Object getTransferData(DataFlavor flavor)
                       throws UnsupportedFlavorException
Specified by:
getTransferData in interface Transferable
Throws:
UnsupportedFlavorException

getTransferDataFlavors

public DataFlavor[] getTransferDataFlavors()
Specified by:
getTransferDataFlavors in interface Transferable

isDataFlavorSupported

public boolean isDataFlavorSupported(DataFlavor flavor)
Specified by:
isDataFlavorSupported in interface Transferable

lostOwnership

public void lostOwnership(Clipboard clipboard,
                          Transferable contents)
Specified by:
lostOwnership in interface ClipboardOwner