Singleton that implements a clipboard for graph cells.
mxClipboard.copy(graph); mxClipboard.paste(graph2);
This copies the selection cells from the graph to the clipboard and pastes them into graph2.
For fine-grained control of the clipboard data the mxGraph.canExportCell and mxGraph.canImportCell functions can be overridden.
mxClipboard | Singleton that implements a clipboard for graph cells. |
Variables | |
STEPSIZE | Defines the step size to offset the cells after each paste operation. |
insertCount | Counts the number of times the clipboard data has been inserted. |
cells | Holds the array of mxCells currently in the clipboard. |
Functions | |
isEmpty | Returns true if the clipboard currently has not data stored. |
cut | Cuts the given array of mxCells from the specified graph. |
removeCells | Hook to remove the given cells from the given graph after a cut operation. |
copy | Copies the given array of mxCells from the specified graph to cells.Returns the original array of cells that has been cloned. |
paste | Pastes the cells into the specified graph restoring the relation to <parents>, if possible. |
Holds the array of mxCells currently in the clipboard.
cut: function( graph, cells )
Cuts the given array of mxCells from the specified graph. If cells is null then the selection cells of the graph will be used. Returns the cells that have been cut from the graph.
graph | mxGraph that contains the cells to be cut. |
cells | Optional array of mxCells to be cut. |
paste: function( graph )
Pastes the cells into the specified graph restoring the relation to <parents>, if possible. If the parents are no longer in the graph or invisible then the cells are added to the graph’s default or into the swimlane under the cell’s new location if one exists. The cells are added to the graph using mxGraph.importCells.
graph | mxGraph to paste the cells into. |
Returns true if the clipboard currently has not data stored.
isEmpty: function()
Cuts the given array of mxCells from the specified graph.
cut: function( graph, cells )
Hook to remove the given cells from the given graph after a cut operation.
removeCells: function( graph, cells )
Copies the given array of mxCells from the specified graph to cells.Returns the original array of cells that has been cloned.
copy: function( graph, cells )
Pastes the cells into the specified graph restoring the relation to parents, if possible.
paste: function( graph )
Returns true if the given cell may be exported to the clipboard.
mxGraph.prototype.canExportCell = function( cell )
Returns true if the given cell may be imported from the clipboard.
mxGraph.prototype.canImportCell = function( cell )
Clones and inserts the given cells into the graph using the move method and returns the inserted cells.
mxGraph.prototype.importCells = function( cells, dx, dy, target, evt )