mxAbstractCanvas2D

Base class for all canvases.  A description of the public API is available in mxXmlCanvas2D.  All color values of mxConstants.NONE will be converted to null in the state.

Summary
mxAbstractCanvas2DBase class for all canvases.
Functions
mxAbstractCanvas2DConstructs a new abstract canvas.
Variables
converterHolds the mxUrlConverter to convert image URLs.
stateHolds the current state.
statesStack of states.
pathHolds the current path as an array.
rotateHtmlSwitch for rotation of HTML.
lastXHolds the last x coordinate.
lastYHolds the last y coordinate.
moveOpContains the string used for moving in paths.
lineOpContains the string used for moving in paths.
quadOpContains the string used for quadratic paths.
curveOpContains the string used for bezier curves.
closeOpHolds the operator for closing curves.
pointerEventsBoolean value that specifies if events should be handled.
Functions
createUrlConverterCreate a new mxUrlConverter and returns it.
resetResets the state of this canvas.
createStateCreates the state of the this canvas.
formatRounds all numbers to integers.
addOpAdds the given operation to the path.
rotatePointRotates the given point and returns the result as an mxPoint.
saveSaves the current state.
restoreRestores the current state.
setLinkSets the current link.
scaleScales the current state.
translateTranslates the current state.
rotateRotates the current state.
setAlphaSets the current alpha.
setFillAlphaSets the current solid fill alpha.
setStrokeAlphaSets the current stroke alpha.
setFillColorSets the current fill color.
setGradientSets the current gradient.
setStrokeColorSets the current stroke color.
setStrokeWidthSets the current stroke width.
setDashedEnables or disables dashed lines.
setDashPatternSets the current dash pattern.
setLineCapSets the current line cap.
setLineJoinSets the current line join.
setMiterLimitSets the current miter limit.
setFontColorSets the current font color.
setFontColorSets the current font color.
setFontColorSets the current font color.
setFontSizeSets the current font size.
setFontFamilySets the current font family.
setFontStyleSets the current font style.
setShadowEnables or disables and configures the current shadow.
setShadowColorEnables or disables and configures the current shadow.
setShadowAlphaEnables or disables and configures the current shadow.
setShadowOffsetEnables or disables and configures the current shadow.
beginStarts a new path.
moveToMoves the current path the given coordinates.
lineToDraws a line to the given coordinates.
quadToAdds a quadratic curve to the current path.
curveToAdds a bezier curve to the current path.
arcToAdds the given arc to the current path.
closeCloses the current path.
endEmpty implementation for backwards compatibility.

Functions

mxAbstractCanvas2D

function mxAbstractCanvas2D()

Constructs a new abstract canvas.

Variables

converter

this.converter

Holds the mxUrlConverter to convert image URLs.

state

mxAbstractCanvas2D.prototype.state

Holds the current state.

states

mxAbstractCanvas2D.prototype.states

Stack of states.

path

mxAbstractCanvas2D.prototype.path

Holds the current path as an array.

rotateHtml

mxAbstractCanvas2D.prototype.rotateHtml

Switch for rotation of HTML.  Default is false.

lastX

mxAbstractCanvas2D.prototype.lastX

Holds the last x coordinate.

lastY

mxAbstractCanvas2D.prototype.lastY

Holds the last y coordinate.

moveOp

mxAbstractCanvas2D.prototype.moveOp

Contains the string used for moving in paths.  Default is ‘M’.

lineOp

mxAbstractCanvas2D.prototype.lineOp

Contains the string used for moving in paths.  Default is ‘L’.

quadOp

mxAbstractCanvas2D.prototype.quadOp

Contains the string used for quadratic paths.  Default is ‘Q’.

curveOp

mxAbstractCanvas2D.prototype.curveOp

Contains the string used for bezier curves.  Default is ‘C’.

closeOp

mxAbstractCanvas2D.prototype.closeOp

Holds the operator for closing curves.  Default is ‘Z’.

pointerEvents

mxAbstractCanvas2D.prototype.pointerEvents

Boolean value that specifies if events should be handled.  Default is false.

Functions

createUrlConverter

mxAbstractCanvas2D.prototype.createUrlConverter = function()

Create a new mxUrlConverter and returns it.

reset

mxAbstractCanvas2D.prototype.reset = function()

Resets the state of this canvas.

createState

mxAbstractCanvas2D.prototype.createState = function()

Creates the state of the this canvas.

format

mxAbstractCanvas2D.prototype.format = function(value)

Rounds all numbers to integers.

addOp

mxAbstractCanvas2D.prototype.addOp = function()

Adds the given operation to the path.

rotatePoint

mxAbstractCanvas2D.prototype.rotatePoint = function(x,
y,
theta,
cx,
cy)

Rotates the given point and returns the result as an mxPoint.

save

mxAbstractCanvas2D.prototype.save = function()

Saves the current state.

restore

mxAbstractCanvas2D.prototype.restore = function()

Restores the current state.

setLink

