org.jgraph.graph
Class GraphTransferHandler
java.lang.Object
javax.swing.TransferHandler
org.jgraph.graph.GraphTransferHandler
- All Implemented Interfaces:
- Serializable
- public class GraphTransferHandler
- extends TransferHandler
- See Also:
- Serialized Form
Method Summary |
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)
|
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
alwaysReceiveAsCopyAction
protected boolean alwaysReceiveAsCopyAction
- Controls if all inserts should be handled as external drops even if all
cells are already in the graph model. This is useful if the enclosing
component does not allow moving.
out
protected Object out
in
protected Object in
inCount
protected int inCount
GraphTransferHandler
public GraphTransferHandler()
canImport
public boolean canImport(JComponent comp,
DataFlavor[] flavors)
createTransferableForGraph
public Transferable createTransferableForGraph(JGraph graph)
createTransferable
protected Transferable createTransferable(JComponent c)
createTransferable
protected Transferable createTransferable(JGraph graph,
Object[] cells)
create
protected GraphTransferable create(JGraph graph,
Object[] cells,
Map viewAttributes,
Rectangle2D bounds,
ConnectionSet cs,
ParentMap pm)
exportDone
protected void exportDone(JComponent comp,
Transferable data,
int action)
getSourceActions
public int getSourceActions(JComponent c)
importData
public boolean importData(JComponent comp,
Transferable t)
getInsertionOffset
protected Point2D getInsertionOffset(JGraph graph,
int inCount,
Rectangle2D bounds)
- Hook method to determine offset of cells cloned via the clipboard
- Parameters:
graph
- the graph the insertion is occurring oninCount
- the number of time the insert has been appliedbounds
- the bounds of the transferred graph
- Returns:
- the offset from the cloned cell(s)
handleExternalDrop
protected void handleExternalDrop(JGraph graph,
Object[] cells,
Map nested,
ConnectionSet cs,
ParentMap pm,
double dx,
double dy)
importDataImpl
protected boolean importDataImpl(JComponent comp,
Transferable t)
isAlwaysReceiveAsCopyAction
public boolean isAlwaysReceiveAsCopyAction()
- Returns:
- Returns the alwaysReceiveAsCopyAction.
setAlwaysReceiveAsCopyAction
public void setAlwaysReceiveAsCopyAction(boolean alwaysReceiveAsCopyAction)
- Parameters:
alwaysReceiveAsCopyAction
- The alwaysReceiveAsCopyAction to set.
Copyright (C) 2001-2006 Gaudenz Alder. All rights reserved.