JGraph
v3.3


org.jgraph.plaf.basic
Class BasicGraphUI.GraphTransferHandler

java.lang.Object
  |
  +--org.jgraph.plaf.basic.TransferHandler
        |
        +--org.jgraph.plaf.basic.BasicGraphUI.GraphTransferHandler
All Implemented Interfaces:
Serializable
Enclosing class:
BasicGraphUI

public class BasicGraphUI.GraphTransferHandler
extends TransferHandler

See Also:
Serialized Form

Inner classes inherited from class org.jgraph.plaf.basic.TransferHandler
TransferHandler.JAdapterComponent, TransferHandler.JDNDAdapter, TransferHandler.SwingDropTarget
 
Field Summary
protected  Object in
           
protected  int inCount
           
protected  Object out
           
 
Fields inherited from class org.jgraph.plaf.basic.TransferHandler
COPY, COPY_OR_MOVE, MOVE, NONE
 
Constructor Summary
BasicGraphUI.GraphTransferHandler()
           
 
Method Summary
 boolean canImport(JComponent comp, DataFlavor[] flavors)
          Indicates whether a component would accept an import of the given set of data flavors prior to actually attempting to import it.
protected  GraphTransferable create(JGraph graph, Object[] cells, Map viewAttributes, Rectangle2D bounds, ConnectionSet cs, ParentMap pm)
           
 Transferable createTransferable()
           
protected  Transferable createTransferable(JComponent c)
          Creates a Transferable to use as the source for a data transfer.
protected  void exportDone(JComponent comp, Transferable data, int action)
          Invoked after data has been exported.
 int getSourceActions(JComponent c)
          Returns the type of transfer actions supported by the source.
 boolean importData(JComponent comp, Transferable t)
          Causes a transfer to a component from a clipboard or a DND drop operation.
protected  boolean importDataImpl(JComponent comp, Transferable t)
           
 
Methods inherited from class org.jgraph.plaf.basic.TransferHandler
exportAsDrag, exportToClipboard, getCopyAction, getCutAction, getPasteAction, getVisualRepresentation
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

out

protected Object out

in

protected Object in

inCount

protected int inCount
Constructor Detail

BasicGraphUI.GraphTransferHandler

public BasicGraphUI.GraphTransferHandler()
Method Detail

canImport

public boolean canImport(JComponent comp,
                         DataFlavor[] flavors)
Description copied from class: TransferHandler
Indicates whether a component would accept an import of the given set of data flavors prior to actually attempting to import it.
Overrides:
canImport in class TransferHandler
Following copied from class: org.jgraph.plaf.basic.TransferHandler
Parameters:
comp - the component to receive the transfer; this argument is provided to enable sharing of TransferHandlers by multiple components
transferFlavors - the data formats available
Returns:
true if the data can be inserted into the component, false otherwise

createTransferable

public Transferable createTransferable()

createTransferable

protected final Transferable createTransferable(JComponent c)
Description copied from class: TransferHandler
Creates a Transferable to use as the source for a data transfer. Returns the representation of the data to be transferred, or null if the component's property is null
Overrides:
createTransferable in class TransferHandler
Following copied from class: org.jgraph.plaf.basic.TransferHandler
Parameters:
c - the component holding the data to be transferred; this argument is provided to enable sharing of TransferHandlers by multiple components
Returns:
the representation of the data to be transferred, or null if the property associated with c is null

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)
Description copied from class: TransferHandler
Invoked after data has been exported. This method should remove the data that was transferred if the action was MOVE.

This method is implemented to do nothing since MOVE is not a supported action of this implementation (getSourceActions does not include MOVE).

Overrides:
exportDone in class TransferHandler
Following copied from class: org.jgraph.plaf.basic.TransferHandler
Parameters:
source - the component that was the source of the data
data - The data that was transferred or possibly null if the action is NONE.
action - the actual action that was performed

getSourceActions

public int getSourceActions(JComponent c)
Description copied from class: TransferHandler
Returns the type of transfer actions supported by the source. Some models are not mutable, so a transfer operation of COPY only should be advertised in that case.
Overrides:
getSourceActions in class TransferHandler
Following copied from class: org.jgraph.plaf.basic.TransferHandler
Parameters:
c - the component holding the data to be transferred; this argument is provided to enable sharing of TransferHandlers by multiple components.
Returns:
COPY if the transfer property can be found, otherwise returns NONE; a return value of of NONE disables any transfers out of the component

importData

public boolean importData(JComponent comp,
                          Transferable t)
Description copied from class: TransferHandler
Causes a transfer to a component from a clipboard or a DND drop operation. The Transferable represents the data to be imported into the component.
Overrides:
importData in class TransferHandler
Following copied from class: org.jgraph.plaf.basic.TransferHandler
Parameters:
comp - the component to receive the transfer; this argument is provided to enable sharing of TransferHandlers by multiple components
t - the data to import
Returns:
true if the data was inserted into the component, false otherwise

importDataImpl

protected boolean importDataImpl(JComponent comp,
                                 Transferable t)

JGraph
v3.3


Copyright (C) 2001-2004 JGraph.org. All rights reserved.