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:
mxText.prototype.verticalTextRotation = 90;
mxText | Extends mxShape to implement a text shape. |
Functions | |
mxText | Constructs a new text shape. |
Variables | |
baseSpacingTop | Specifies the spacing to be added to the top spacing. |
baseSpacingBottom | Specifies the spacing to be added to the bottom spacing. |
baseSpacingLeft | Specifies the spacing to be added to the left spacing. |
baseSpacingRight | Specifies the spacing to be added to the right spacing. |
replaceLinefeeds | Specifies if linefeeds in HTML labels should be replaced with BR tags. |
verticalTextRotation | Rotation for vertical text. |
ignoreClippedStringSize | Specifies if the actual string size should be measured if a label is clipped. |
ignoreStringSize | Specifies if the actual string size should be measured. |
Functions | |
isParseVml | Text shapes do not contain VML markup and do not need to be parsed. |
isHtmlAllowed | Returns true if HTML is allowed for this shape. |
getSvgScreenOffset | Disables offset in IE9 for crisper image output. |
checkBounds | Returns true if the bounds are not null and all of its variables are numeric. |
apply | Extends mxShape to updat the text styles. |
updateBoundingBox | Updates the <boundingBox> for this shape using the given node and position. |
getShapeRotation | Returns 0 to avoid using rotation in the canvas via updateTransform. |
getTextRotation | Returns the rotation for the text label of the corresponding shape. |
isPaintBoundsInverted | Inverts the bounds if <mxShape.isBoundsInverted> returns true or if the horizontal style is false. |
configureCanvas | Sets the state of the canvas for drawing the shape. |
updateVmlContainer | Sets the width and height of the container to 1px. |
paint | Generic rendering code. |
redrawHtmlShape | Updates the HTML node(s) to reflect the latest bounds and scale. |
updateHtmlTransform | Returns the spacing as an mxPoint. |
updateHtmlFilter | Rotated text rendering quality is bad for IE9 quirks/IE8 standards |
updateValue | Updates the HTML node(s) to reflect the latest bounds and scale. |
updateFont | Updates the HTML node(s) to reflect the latest bounds and scale. |
updateSize | Updates the HTML node(s) to reflect the latest bounds and scale. |
getMargin | Returns the spacing as an mxPoint. |
getSpacing | Returns the spacing as an mxPoint. |
function mxText( value, bounds, align, valign, color, family, size, fontStyle, spacing, spacingTop, spacingRight, spacingBottom, spacingLeft, horizontal, background, border, wrap, clipped, overflow, labelPadding )
Constructs a new text shape.
value | String that represents the text to be displayed. This is stored in <value>. |
bounds | mxRectangle that defines the bounds. This is stored in mxShape.bounds. |
align | Specifies the horizontal alignment. Default is ‘’. This is stored in <align>. |
valign | Specifies the vertical alignment. Default is ‘’. This is stored in <valign>. |
color | String that specifies the text color. Default is ‘black’. This is stored in <color>. |
family | String that specifies the font family. Default is mxConstants.DEFAULT_FONTFAMILY. This is stored in <family>. |
size | Integer that specifies the font size. Default is mxConstants.DEFAULT_FONTSIZE. This is stored in <size>. |
fontStyle | Specifies the font style. Default is 0. This is stored in <fontStyle>. |
spacing | Integer that specifies the global spacing. Default is 2. This is stored in <spacing>. |
spacingTop | Integer that specifies the top spacing. Default is 0. The sum of the spacing and this is stored in <spacingTop>. |
spacingRight | Integer that specifies the right spacing. Default is 0. The sum of the spacing and this is stored in <spacingRight>. |
spacingBottom | Integer that specifies the bottom spacing. Default is 0.The sum of the spacing and this is stored in <spacingBottom>. |
spacingLeft | Integer that specifies the left spacing. Default is 0. The sum of the spacing and this is stored in <spacingLeft>. |
horizontal | Boolean that specifies if the label is horizontal. Default is true. This is stored in <horizontal>. |
background | String that specifies the background color. Default is null. This is stored in <background>. |
border | String that specifies the label border color. Default is null. This is stored in <border>. |
wrap | Specifies if word-wrapping should be enabled. Default is false. This is stored in <wrap>. |
clipped | Specifies if the label should be clipped. Default is false. This is stored in <clipped>. |
overflow | Value of the overflow style. Default is ‘visible’. |
mxText.prototype.ignoreClippedStringSize
Specifies if the actual string size should be measured if a label is clipped. If disabled the boundingBox will not ignore the actual size of the string, otherwise <bounds> will be used instead. Default is true. ignoreStringSize has precedence over this switch.
mxText.prototype.apply = function( state )
Extends mxShape to updat the text styles.
state | mxCellState of the corresponding cell. |
mxText.prototype.updateHtmlTransform = function()
Returns the spacing as an mxPoint.
Returns the spacing as an mxPoint.
mxText.prototype.getSpacing = function()
Returns the spacing as an mxPoint.
Constructs a new text shape.
function mxText( value, bounds, align, valign, color, family, size, fontStyle, spacing, spacingTop, spacingRight, spacingBottom, spacingLeft, horizontal, background, border, wrap, clipped, overflow, labelPadding )
Specifies the spacing to be added to the top spacing.
mxText.prototype.baseSpacingTop
Specifies the spacing to be added to the bottom spacing.
mxText.prototype.baseSpacingBottom
Specifies the spacing to be added to the left spacing.
mxText.prototype.baseSpacingLeft
Specifies the spacing to be added to the right spacing.
mxText.prototype.baseSpacingRight
Specifies if linefeeds in HTML labels should be replaced with BR tags.
mxText.prototype.replaceLinefeeds
Rotation for vertical text.
mxText.prototype.verticalTextRotation
Specifies if the actual string size should be measured if a label is clipped.
mxText.prototype.ignoreClippedStringSize
Specifies if the actual string size should be measured.
mxText.prototype.ignoreStringSize
Text shapes do not contain VML markup and do not need to be parsed.
mxText.prototype.isParseVml = function()
Returns true if HTML is allowed for this shape.
mxText.prototype.isHtmlAllowed = function()
Disables offset in IE9 for crisper image output.
mxText.prototype.getSvgScreenOffset = function()
Returns true if the bounds are not null and all of its variables are numeric.
mxText.prototype.checkBounds = function()
Extends mxShape to updat the text styles.
mxText.prototype.apply = function( state )
Updates the boundingBox for this shape using the given node and position.
mxText.prototype.updateBoundingBox = function()
Returns 0 to avoid using rotation in the canvas via updateTransform.
mxText.prototype.getShapeRotation = function()
Returns the rotation for the text label of the corresponding shape.
mxText.prototype.getTextRotation = function()
Inverts the bounds if mxShape.isBoundsInverted returns true or if the horizontal style is false.
mxText.prototype.isPaintBoundsInverted = function()
Sets the state of the canvas for drawing the shape.
mxText.prototype.configureCanvas = function( c, x, y, w, h )
Sets the width and height of the container to 1px.
mxText.prototype.updateVmlContainer = function()
Generic rendering code.
mxText.prototype.paint = function( c )
Updates the HTML node(s) to reflect the latest bounds and scale.
mxText.prototype.redrawHtmlShape = function()
Returns the spacing as an mxPoint.
mxText.prototype.updateHtmlTransform = function()
Rotated text rendering quality is bad for IE9 quirks/IE8 standards
mxText.prototype.updateHtmlFilter = function()
Updates the HTML node(s) to reflect the latest bounds and scale.
mxText.prototype.updateValue = function()
Updates the HTML node(s) to reflect the latest bounds and scale.
mxText.prototype.updateFont = function( node )
Updates the HTML node(s) to reflect the latest bounds and scale.
mxText.prototype.updateSize = function( node )
Returns the spacing as an mxPoint.
mxText.prototype.getSpacing = function()
Holds the mxRectangle that specifies the bounds of this shape.
mxShape.prototype.bounds