Options
All
  • Public
  • Public/Protected
  • All
Menu

Hierarchy

  • mxStylesheet

Index

Constructors

constructor

Properties

styles

styles: StyleMap

Maps from names to cell styles. Each cell style is a map of key, value pairs.

Methods

createDefaultEdgeStyle

createDefaultVertexStyle

getCellStyle

  • Returns the cell style for the specified stylename or the given defaultStyle if no style can be found for the given stylename.

    Parameters

    • name: string

      String of the form [(stylename|key=value);] that represents the style.

    • Optional defaultStyle: StyleMap

      Default style to be returned if no style can be found.

    Returns StyleMap

getDefaultEdgeStyle

getDefaultVertexStyle

putCellStyle

  • putCellStyle(name: string, style: StyleMap): void
  • Stores the given map of key, value pairs under the given name in styles.

    Example:

    The following example adds a new style called 'rounded' into an existing stylesheet:

    var style = new Object();
    style[mxConstants.STYLE_SHAPE] = mxConstants.SHAPE_RECTANGLE;
    style[mxConstants.STYLE_PERIMETER] = mxPerimeter.RectanglePerimeter;
    style[mxConstants.STYLE_ROUNDED] = true;
    graph.getStylesheet().putCellStyle('rounded', style);
    

    In the above example, the new style is an object. The possible keys of the object are all the constants in mxConstants that start with STYLE and the values are either JavaScript objects, such as {@link mxPerimeter.RightAngleRectanglePerimeter} (which is in fact a function) or expressions, such as true. Note that not all keys will be interpreted by all shapes (eg. the line shape ignores the fill color). The final call to this method associates the style with a name in the stylesheet. The style is used in a cell with the following code:

    model.setStyle(cell, 'rounded');
    

    Parameters

    • name: string

      Name for the style to be stored.

    • style: StyleMap

      Key, value pairs that define the style.

    Returns void

putDefaultEdgeStyle

  • putDefaultEdgeStyle(style: StyleMap): void

putDefaultVertexStyle

  • putDefaultVertexStyle(style: StyleMap): void
  • Sets the default style for vertices using defaultVertex as the stylename.

    Parameters

    • style: StyleMap

      Key, value pairs that define the style.

    Returns void

Generated using TypeDoc