String that represents the text to be displayed. This is stored in
mxRectangle that defines the bounds. This is stored in mxShape.bounds.
Specifies the horizontal alignment. Default is ‘’. This is stored in
Specifies the vertical alignment. Default is ‘’. This is stored in
String that specifies the text color. Default is ‘black’. This is stored in
String that specifies the font family. Default is mxConstants.DEFAULT_FONTFAMILY. This is stored in
Integer that specifies the font size. Default is mxConstants.DEFAULT_FONTSIZE. This is stored in
Specifies the font style. Default is 0. This is stored in
Integer that specifies the global spacing. Default is 2. This is stored in
Integer that specifies the top spacing. Default is 0. The sum of the spacing and this is stored in
Integer that specifies the right spacing. Default is 0. The sum of the spacing and this is stored in
Integer that specifies the bottom spacing. Default is 0.The sum of the spacing and this is stored in
Integer that specifies the left spacing. Default is 0. The sum of the spacing and this is stored in
Boolean that specifies if the label is horizontal. Default is true. This is stored in
String that specifies the background color. Default is null. This is stored in
String that specifies the label border color. Default is null. This is stored in
Specifies if word-wrapping should be enabled. Default is false. This is stored in
Specifies if the label should be clipped. Default is false. This is stored in
Value of the overflow style. Default is ‘visible’.
Variable: antiAlias
Rendering hint for configuring the canvas.
Variable: baseSpacingBottom
Specifies the spacing to be added to the bottom spacing. Default is 0. Use the value 1 here to get the same label positions as in mxGraph 1.x.
Variable: baseSpacingLeft
Specifies the spacing to be added to the left spacing. Default is 0.
Variable: baseSpacingRight
Specifies the spacing to be added to the right spacing. Default is 0.
Variable: baseSpacingTop
Specifies the spacing to be added to the top spacing. Default is 0. Use the value 5 here to get the same label positions as in mxGraph 1.x.
Variable: boundingBox
Contains the bounding box of the shape, that is, the smallest rectangle that includes all pixels of the shape.
Variable: bounds
Holds the
Variable: cacheEnabled
Specifies if caching for HTML labels should be enabled. Default is true.
Variable: dialect
Holds the dialect in which the shape is to be painted.
This can be one of the DIALECT constants in
Specify the direction of certain shapes (eg. mxTriangle). Possible values are mxConstants.DIRECTION_EAST (default),
mxConstants.DIRECTION_WEST, mxConstants.DIRECTION_NORTH, and mxConstants.DIRECTION_SOUTH.
Note: this property is not documented in the JavaScript API but it does exist and is necessary (see apply).
Possible values are all constants with an ARROW-prefix.
Note: this property is not documented in the JavaScript API but it does exist and is necessary (see apply).
Size of the end marker in pixels.
Note: this property is not documented in the JavaScript API but it does exist and is necessary (see apply).
Fill color.
Note: this property is not documented in the JavaScript API but it does exist and is necessary (see apply).
Fill opacity. Possible range is 0-100
.
Note: this property is not documented in the JavaScript API but it does exist and is necessary (see apply).
Note: this property is not documented in the JavaScript API but it does exist and is necessary (see apply implementation).
Note: this property is not documented in the JavaScript API but it does exist and is necessary (see apply implementation).
Note: this property is not documented in the JavaScript API but it does exist and is necessary (see apply).
Gradient color.
Note: this property is not documented in the JavaScript API but it does exist and is necessary (see apply).
Gradient direction.
Note: this property is not documented in the JavaScript API but it does exist and is necessary (see apply).
Variable: ignoreClippedStringSize
Specifies if the string size should be measured in
Variable: ignoreStringSize
Specifies if the actual string size should be measured. If disabled the
boundingBox will not ignore the actual size of the string, otherwise
Note: this property is not documented in the JavaScript API but it does exist and is necessary (see apply).
For edges this determines whether or not joins between edges segments are smoothed to a rounded finish.
For vertices that have the rectangle shape, this determines whether or not the rectangle is rounded.
Note: this property is not documented in the JavaScript API but it does exist and is necessary (see apply).
Note: this property is not documented in the JavaScript API but it does exist and is necessary (see apply).
Variable: lastValue
Contains the last rendered text value. Used for caching.
Variable: minSvgStrokeWidth
Minimum stroke width for SVG output.
Variable: node
Holds the outermost DOM node that represents this shape.
Opacity. Possible range is 0-100
.
Note: this property is not documented in the JavaScript API but it does exist and is necessary (see apply).
Variable: outline
Specifies if the shape should be drawn as an outline. This disables all
fill colors and can be used to disable other drawing states that should
not be painted for outlines. Default is false. This should be set before
calling
Variable: pointerEvents
Specifies if pointer events should be handled. Default is true.
Variable: points
Holds the array of
Variable: replaceLinefeeds
Specifies if linefeeds in HTML labels should be replaced with BR tags. Default is true.
Possible range is 0-360.
Note: this property is not documented in the JavaScript API but it does exist and is necessary (see apply).
Variable: scale
Holds the scale in which the shape is being painted.
Variable: shapePointerEvents
Specifies if pointer events outside of shape should be handled. Default is false.
The value represents the spacing, in pixels, added to each side of a label in a vertex (style applies to vertices only).
Note: this property is not documented in the JavaScript API but it does exist and is necessary (see apply).
Possible values are all constants with an ARROW-prefix.
Note: this property is not documented in the JavaScript API but it does exist and is necessary (see apply).
Size of the start marker or the size of the swimlane title region depending on the shape it is used for.
Note: this property is not documented in the JavaScript API but it does exist and is necessary (see apply).
Variable: state
Optional reference to the corresponding
Variable: stencil
Holds the
Variable: stencilPointerEvents
Specifies if pointer events outside of stencils should be handled. Default is false. Set this to true for backwards compatibility with the 1.x branch.
Stroke color.
Note: this property is not documented in the JavaScript API but it does exist and is necessary (see apply).
Stroke opacity. Possible range is 0-100
.
Note: this property is not documented in the JavaScript API but it does exist and is necessary (see apply).
Stroke width.
Note: this property is not documented in the JavaScript API but it does exist and is necessary (see apply).
Variable: style
Optional reference to the style of the corresponding
Variable: svgPointerEvents
Specifies if pointer events should be handled. Default is true.
Variable: svgStrokeTolerance
Event-tolerance for SVG strokes (in px). Default is 8. This is only passed
to the canvas in
Variable: textWidthPadding
Specifies the padding to be added to the text width for the bounding box. This is needed to make sure no clipping is applied to borders. Default is 4 for IE 8 standards mode and 3 for all others.
Variable: useSvgBoundingBox
Allows to use the SVG bounding box in SVG. Default is false for performance reasons.
Variable: verticalTextRotation
Rotation for vertical text. Default is -90 (bottom to top).
Variable: visible
Specifies if the shape is visible. Default is true.
Variable: vmlScale
Scale for improving the precision of VML rendering. Default is 1.
Paints the given points with rounded corners.
Function: apply
Extends mxShape to update the text styles.
Parameters:
state -
Augments the bounding box with the strokewidth and shadow offsets.
Function: checkBounds
Returns true if the bounds are not null and all of its variables are numeric.
Function: clear
Removes all child nodes and resets all CSS.
Function: configureCanvas
Sets the state of the canvas for drawing the shape.
Function: create
Creates and returns the DOM node(s) for the shape in
the given container. This implementation invokes
Parameters:
container - DOM node that will contain the shape.
Function: createBoundingBox
Returns a new rectangle that represents the bounding box of the bare shape with no shadows or strokewidths.
Function: createCanvas
Creates a new canvas for drawing this shape. May return null.
Function: createHtml
Creates and returns the HTML DOM node(s) to represent
this shape. This implementation falls back to
Function: createSvg
Creates and returns the SVG node(s) to represent this shape.
Function: createSvgCanvas
Creates and returns an
Function: createTransparentSvgRectangle
Adds a transparent rectangle that catches all events.
Function: createVml
Creates and returns the VML node to represent this shape.
Function: createVmlCanvas
Creates and returns an
Function: createVmlGroup
Returns the temporary element used for rendering in IE8 standards mode.
Function: destroy
Destroys the shape by removing it from the DOM and releasing the DOM node associated with the shape using <mxEvent.release>.
Function: getArcSize
Returns the arc size for the given dimension.
Function: getAutoDirection
Used to determine the automatic text direction. Returns
<mxConstants.TEXT_DIRECTION_LTR> or <mxConstants.TEXT_DIRECTION_RTL>
depending on the contents of
Function: getCursor
Returns the current cursor.
Function: getGradientBounds
Returns the bounding box for the gradient box for this shape.
Function: getLabelBounds
Returns the
Function: getLabelMargins
Returns the scaled top, left, bottom and right margin to be used for
computing the label bounds as an
Function: getRotation
Returns the rotation from the style.
Function: getShapeRotation
Returns 0 to avoid using rotation in the canvas via updateTransform.
Function: getSpacing
Returns the spacing as an
Function: getSvgScreenOffset
Disables offset in IE9 for crisper image output.
Function: getTextRotation
Returns the rotation for the text label of the corresponding shape.
Function: init
Initializes the shape by creaing the DOM node using
Parameters:
container - DOM node that will contain the shape.
Function: initStyles
Sets the styles to their default values.
Function: isHtmlAllowed
Returns true if HTML is allowed for this shape. This implementation returns true if the browser is not in IE8 standards mode.
Function: isPaintBoundsInverted
Inverts the bounds if <mxShape.isBoundsInverted> returns true or if the horizontal style is false.
Function: isParseVml
Text shapes do not contain VML markup and do not need to be parsed. This method returns false to speed up rendering in IE8.
Hook for subclassers.
Function: paint
Generic rendering code.
Function: paintBackground
Hook for subclassers. This implementation is empty.
Function: paintEdgeShape
Hook for subclassers. This implementation is empty.
Hook for subclassers. This implementation is empty.
Function: paintGlassEffect
Paints the glass gradient effect.
Function: paintVertexShape
Paints the vertex shape.
Function: reconfigure
Reconfigures this shape. This will update the colors etc in addition to the bounds or points.
Function: redraw
Renders the text using the given DOM nodes.
Function: redrawHtmlShape
Updates the HTML node(s) to reflect the latest bounds and scale.
Function: redrawShape
Updates the SVG or VML shape.
Function: releaseSvgGradients
Paints the line shape.
Function: resetStyles
Resets all styles.
Function: setCursor
Sets the cursor on the given shape.
Parameters:
cursor - The cursor to be used.
Function: setTransparentBackgroundImage
Sets a transparent background CSS style to catch all events.
Paints the line shape.
Function: updateBoundingBox
Updates the
Function: updateBoundsFromPoints
Updates the bounds based on the points.
Function: updateFont
Updates the HTML node(s) to reflect the latest bounds and scale.
Function: mixedModeHtml
Allow optimization by replacing VML with HTML.
Function: mixedModeHtml
Allow optimization by replacing VML with HTML.
Function: updateHtmlFilter
Rotated text rendering quality is bad for IE9 quirks/IE8 standards
Function: updateHtmlFilters
Allow optimization by replacing VML with HTML.
Function: updateHtmlTransform
Returns the spacing as an
Function: setInnerHtml
Sets the inner HTML of the given element to the
Function: getMargin
Returns the spacing as an
Function: updateSize
Updates the HTML node(s) to reflect the latest bounds and scale.
Function: updateTransform
Sets the scale and rotation on the given canvas.
Function: updateValue
Updates the HTML node(s) to reflect the latest bounds and scale.
Function: updateVmlContainer
Sets the width and height of the container to 1px.
Generated using TypeDoc
Extends mxShape to implement a text shape. To change vertical text from bottom to top to top to bottom, the following code can be used: