com.jgraph.pad.factory
Class JGraphpadLibraryPane.LibraryGraphTransferHandler
java.lang.Object
javax.swing.TransferHandler
org.jgraph.graph.GraphTransferHandler
com.jgraph.pad.factory.JGraphpadLibraryPane.LibraryGraphTransferHandler
- All Implemented Interfaces:
- Serializable
- Enclosing class:
- JGraphpadLibraryPane
- public class JGraphpadLibraryPane.LibraryGraphTransferHandler
- extends org.jgraph.graph.GraphTransferHandler
Utility class to implement autoboxing and to set the JGraphpadLibraryPane.dragging
flag.
- See Also:
- Serialized Form
| Fields inherited from class org.jgraph.graph.GraphTransferHandler |
alwaysReceiveAsCopyAction, in, inCount, out |
|
Method Summary |
boolean |
canImport(JComponent component,
DataFlavor[] flavors)
Only allows importing data if the enclosing library is not read-only. |
protected Transferable |
createTransferable(JComponent c)
Overrides the parent method to set the dragging flag and replaces the
selection group with its children if autoboxing is turned on. |
protected void |
exportDone(JComponent source,
Transferable data,
int action)
Overrides the parent method to reset the dragging flag in order to
accept external drops. |
protected void |
handleExternalDrop(org.jgraph.JGraph graph,
Object[] cells,
Map nested,
org.jgraph.graph.ConnectionSet cs,
org.jgraph.graph.ParentMap pm,
double dx,
double dy)
Overrides the parent method to add a group to the dropped cells if
autoboxing is turned on. |
| Methods inherited from class org.jgraph.graph.GraphTransferHandler |
create, createTransferable, createTransferableForGraph, getInsertionOffset, getSourceActions, importData, importDataImpl, isAlwaysReceiveAsCopyAction, setAlwaysReceiveAsCopyAction |
| Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
JGraphpadLibraryPane.LibraryGraphTransferHandler
public JGraphpadLibraryPane.LibraryGraphTransferHandler()
canImport
public boolean canImport(JComponent component,
DataFlavor[] flavors)
- Only allows importing data if the enclosing library is not read-only.
createTransferable
protected Transferable createTransferable(JComponent c)
- Overrides the parent method to set the dragging flag and replaces the
selection group with its children if autoboxing is turned on.
- Parameters:
c - The component to perform the opeation in.
exportDone
protected void exportDone(JComponent source,
Transferable data,
int action)
- Overrides the parent method to reset the dragging flag in order to
accept external drops.
handleExternalDrop
protected void handleExternalDrop(org.jgraph.JGraph graph,
Object[] cells,
Map nested,
org.jgraph.graph.ConnectionSet cs,
org.jgraph.graph.ParentMap pm,
double dx,
double dy)
- Overrides the parent method to add a group to the dropped cells if
autoboxing is turned on.
- Parameters:
graph - The graph to perform the operation in.cells - The cells to be inserted into the library.nested - The attributes to be assigned to the cells.cs - The connections to be established between the cells.pm - The parent map that describes the parent-child relations.dx - The x-offset to translate the cells with.dy - The y-offset to translate the cells with.
Copyright (C) 2005 JGraph.com. All rights reserved.