mxStylesheetCodec

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

Summary
mxStylesheetCodecCodec for mxStylesheets.
Functions
encodeEncodes a stylesheet.
getStringValueReturns the string for encoding the given value.
decodeReads a sequence of the following child nodes and attributes:

Functions

encode

codec.encode = function(enc,
obj)

Encodes a stylesheet.  See decode for a description of the format.

getStringValue

codec.getStringValue = function(key,
value)

Returns the string for encoding the given value.

decode

codec.decode = function(dec,
node,
into)

Reads a sequence of the following child nodes and attributes:

Child Nodes

addAdds a new style.

Attributes

asName of the style.
extendName of the style to inherit from.

Each node contains another sequence of add and remove nodes with the following attributes:

asName of the style (see mxConstants).
valueValue for the style.

Instead of the value-attribute, one can put Javascript expressions into the node as follows: <add as=”perimeter”>mxPerimeter.RectanglePerimeter</add>

A remove node will remove the entry with the name given in the as-attribute from the style.

Example

<mxStylesheet as="stylesheet">
  <add as="text">
    <add as="fontSize" value="12"/>
  </add>
  <add as="defaultVertex" extend="text">
    <add as="shape" value="rectangle"/>
  </add>
</mxStylesheet>
Defines the appearance of the cells in a graph.
codec.encode = function(enc,
obj)
Encodes a stylesheet.
codec.getStringValue = function(key,
value)
Returns the string for encoding the given value.
codec.decode = function(dec,
node,
into)
Reads a sequence of the following child nodes and attributes:
XML codec for JavaScript object graphs.
Singleton class that acts as a global registry for codecs.
Defines various global constants.
Close