Overview | Package | Class | Use | Tree | Deprecated | Index | Help
| JGraph X 1.4.0.9
PREV CLASS NEXT CLASS | FRAMES NO FRAMES
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD

## com.mxgraph.swing.handler
Class mxGraphTransferHandler

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

All Implemented Interfaces:
  Serializable

    public class mxGraphTransferHandler

extends TransferHandler

See Also:
  Serialized Form

Field Summary
`static 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 Object[]` | `lastImported` Reference to the last imported cell array.
`protected Point` | `location`
`protected Point` | `offset`
`protected Object[]` | `originalCells` Reference to the original cells for removal after a move.
`protected 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, MOVE, NONE`

Constructor Summary
`mxGraphTransferHandler()`

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

Methods inherited from class javax.swing.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

### 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 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 Object[] originalCells

  Reference to the original cells for removal after a move.

### lastImported

    protected 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 Color transferImageBackground

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

### location

    protected Point location

### offset

    protected Point offset

Constructor Detail

### mxGraphTransferHandler

    public mxGraphTransferHandler()

Method Detail

### setTransferImageEnabled

    public void setTransferImageEnabled(boolean transferImageEnabled)

### isTransferImageEnabled

    public boolean isTransferImageEnabled()

### setTransferImageBackground

    public void setTransferImageBackground(Color transferImageBackground)

### getTransferImageBackground

    public Color getTransferImageBackground()

### isLocalDrag

    public boolean isLocalDrag()

  Returns true if the DnD operation started from this handler.

### setLocation

    public void setLocation(Point value)

### setOffset

    public void setOffset(Point value)

### canImport

    public boolean canImport(JComponent comp,
                             DataFlavor[] flavors)

  Overrides:
    `canImport` in class `TransferHandler`

### createTransferable

    public Transferable createTransferable(JComponent c)

  (non-Javadoc)

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

### createGraphTransferable

    public mxGraphTransferable createGraphTransferable(mxGraphComponent graphComponent,
                                                       Object[] cells,
                                                       ImageIcon icon)

### createGraphTransferable

    public mxGraphTransferable createGraphTransferable(mxGraphComponent graphComponent,
                                                       Object[] cells,
                                                       mxRectangle bounds,
                                                       ImageIcon icon)

### createTransferableImage

    public ImageIcon createTransferableImage(mxGraphComponent graphComponent,
                                             Object[] cells)

### exportDone

    public void exportDone(JComponent c,
                           Transferable data,
                           int action)

  Overrides:
    `exportDone` in class `TransferHandler`

### removeCells

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

### getSourceActions

    public int getSourceActions(JComponent c)

  Overrides:
    `getSourceActions` in class `TransferHandler`

### importData

    public boolean importData(JComponent c,
                              Transferable t)

  Overrides:
    `importData` in class `TransferHandler`

### importCells

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

  Returns true if the cells have been imported.

### importCells

    protected Object[] importCells(mxGraphComponent graphComponent,
                                   Object[] cells,
                                   double dx,
                                   double dy,
                                   Object target,
                                   Point location)

Overview | Package | Class | Use | Tree | Deprecated | Index | Help
| JGraph X 1.4.0.9
PREV CLASS NEXT CLASS | FRAMES NO FRAMES
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD

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