mxEditorCodec

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

Transient Fields

  • modified
  • lastSnapshot
  • ignoredChanges
  • undoManager
  • graphContainer
  • toolbarContainer
Summary
mxEditorCodecCodec for mxEditors.
Functions
beforeDecodeDecodes the ui-part of the configuration node by reading a sequence of the following child nodes and attributes and passes the control to the default decoding mechanism:
decodeChildOverrides decode child to handle special child nodes.
decodeTemplatesDecodes the cells from the given node as templates.
decodeTemplatesDecodes the cells from the given node as templates.

Functions

beforeDecode

Decodes the ui-part of the configuration node by reading a sequence of the following child nodes and attributes and passes the control to the default decoding mechanism:

Child Nodes

stylesheetAdds a CSS stylesheet to the document.
resourceAdds the basename of a resource bundle.
addCreates or configures a known UI element.

These elements may appear in any order given that the graph UI element is added before the toolbar element (see Known Keys).

Attributes

asKey for the UI element (see below).
elementID for the element in the document.
styleCSS style to be used for the element or window.
xX coordinate for the new window.
yY coordinate for the new window.
widthWidth for the new window.
heightOptional height for the new window.
nameName of the stylesheet (absolute/relative URL).
basenameBasename of the resource bundle (see mxResources).

The x, y, width and height attributes are used to create a new mxWindow if the element attribute is not specified in an add node.  The name and basename are only used in the stylesheet and resource nodes, respectively.

Known Keys

graphMain graph element (see mxEditor.setGraphContainer).
titleTitle element (see mxEditor.setTitleContainer).
toolbarToolbar element (see mxEditor.setToolbarContainer).
statusStatus bar element (see mxEditor.setStatusContainer).

Example

<ui>
  <stylesheet name="css/process.css"/>
  <resource basename="resources/app"/>
  <add as="graph" element="graph"
    style="left:70px;right:20px;top:20px;bottom:40px"/>
  <add as="status" element="status"/>
  <add as="toolbar" x="10" y="20" width="54"/>
</ui>

decodeChild

codec.decodeChild = function(dec,
child,
obj)

Overrides decode child to handle special child nodes.

decodeTemplates

Decodes the cells from the given node as templates.

decodeTemplates

codec.decodeTemplates = function(dec,
node,
editor)

Decodes the cells from the given node as templates.

Extends mxEventSource to implement a application wrapper for a graph that adds actions, I/O using mxCodec, auto-layout using mxLayoutManager, command history using undoManager, and standard dialogs and widgets, eg.
codec.decodeChild = function(dec,
child,
obj)
Overrides decode child to handle special child nodes.
codec.decodeTemplates = function(dec,
node,
editor)
Decodes the cells from the given node as templates.
XML codec for JavaScript object graphs.
Singleton class that acts as a global registry for codecs.
Implements internationalization.
Basic window inside a document.
mxEditor.prototype.setGraphContainer = function (container)
Sets the graph’s container using mxGraph.init.
mxEditor.prototype.setTitleContainer = function (container)
Creates a listener to update the inner HTML of the specified DOM node with the value of getTitle.
mxEditor.prototype.setToolbarContainer = function (container)
Initializes the toolbar for the given container.
mxEditor.prototype.setStatusContainer = function (container)
Creates the status using the specified container.
Close