mxAbstractCanvas2D.prototype.setLink = function(link)

Sets the current link.  Hook for subclassers.

scale

mxAbstractCanvas2D.prototype.scale = function(value)

Scales the current state.

translate

mxAbstractCanvas2D.prototype.translate = function(dx,
dy)

Translates the current state.

rotate

mxAbstractCanvas2D.prototype.rotate = function(theta,
flipH,
flipV,
cx,
cy)

Rotates the current state.

setAlpha

mxAbstractCanvas2D.prototype.setAlpha = function(value)

Sets the current alpha.

setFillAlpha

mxAbstractCanvas2D.prototype.setFillAlpha = function(value)

Sets the current solid fill alpha.

setStrokeAlpha

mxAbstractCanvas2D.prototype.setStrokeAlpha = function(value)

Sets the current stroke alpha.

setFillColor

mxAbstractCanvas2D.prototype.setFillColor = function(value)

Sets the current fill color.

setGradient

mxAbstractCanvas2D.prototype.setGradient = function(color1,
color2,
x,
y,
w,
h,
direction,
alpha1,
alpha2)

Sets the current gradient.

setStrokeColor

mxAbstractCanvas2D.prototype.setStrokeColor = function(value)

Sets the current stroke color.

setStrokeWidth

mxAbstractCanvas2D.prototype.setStrokeWidth = function(value)

Sets the current stroke width.

setDashed

mxAbstractCanvas2D.prototype.setDashed = function(value)

Enables or disables dashed lines.

setDashPattern

mxAbstractCanvas2D.prototype.setDashPattern = function(value)

Sets the current dash pattern.

setLineCap

mxAbstractCanvas2D.prototype.setLineCap = function(value)

Sets the current line cap.

setLineJoin

mxAbstractCanvas2D.prototype.setLineJoin = function(value)

Sets the current line join.

setMiterLimit

mxAbstractCanvas2D.prototype.setMiterLimit = function(value)

Sets the current miter limit.

setFontColor

mxAbstractCanvas2D.prototype.setFontColor = function(value)

Sets the current font color.

setFontColor

Sets the current font color.

setFontColor

Sets the current font color.

setFontSize

mxAbstractCanvas2D.prototype.setFontSize = function(value)

Sets the current font size.

setFontFamily

mxAbstractCanvas2D.prototype.setFontFamily = function(value)

Sets the current font family.

setFontStyle

mxAbstractCanvas2D.prototype.setFontStyle = function(value)

Sets the current font style.

setShadow

mxAbstractCanvas2D.prototype.setShadow = function(enabled)

Enables or disables and configures the current shadow.

setShadowColor

mxAbstractCanvas2D.prototype.setShadowColor = function(value)

Enables or disables and configures the current shadow.

setShadowAlpha

mxAbstractCanvas2D.prototype.setShadowAlpha = function(value)

Enables or disables and configures the current shadow.

setShadowOffset

mxAbstractCanvas2D.prototype.setShadowOffset = function(dx,
dy)

Enables or disables and configures the current shadow.

begin

mxAbstractCanvas2D.prototype.begin = function()

Starts a new path.

moveTo

mxAbstractCanvas2D.prototype.moveTo = function(x,
y)

Moves the current path the given coordinates.

lineTo

mxAbstractCanvas2D.prototype.lineTo = function(x,
y)

Draws a line to the given coordinates.  Uses moveTo with the op argument.

quadTo

mxAbstractCanvas2D.prototype.quadTo = function(x1,
y1,
x2,
y2)

Adds a quadratic curve to the current path.

curveTo

mxAbstractCanvas2D.prototype.curveTo = function(x1,
y1,
x2,
y2,
x3,
y3)

Adds a bezier curve to the current path.

arcTo

mxAbstractCanvas2D.prototype.arcTo = function(rx,
ry,
angle,
largeArcFlag,
sweepFlag,
x,
y)

Adds the given arc to the current path.  This is a synthetic operation that is broken down into curves.

close

mxAbstractCanvas2D.prototype.close = function(x1,
y1,
x2,
y2,
x3,
y3)

Closes the current path.

end

mxAbstractCanvas2D.prototype.end = function()

Empty implementation for backwards compatibility.  This will be removed.

