mxCellCodec

Codec for mxCells.  This class is created and registered dynamically at load time and used implicitely via mxCodec and the mxCodecRegistry.

Transient Fields

  • children
  • edges
  • overlays
  • mxTransient

Reference Fields

  • parent
  • source
  • target

Transient fields can be added using the following code

mxCodecRegistry.getCodec(mxCell).exclude.push(‘name_of_field’);

To subclass mxCell, replace the template and add an alias as follows.

function CustomCell(value, geometry, style)
{
  mxCell.apply(this, arguments);
}

mxUtils.extend(CustomCell, mxCell);

mxCodecRegistry.getCodec(mxCell).template = new CustomCell();
mxCodecRegistry.addAlias('CustomCell', 'mxCell');
Summary
mxCellCodecCodec for mxCells.
Functions
isCellCodecReturns true since this is a cell codec.
isExcludedExcludes user objects that are XML nodes.
afterEncodeEncodes an mxCell and wraps the XML up inside the XML of the user object (inversion).
beforeDecodeDecodes an mxCell and uses the enclosing XML node as the user object for the cell (inversion).

Functions

isCellCodec

codec.isCellCodec = function()

Returns true since this is a cell codec.

isExcluded

codec.isExcluded = function(obj,
attr,
value,
isWrite)

Excludes user objects that are XML nodes.

afterEncode

codec.afterEncode = function(enc,
obj,
node)

Encodes an mxCell and wraps the XML up inside the XML of the user object (inversion).

beforeDecode

codec.beforeDecode = function(dec,
node,
obj)

Decodes an mxCell and uses the enclosing XML node as the user object for the cell (inversion).

Cells are the elements of the graph model.
codec.isCellCodec = function()
Returns true since this is a cell codec.
codec.isExcluded = function(obj,
attr,
value,
isWrite)
Excludes user objects that are XML nodes.
codec.afterEncode = function(enc,
obj,
node)
Encodes an mxCell and wraps the XML up inside the XML of the user object (inversion).
codec.beforeDecode = function(dec,
node,
obj)
Decodes an mxCell and uses the enclosing XML node as the user object for the cell (inversion).
XML codec for JavaScript object graphs.
Singleton class that acts as a global registry for codecs.
Close