JGraph X 1.3.0.0

## com.mxgraph.swing.handler
Class mxGraphTransferHandler

    java.lang.Object
      javax.swing.TransferHandler
          com.mxgraph.swing.handler.mxGraphTransferHandler

All Implemented Interfaces:
  java.io.Serializable

    public class mxGraphTransferHandler

extends javax.swing.TransferHandler

See Also:
  Serialized Form

Nested Class Summary

Nested classes/interfaces inherited from class javax.swing.TransferHandler
`javax.swing.TransferHandler.DropLocation, javax.swing.TransferHandler.TransferSupport`

Field Summary
`static java.awt.Color` `DEFAULT_BACKGROUNDCOLOR` Specifies the background color of the transfer image.
`static boolean` `DEFAULT_TRANSFER_IMAGE_ENABLED` Boolean that specifies if an image of the cells should be created for each transferable.
`protected int` `importCount` Counter for the last imported cell array.
`protected java.lang.Object[]` `lastImported` Reference to the last imported cell array.
`protected java.awt.Point` `location`
`protected java.awt.Point` `offset`
`protected java.lang.Object[]` `originalCells` Reference to the original cells for removal after a move.
`protected java.awt.Color` `transferImageBackground` Specifies the background color for the transfer image.
`protected boolean` `transferImageEnabled` Specifies if a transfer image should be created for the transferable.

Fields inherited from class javax.swing.TransferHandler
`COPY, COPY_OR_MOVE, LINK, MOVE, NONE`

Constructor Summary
`mxGraphTransferHandler()`

Method Summary
`boolean` `canImport(javax.swing.JComponent comp, java.awt.datatransfer.DataFlavor[] flavors)`
`mxGraphTransferable` `createGraphTransferable(mxGraphComponent graphComponent, java.lang.Object[] cells, javax.swing.ImageIcon icon)`
`java.awt.datatransfer.Transferable` `createTransferable(javax.swing.JComponent c)` (non-Javadoc)
`javax.swing.ImageIcon` `createTransferableImage(mxGraphComponent graphComponent, java.lang.Object[] cells)`
`void` `exportDone(javax.swing.JComponent c, java.awt.datatransfer.Transferable data, int action)`
`int` `getSourceActions(javax.swing.JComponent c)`
`java.awt.Color` `getTransferImageBackground()`
`protected boolean` `importCells(mxGraphComponent graphComponent, java.lang.Object[] cells, mxRectangle bounds)` Returns true if the cells have been imported.
`boolean` `importData(javax.swing.JComponent c, java.awt.datatransfer.Transferable t)`
`boolean` `isLocalDrag()` Returns true if the DnD operation started from this handler.
`boolean` `isTransferImageEnabled()`
`protected void` `removeCells(mxGraphComponent graphComponent, java.lang.Object[] cells)`
`void` `setLocation(java.awt.Point value)`
`void` `setOffset(java.awt.Point value)`
`void` `setTransferImageBackground(java.awt.Color transferImageBackground)`
`void` `setTransferImageEnabled(boolean transferImageEnabled)`

Methods inherited from class javax.swing.TransferHandler
`canImport, exportAsDrag, exportToClipboard, getCopyAction, getCutAction, getPasteAction, getVisualRepresentation, importData`

Methods inherited from class java.lang.Object
`clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait`

Field Detail

### DEFAULT_TRANSFER_IMAGE_ENABLED

    public static boolean DEFAULT_TRANSFER_IMAGE_ENABLED

  Boolean that specifies if an image of the cells should be created for each transferable. Default is true.

### DEFAULT_BACKGROUNDCOLOR

    public static java.awt.Color DEFAULT_BACKGROUNDCOLOR

  Specifies the background color of the transfer image. If no color is given here then the background color of the enclosing graph component is used. Default is Color.WHITE.

### originalCells

    protected java.lang.Object[] originalCells

  Reference to the original cells for removal after a move.

### lastImported

    protected java.lang.Object[] lastImported

  Reference to the last imported cell array.

### importCount

    protected int importCount

  Counter for the last imported cell array.

### transferImageEnabled

    protected boolean transferImageEnabled

  Specifies if a transfer image should be created for the transferable. Default is DEFAULT_TRANSFER_IMAGE.

### transferImageBackground

    protected java.awt.Color transferImageBackground

  Specifies the background color for the transfer image. Default is DEFAULT_BACKGROUNDCOLOR.

### location

    protected java.awt.Point location

### offset

    protected java.awt.Point offset

Constructor Detail

### mxGraphTransferHandler

    public mxGraphTransferHandler()

Method Detail

### setTransferImageEnabled

    public void setTransferImageEnabled(boolean transferImageEnabled)

### isTransferImageEnabled

    public boolean isTransferImageEnabled()

### setTransferImageBackground

    public void setTransferImageBackground(java.awt.Color transferImageBackground)

### getTransferImageBackground

    public java.awt.Color getTransferImageBackground()

### isLocalDrag

    public boolean isLocalDrag()

  Returns true if the DnD operation started from this handler.

### setLocation

    public void setLocation(java.awt.Point value)

### setOffset

    public void setOffset(java.awt.Point value)

### canImport

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

  Overrides:
    `canImport` in class `javax.swing.TransferHandler`

### createTransferable

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

  (non-Javadoc)

  Overrides:
    `createTransferable` in class `javax.swing.TransferHandler`
  See Also:
    `TransferHandler.createTransferable(javax.swing.JComponent)`

### createGraphTransferable

    public mxGraphTransferable createGraphTransferable(mxGraphComponent graphComponent,
                                                       java.lang.Object[] cells,
                                                       javax.swing.ImageIcon icon)

### createTransferableImage

    public javax.swing.ImageIcon createTransferableImage(mxGraphComponent graphComponent,
                                                         java.lang.Object[] cells)

### exportDone

    public void exportDone(javax.swing.JComponent c,
                           java.awt.datatransfer.Transferable data,
                           int action)

  Overrides:
    `exportDone` in class `javax.swing.TransferHandler`

### removeCells

    protected void removeCells(mxGraphComponent graphComponent,
                               java.lang.Object[] cells)

### getSourceActions

    public int getSourceActions(javax.swing.JComponent c)

  Overrides:
    `getSourceActions` in class `javax.swing.TransferHandler`

### importData

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

  Overrides:
    `importData` in class `javax.swing.TransferHandler`

### importCells

    protected boolean importCells(mxGraphComponent graphComponent,
                                  java.lang.Object[] cells,
                                  mxRectangle bounds)

  Returns true if the cells have been imported.

JGraph X 1.3.0.0

Copyright (c) 2008 Gaudenz Alder. All rights reserved.