function mxAbstractCanvas2D()
Constructs a new abstract canvas.
this.converter
Holds the mxUrlConverter to convert image URLs.
Converts relative and absolute URLs to absolute URLs with protocol and domain.
mxAbstractCanvas2D.prototype.state
Holds the current state.
mxAbstractCanvas2D.prototype.states
Stack of states.
mxAbstractCanvas2D.prototype.path
Holds the current path as an array.
mxAbstractCanvas2D.prototype.rotateHtml
Switch for rotation of HTML.
mxAbstractCanvas2D.prototype.lastX
Holds the last x coordinate.
mxAbstractCanvas2D.prototype.lastY
Holds the last y coordinate.
mxAbstractCanvas2D.prototype.moveOp
Contains the string used for moving in paths.
mxAbstractCanvas2D.prototype.lineOp
Contains the string used for moving in paths.
mxAbstractCanvas2D.prototype.quadOp
Contains the string used for quadratic paths.
mxAbstractCanvas2D.prototype.curveOp
Contains the string used for bezier curves.
mxAbstractCanvas2D.prototype.closeOp
Holds the operator for closing curves.
mxAbstractCanvas2D.prototype.pointerEvents
Boolean value that specifies if events should be handled.
mxAbstractCanvas2D.prototype.createUrlConverter = function()
Create a new mxUrlConverter and returns it.
mxAbstractCanvas2D.prototype.reset = function()
Resets the state of this canvas.
mxAbstractCanvas2D.prototype.createState = function()
Creates the state of the this canvas.
mxAbstractCanvas2D.prototype.format = function(value)
Rounds all numbers to integers.
mxAbstractCanvas2D.prototype.addOp = function()
Adds the given operation to the path.
mxAbstractCanvas2D.prototype.rotatePoint = function(x,
y,
theta,
cx,
cy)
Rotates the given point and returns the result as an mxPoint.
Implements a 2-dimensional vector with double precision coordinates.
mxAbstractCanvas2D.prototype.save = function()
Saves the current state.
mxAbstractCanvas2D.prototype.restore = function()
Restores the current state.
mxAbstractCanvas2D.prototype.setLink = function(link)
Sets the current link.
mxAbstractCanvas2D.prototype.scale = function(value)
Scales the current state.
mxAbstractCanvas2D.prototype.translate = function(dx,
dy)
Translates the current state.
mxAbstractCanvas2D.prototype.rotate = function(theta,
flipH,
flipV,
cx,
cy)
Rotates the current state.
mxAbstractCanvas2D.prototype.setAlpha = function(value)
Sets the current alpha.
mxAbstractCanvas2D.prototype.setFillAlpha = function(value)
Sets the current solid fill alpha.
mxAbstractCanvas2D.prototype.setStrokeAlpha = function(value)
Sets the current stroke alpha.
mxAbstractCanvas2D.prototype.setFillColor = function(value)
Sets the current fill color.
mxAbstractCanvas2D.prototype.setGradient = function(color1,
color2,
x,
y,
w,
h,
direction,
alpha1,
alpha2)
Sets the current gradient.
mxAbstractCanvas2D.prototype.setStrokeColor = function(value)
Sets the current stroke color.
mxAbstractCanvas2D.prototype.setStrokeWidth = function(value)
Sets the current stroke width.
mxAbstractCanvas2D.prototype.setDashed = function(value)
Enables or disables dashed lines.
mxAbstractCanvas2D.prototype.setDashPattern = function(value)
Sets the current dash pattern.
mxAbstractCanvas2D.prototype.setLineCap = function(value)
Sets the current line cap.
mxAbstractCanvas2D.prototype.setLineJoin = function(value)
Sets the current line join.
mxAbstractCanvas2D.prototype.setMiterLimit = function(value)
Sets the current miter limit.
mxAbstractCanvas2D.prototype.setFontColor = function(value)
Sets the current font color.
mxAbstractCanvas2D.prototype.setFontSize = function(value)
Sets the current font size.
mxAbstractCanvas2D.prototype.setFontFamily = function(value)
Sets the current font family.
mxAbstractCanvas2D.prototype.setFontStyle = function(value)
Sets the current font style.
mxAbstractCanvas2D.prototype.setShadow = function(enabled)
Enables or disables and configures the current shadow.
mxAbstractCanvas2D.prototype.setShadowColor = function(value)
Enables or disables and configures the current shadow.
mxAbstractCanvas2D.prototype.setShadowAlpha = function(value)
Enables or disables and configures the current shadow.
mxAbstractCanvas2D.prototype.setShadowOffset = function(dx,
dy)
Enables or disables and configures the current shadow.
mxAbstractCanvas2D.prototype.begin = function()
Starts a new path.
mxAbstractCanvas2D.prototype.moveTo = function(x,
y)
Moves the current path the given coordinates.
mxAbstractCanvas2D.prototype.lineTo = function(x,
y)
Draws a line to the given coordinates.
mxAbstractCanvas2D.prototype.quadTo = function(x1,
y1,
x2,
y2)
Adds a quadratic curve to the current path.
mxAbstractCanvas2D.prototype.curveTo = function(x1,
y1,
x2,
y2,
x3,
y3)
Adds a bezier curve to the current path.
mxAbstractCanvas2D.prototype.arcTo = function(rx,
ry,
angle,
largeArcFlag,
sweepFlag,
x,
y)
Adds the given arc to the current path.
mxAbstractCanvas2D.prototype.close = function(x1,
y1,
x2,
y2,
x3,
y3)
Closes the current path.
mxAbstractCanvas2D.prototype.end = function()
Empty implementation for backwards compatibility.
Base class for all canvases.
Defines the value for none.
Close