|
mxGraph 2.5.0.2 |
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object javax.swing.TransferHandler com.mxgraph.swing.handler.mxGraphTransferHandler
public class mxGraphTransferHandler
Nested Class Summary |
---|
Nested classes/interfaces inherited from class javax.swing.TransferHandler |
---|
TransferHandler.DropLocation, TransferHandler.TransferSupport |
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 int |
initialImportCount
Sets the value for the initialImportCount. |
protected Transferable |
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, LINK, 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)
|
protected Object |
getDropTarget(mxGraphComponent graphComponent,
mxGraphTransferable gt)
Returns the drop target for the given transferable and location. |
int |
getImportCount()
|
int |
getSourceActions(JComponent c)
|
Color |
getTransferImageBackground()
|
protected Object[] |
importCells(mxGraphComponent graphComponent,
mxGraphTransferable gt,
double dx,
double dy)
Gets a drop target using getDropTarget and imports the cells using mxGraph.splitEdge or mxGraphComponent.importCells depending on the drop target and the return values of mxGraph.isSplitEnabled and mxGraph.isSplitTarget. |
boolean |
importData(JComponent c,
Transferable t)
Checks if the mxGraphTransferable data flavour is supported and calls importGraphTransferable if possible. |
protected boolean |
importGraphTransferable(mxGraphComponent graphComponent,
mxGraphTransferable gt)
Returns true if the cells have been imported using importCells. |
boolean |
isLocalDrag()
Returns true if the DnD operation started from this handler. |
boolean |
isTransferImageEnabled()
|
protected void |
removeCells(mxGraphComponent graphComponent,
Object[] cells)
|
void |
setImportCount(int value)
|
void |
setLocation(Point value)
|
void |
setOffset(Point value)
|
void |
setTransferImageBackground(Color transferImageBackground)
|
void |
setTransferImageEnabled(boolean transferImageEnabled)
|
protected void |
updateImportCount(Transferable t)
Counts the number of times that the given transferable has been imported. |
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 |
---|
public static boolean DEFAULT_TRANSFER_IMAGE_ENABLED
public static Color DEFAULT_BACKGROUNDCOLOR
protected Object[] originalCells
protected Transferable lastImported
protected int initialImportCount
protected int importCount
protected boolean transferImageEnabled
protected Color transferImageBackground
protected Point location
protected Point offset
Constructor Detail |
---|
public mxGraphTransferHandler()
Method Detail |
---|
public int getImportCount()
public void setImportCount(int value)
public void setTransferImageEnabled(boolean transferImageEnabled)
public boolean isTransferImageEnabled()
public void setTransferImageBackground(Color transferImageBackground)
public Color getTransferImageBackground()
public boolean isLocalDrag()
public void setLocation(Point value)
public void setOffset(Point value)
public boolean canImport(JComponent comp, DataFlavor[] flavors)
canImport
in class TransferHandler
public Transferable createTransferable(JComponent c)
createTransferable
in class TransferHandler
TransferHandler.createTransferable(javax.swing.JComponent)
public mxGraphTransferable createGraphTransferable(mxGraphComponent graphComponent, Object[] cells, ImageIcon icon)
public mxGraphTransferable createGraphTransferable(mxGraphComponent graphComponent, Object[] cells, mxRectangle bounds, ImageIcon icon)
public ImageIcon createTransferableImage(mxGraphComponent graphComponent, Object[] cells)
public void exportDone(JComponent c, Transferable data, int action)
exportDone
in class TransferHandler
protected void removeCells(mxGraphComponent graphComponent, Object[] cells)
public int getSourceActions(JComponent c)
getSourceActions
in class TransferHandler
public boolean importData(JComponent c, Transferable t)
importData
in class TransferHandler
protected void updateImportCount(Transferable t)
protected boolean importGraphTransferable(mxGraphComponent graphComponent, mxGraphTransferable gt)
protected Object getDropTarget(mxGraphComponent graphComponent, mxGraphTransferable gt)
protected Object[] importCells(mxGraphComponent graphComponent, mxGraphTransferable gt, double dx, double dy)
|
mxGraph 2.5.0.2 |
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |