public class GraphTransferHandler extends TransferHandler
TransferHandler.DropLocation, TransferHandler.TransferSupport
Modifier and Type | Field and Description |
---|---|
protected boolean |
alwaysReceiveAsCopyAction
Controls if all inserts should be handled as external drops even if all
cells are already in the graph model.
|
protected Object |
in |
protected int |
inCount |
protected Object |
out |
COPY, COPY_OR_MOVE, LINK, MOVE, NONE
Constructor and Description |
---|
GraphTransferHandler() |
Modifier and Type | Method and Description |
---|---|
boolean |
canImport(JComponent comp,
DataFlavor[] flavors) |
protected GraphTransferable |
create(JGraph graph,
Object[] cells,
Map viewAttributes,
Rectangle2D bounds,
ConnectionSet cs,
ParentMap pm) |
protected Transferable |
createTransferable(JComponent c) |
protected Transferable |
createTransferable(JGraph graph,
Object[] cells) |
Transferable |
createTransferableForGraph(JGraph graph) |
protected void |
exportDone(JComponent comp,
Transferable data,
int action) |
protected Point2D |
getInsertionOffset(JGraph graph,
int inCount,
Rectangle2D bounds)
Hook method to determine offset of cells cloned via the clipboard
|
int |
getSourceActions(JComponent c) |
protected void |
handleExternalDrop(JGraph graph,
Object[] cells,
Map nested,
ConnectionSet cs,
ParentMap pm,
double dx,
double dy) |
boolean |
importData(JComponent comp,
Transferable t) |
protected boolean |
importDataImpl(JComponent comp,
Transferable t) |
boolean |
isAlwaysReceiveAsCopyAction() |
void |
setAlwaysReceiveAsCopyAction(boolean alwaysReceiveAsCopyAction) |
canImport, exportAsDrag, exportToClipboard, getCopyAction, getCutAction, getDragImage, getDragImageOffset, getPasteAction, getVisualRepresentation, importData, setDragImage, setDragImageOffset
protected boolean alwaysReceiveAsCopyAction
protected Object out
protected Object in
protected int inCount
public boolean canImport(JComponent comp, DataFlavor[] flavors)
canImport
in class TransferHandler
public Transferable createTransferableForGraph(JGraph graph)
protected Transferable createTransferable(JComponent c)
createTransferable
in class TransferHandler
protected Transferable createTransferable(JGraph graph, Object[] cells)
protected GraphTransferable create(JGraph graph, Object[] cells, Map viewAttributes, Rectangle2D bounds, ConnectionSet cs, ParentMap pm)
protected void exportDone(JComponent comp, Transferable data, int action)
exportDone
in class TransferHandler
public int getSourceActions(JComponent c)
getSourceActions
in class TransferHandler
public boolean importData(JComponent comp, Transferable t)
importData
in class TransferHandler
protected Point2D getInsertionOffset(JGraph graph, int inCount, Rectangle2D bounds)
graph
- the graph the insertion is occurring oninCount
- the number of time the insert has been appliedbounds
- the bounds of the transferred graphprotected void handleExternalDrop(JGraph graph, Object[] cells, Map nested, ConnectionSet cs, ParentMap pm, double dx, double dy)
protected boolean importDataImpl(JComponent comp, Transferable t)
public boolean isAlwaysReceiveAsCopyAction()
public void setAlwaysReceiveAsCopyAction(boolean alwaysReceiveAsCopyAction)
alwaysReceiveAsCopyAction
- The alwaysReceiveAsCopyAction to set.Copyright (C) 2001-2006 Gaudenz Alder. All rights reserved.