cytoscape.editor.event
Class BasicCytoShapeTransferHandler

java.lang.Object
  extended byjavax.swing.TransferHandler
      extended bycytoscape.editor.event.BasicCytoShapeTransferHandler
All Implemented Interfaces:
java.io.Serializable

public class BasicCytoShapeTransferHandler
extends javax.swing.TransferHandler

transfer handler for shapes that are dragged from the palette onto the canvas. Creates appropriate data flavor and transferrable. part of drag/drop editor framework.

Version:
1.0
Author:
Allan Kuchinsky
See Also:
GraphicalEntity, BasicCytoShapeEntity, Serialized Form

Field Summary
 
Fields inherited from class javax.swing.TransferHandler
COPY, COPY_OR_MOVE, MOVE, NONE
 
Constructor Summary
BasicCytoShapeTransferHandler()
          creates a DataFlavor for the BasicCytoShapeEntity class
BasicCytoShapeTransferHandler(BasicCytoShapeEntity cytoShape, java.lang.Object[] args)
          creates a DataFlavor and sets instance variables for a BasicCytoShapeEntity that is added to the palette
 
Method Summary
 boolean canImport(javax.swing.JComponent c, java.awt.datatransfer.DataFlavor[] flavors)
           
 java.awt.datatransfer.Transferable createTransferable(javax.swing.JComponent c)
           
 java.lang.String exportString(java.lang.Object val)
           
 java.lang.Object[] get_args()
           
 java.lang.String get_attributeName()
           
 java.lang.String get_attributeValue()
           
 java.awt.dnd.DragGestureListener get_cytoShape()
           
 boolean importData(javax.swing.JComponent c, java.awt.datatransfer.Transferable t)
           
 void set_args(java.lang.Object[] _args)
          sets the _args instance variable
 void set_cytoShape(java.awt.dnd.DragGestureListener shape)
          sets the instance variable for a BasicCytoShapeEntity
 
Methods inherited from class javax.swing.TransferHandler
exportAsDrag, exportToClipboard, getCopyAction, getCutAction, getPasteAction, getSourceActions, getVisualRepresentation
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

BasicCytoShapeTransferHandler

public BasicCytoShapeTransferHandler()
creates a DataFlavor for the BasicCytoShapeEntity class


BasicCytoShapeTransferHandler

public BasicCytoShapeTransferHandler(BasicCytoShapeEntity cytoShape,
                                     java.lang.Object[] args)
creates a DataFlavor and sets instance variables for a BasicCytoShapeEntity that is added to the palette

Parameters:
cytoShape - shape that is added to the palette
args - arbitrary list of arguments that can be passed in
Method Detail

get_attributeName

public java.lang.String get_attributeName()
Returns:
Returns the _attributeName.

get_attributeValue

public java.lang.String get_attributeValue()
Returns:
Returns the _attributeValue.

get_args

public java.lang.Object[] get_args()
Returns:
Returns the _args.

set_args

public void set_args(java.lang.Object[] _args)
sets the _args instance variable

Parameters:
_args - The _args to set.

importData

public boolean importData(javax.swing.JComponent c,
                          java.awt.datatransfer.Transferable t)

exportString

public java.lang.String exportString(java.lang.Object val)

createTransferable

public java.awt.datatransfer.Transferable createTransferable(javax.swing.JComponent c)

canImport

public boolean canImport(javax.swing.JComponent c,
                         java.awt.datatransfer.DataFlavor[] flavors)

get_cytoShape

public java.awt.dnd.DragGestureListener get_cytoShape()
Returns:
Returns the _cytoShape.

set_cytoShape

public void set_cytoShape(java.awt.dnd.DragGestureListener shape)
sets the instance variable for a BasicCytoShapeEntity

Parameters:
shape - The _cytoShape to set.