CanvasShape.js revision c7ba96d16d58075a9ab8d5c1e46c6c83ce11cb4e
09688ec5ffb8b9cf9883a770e2f9ebd60b28888dTripp * Base class for creating shapes.
09688ec5ffb8b9cf9883a770e2f9ebd60b28888dTripp * @class CanvasShape
c7ba96d16d58075a9ab8d5c1e46c6c83ce11cb4eTripp CanvasShape.superclass.constructor.apply(this, arguments);
c7ba96d16d58075a9ab8d5c1e46c6c83ce11cb4eTrippY.extend(CanvasShape, Y.BaseGraphic, Y.mix(Y.CanvasDrawing.prototype, {
e7c7565d9550eaa87043aef0df77125ada996deaTripp init: function()
828c58761d90445b8b9d20a82d85dc1479317f71Tripp * Initializes the shape
828c58761d90445b8b9d20a82d85dc1479317f71Tripp * @method _initialize
828c58761d90445b8b9d20a82d85dc1479317f71Tripp var host = this;
828c58761d90445b8b9d20a82d85dc1479317f71Tripp * Add a class name to each node.
828c58761d90445b8b9d20a82d85dc1479317f71Tripp * @method addClass
828c58761d90445b8b9d20a82d85dc1479317f71Tripp * @param {String} className the class name to add to the node's class attribute
828c58761d90445b8b9d20a82d85dc1479317f71Tripp * Removes a class name from each node.
828c58761d90445b8b9d20a82d85dc1479317f71Tripp * @method removeClass
828c58761d90445b8b9d20a82d85dc1479317f71Tripp * @param {String} className the class name to remove from the node's class attribute
828c58761d90445b8b9d20a82d85dc1479317f71Tripp * Gets the current position of the node in page coordinates.
828c58761d90445b8b9d20a82d85dc1479317f71Tripp * @method getXY
828c58761d90445b8b9d20a82d85dc1479317f71Tripp * @return Array The XY position of the shape.
828c58761d90445b8b9d20a82d85dc1479317f71Tripp getXY: function()
828c58761d90445b8b9d20a82d85dc1479317f71Tripp * Set the position of the shape in page coordinates, regardless of how the node is positioned.
828c58761d90445b8b9d20a82d85dc1479317f71Tripp * @method setXY
828c58761d90445b8b9d20a82d85dc1479317f71Tripp * @param {Array} Contains X & Y values for new position (coordinates are page-based)
828c58761d90445b8b9d20a82d85dc1479317f71Tripp * Determines whether the node is an ancestor of another HTML element in the DOM hierarchy.
828c58761d90445b8b9d20a82d85dc1479317f71Tripp * @method contains
828c58761d90445b8b9d20a82d85dc1479317f71Tripp * @param {CanvasShape | HTMLElement} needle The possible node or descendent
828c58761d90445b8b9d20a82d85dc1479317f71Tripp * @return Boolean Whether or not this shape is the needle or its ancestor.
828c58761d90445b8b9d20a82d85dc1479317f71Tripp * Test if the supplied node matches the supplied selector.
828c58761d90445b8b9d20a82d85dc1479317f71Tripp * @method test
828c58761d90445b8b9d20a82d85dc1479317f71Tripp * @param {String} selector The CSS selector to test against.
828c58761d90445b8b9d20a82d85dc1479317f71Tripp * @return Boolean Wheter or not the shape matches the selector.
828c58761d90445b8b9d20a82d85dc1479317f71Tripp //return Y.Selector.test(this.node, selector);
828c58761d90445b8b9d20a82d85dc1479317f71Tripp * Compares nodes to determine if they match.
828c58761d90445b8b9d20a82d85dc1479317f71Tripp * Node instances can be compared to each other and/or HTMLElements.
828c58761d90445b8b9d20a82d85dc1479317f71Tripp * @method compareTo
828c58761d90445b8b9d20a82d85dc1479317f71Tripp * @param {HTMLElement | Node} refNode The reference node to compare to the node.
828c58761d90445b8b9d20a82d85dc1479317f71Tripp * @return {Boolean} True if the nodes match, false if they do not.
828c58761d90445b8b9d20a82d85dc1479317f71Tripp * Value function for fill attribute
828c58761d90445b8b9d20a82d85dc1479317f71Tripp * @method _getDefaultFill
828c58761d90445b8b9d20a82d85dc1479317f71Tripp * @return Object
828c58761d90445b8b9d20a82d85dc1479317f71Tripp _getDefaultFill: function() {
828c58761d90445b8b9d20a82d85dc1479317f71Tripp * Value function for stroke attribute
828c58761d90445b8b9d20a82d85dc1479317f71Tripp * @method _getDefaultStroke
828c58761d90445b8b9d20a82d85dc1479317f71Tripp * @return Object
828c58761d90445b8b9d20a82d85dc1479317f71Tripp * Left edge of the path
828c58761d90445b8b9d20a82d85dc1479317f71Tripp * Right edge of the path
828c58761d90445b8b9d20a82d85dc1479317f71Tripp * Top edge of the path
828c58761d90445b8b9d20a82d85dc1479317f71Tripp * Bottom edge of the path
828c58761d90445b8b9d20a82d85dc1479317f71Tripp * Creates the dom node for the shape.
828c58761d90445b8b9d20a82d85dc1479317f71Tripp * @return HTMLElement
828c58761d90445b8b9d20a82d85dc1479317f71Tripp if(type.indexOf('mouse') > -1 || type.indexOf('click') > -1)
828c58761d90445b8b9d20a82d85dc1479317f71Tripp return true;
828c58761d90445b8b9d20a82d85dc1479317f71Tripp return false;
828c58761d90445b8b9d20a82d85dc1479317f71Tripp * Adds a stroke to the shape node.
828c58761d90445b8b9d20a82d85dc1479317f71Tripp * @method _strokeChangeHandler
828c58761d90445b8b9d20a82d85dc1479317f71Tripp this._miterlimit = null;
828c58761d90445b8b9d20a82d85dc1479317f71Tripp this._dashstyle = (dashstyle && Y.Lang.isArray(dashstyle) && dashstyle.length > 1) ? dashstyle : null;
828c58761d90445b8b9d20a82d85dc1479317f71Tripp set: function()
828c58761d90445b8b9d20a82d85dc1479317f71Tripp var host = this,
828c58761d90445b8b9d20a82d85dc1479317f71Tripp * Adds a fill to the shape node.
828c58761d90445b8b9d20a82d85dc1479317f71Tripp * @method _fillChangeHandler
828c58761d90445b8b9d20a82d85dc1479317f71Tripp this._fillColor = null;
828c58761d90445b8b9d20a82d85dc1479317f71Tripp * Applies translate transformation.
828c58761d90445b8b9d20a82d85dc1479317f71Tripp * @method translate
828c58761d90445b8b9d20a82d85dc1479317f71Tripp * @param {Number} x The x-coordinate
828c58761d90445b8b9d20a82d85dc1479317f71Tripp * @param {Number} y The y-coordinate
828c58761d90445b8b9d20a82d85dc1479317f71Tripp * @protected
828c58761d90445b8b9d20a82d85dc1479317f71Tripp translate: function(x, y)
828c58761d90445b8b9d20a82d85dc1479317f71Tripp var translate = "translate(" + x + "px, " + y + "px)";
828c58761d90445b8b9d20a82d85dc1479317f71Tripp this._updateTransform("translate", /translate\(.*\)/, translate);
828c58761d90445b8b9d20a82d85dc1479317f71Tripp * Applies a skew to the x-coordinate
828c58761d90445b8b9d20a82d85dc1479317f71Tripp * @method skewX:q
828c58761d90445b8b9d20a82d85dc1479317f71Tripp * @param {Number} x x-coordinate
828c58761d90445b8b9d20a82d85dc1479317f71Tripp skewX: function(x)
828c58761d90445b8b9d20a82d85dc1479317f71Tripp * Applies a skew to the x-coordinate
828c58761d90445b8b9d20a82d85dc1479317f71Tripp * @method skewX:q
828c58761d90445b8b9d20a82d85dc1479317f71Tripp * @param {Number} x x-coordinate
828c58761d90445b8b9d20a82d85dc1479317f71Tripp skewY: function(y)
828c58761d90445b8b9d20a82d85dc1479317f71Tripp * Applies a rotation.
828c58761d90445b8b9d20a82d85dc1479317f71Tripp * @method rotate
828c58761d90445b8b9d20a82d85dc1479317f71Tripp this._updateTransform("rotate", /rotate\(.*\)/, rotate);
828c58761d90445b8b9d20a82d85dc1479317f71Tripp * An array of x, y values which indicates the transformOrigin in which to rotate the shape. Valid values range between 0 and 1 representing a
828c58761d90445b8b9d20a82d85dc1479317f71Tripp * fraction of the shape's corresponding bounding box dimension. The default value is [0.5, 0.5].
828c58761d90445b8b9d20a82d85dc1479317f71Tripp * @attribute transformOrigin
828c58761d90445b8b9d20a82d85dc1479317f71Tripp * @type Array
828c58761d90445b8b9d20a82d85dc1479317f71Tripp _transformOrigin: function(x, y)
828c58761d90445b8b9d20a82d85dc1479317f71Tripp node.style.MozTransformOrigin = (100 * x) + "% " + (100 * y) + "%";
828c58761d90445b8b9d20a82d85dc1479317f71Tripp * Applies a scale transform
828c58761d90445b8b9d20a82d85dc1479317f71Tripp * @method scale
828c58761d90445b8b9d20a82d85dc1479317f71Tripp * @param {Number} val
828c58761d90445b8b9d20a82d85dc1479317f71Tripp * Applies a matrix transformation
828c58761d90445b8b9d20a82d85dc1479317f71Tripp * @method matrix
828c58761d90445b8b9d20a82d85dc1479317f71Tripp matrix: function(a, b, c, d, e, f)
828c58761d90445b8b9d20a82d85dc1479317f71Tripp transform = node.style.MozTransform || node.style.webkitTransform || node.style.msTransform || node.style.OTransform,
828c58761d90445b8b9d20a82d85dc1479317f71Tripp transformOrigin = (100 * transformOrigin[0]) + "% " + (100 * transformOrigin[1]) + "%";
828c58761d90445b8b9d20a82d85dc1479317f71Tripp _draw: function()
828c58761d90445b8b9d20a82d85dc1479317f71Tripp * Completes a shape or drawing
828c58761d90445b8b9d20a82d85dc1479317f71Tripp * @method _paint
828c58761d90445b8b9d20a82d85dc1479317f71Tripp _paint: function()
c7ba96d16d58075a9ab8d5c1e46c6c83ce11cb4eTripp this._context.clearRect(0, 0, node.width, node.height);
828c58761d90445b8b9d20a82d85dc1479317f71Tripp for(; i < len; ++i)
c7ba96d16d58075a9ab8d5c1e46c6c83ce11cb4eTripp argsLen = args[0] == "quadraticCurveTo" ? args.length : 3;
828c58761d90445b8b9d20a82d85dc1479317f71Tripp args.unshift(this._xcoords[i] - this._left, this._ycoords[i] - this._top);
828c58761d90445b8b9d20a82d85dc1479317f71Tripp if (this._stroke) {
828c58761d90445b8b9d20a82d85dc1479317f71Tripp * Draws a dashed line between two points.
828c58761d90445b8b9d20a82d85dc1479317f71Tripp * @method _drawDashedLine
828c58761d90445b8b9d20a82d85dc1479317f71Tripp * @param {Number} xStart The x position of the start of the line
828c58761d90445b8b9d20a82d85dc1479317f71Tripp * @param {Number} yStart The y position of the start of the line
828c58761d90445b8b9d20a82d85dc1479317f71Tripp * @param {Number} xEnd The x position of the end of the line
828c58761d90445b8b9d20a82d85dc1479317f71Tripp * @param {Number} yEnd The y position of the end of the line
828c58761d90445b8b9d20a82d85dc1479317f71Tripp delta = Math.sqrt(Math.pow(xDelta, 2) + Math.pow(yDelta, 2)),
828c58761d90445b8b9d20a82d85dc1479317f71Tripp segmentCount = Math.floor(Math.abs(delta / segmentLength)),
828c58761d90445b8b9d20a82d85dc1479317f71Tripp context.lineTo(xCurrent + Math.cos(radians) * dashsize, yCurrent + Math.sin(radians) * dashsize);
828c58761d90445b8b9d20a82d85dc1479317f71Tripp delta = Math.sqrt((xEnd - xCurrent) * (xEnd - xCurrent) + (yEnd - yCurrent) * (yEnd - yCurrent));
828c58761d90445b8b9d20a82d85dc1479317f71Tripp context.lineTo(xCurrent + Math.cos(radians) * dashsize, yCurrent + Math.sin(radians) * dashsize);
828c58761d90445b8b9d20a82d85dc1479317f71Tripp context.lineTo(xCurrent + Math.cos(radians) * delta, yCurrent + Math.sin(radians) * delta);
828c58761d90445b8b9d20a82d85dc1479317f71Tripp * Clears the graphics object.
828c58761d90445b8b9d20a82d85dc1479317f71Tripp * @method clear
828c58761d90445b8b9d20a82d85dc1479317f71Tripp clear: function() {
c7ba96d16d58075a9ab8d5c1e46c6c83ce11cb4eTripp this._context.clearRect(0, 0, this.node.width, this.node.height);
c7ba96d16d58075a9ab8d5c1e46c6c83ce11cb4eTripp return this;
a89ad754cce3cfc8aee71760e10217b54020360dTripp * Returns the bounds for a shape.
a89ad754cce3cfc8aee71760e10217b54020360dTripp * @method getBounds
a89ad754cce3cfc8aee71760e10217b54020360dTripp * @return Object
c7ba96d16d58075a9ab8d5c1e46c6c83ce11cb4eTripp sinRadians = parseFloat(parseFloat(Math.sin(rotation * radCon)).toFixed(8)),
c7ba96d16d58075a9ab8d5c1e46c6c83ce11cb4eTripp cosRadians = parseFloat(parseFloat(Math.cos(rotation * radCon)).toFixed(8)),
c7ba96d16d58075a9ab8d5c1e46c6c83ce11cb4eTripp tlx = this._getRotatedCornerX(x, y, tox, toy, cosRadians, sinRadians);
c7ba96d16d58075a9ab8d5c1e46c6c83ce11cb4eTripp tly = this._getRotatedCornerY(x, y, tox, toy, cosRadians, sinRadians);
c7ba96d16d58075a9ab8d5c1e46c6c83ce11cb4eTripp blx = this._getRotatedCornerX(x, bottom, tox, toy, cosRadians, sinRadians);
c7ba96d16d58075a9ab8d5c1e46c6c83ce11cb4eTripp bly = this._getRotatedCornerY(x, bottom, tox, toy, cosRadians, sinRadians);
c7ba96d16d58075a9ab8d5c1e46c6c83ce11cb4eTripp brx = this._getRotatedCornerX(right, bottom, tox, toy, cosRadians, sinRadians);
c7ba96d16d58075a9ab8d5c1e46c6c83ce11cb4eTripp bry = this._getRotatedCornerY(right, bottom, tox, toy, cosRadians, sinRadians);
c7ba96d16d58075a9ab8d5c1e46c6c83ce11cb4eTripp trx = this._getRotatedCornerX(right, y, tox, toy, cosRadians, sinRadians);
c7ba96d16d58075a9ab8d5c1e46c6c83ce11cb4eTripp trY = this._getRotatedCornerY(right, y, tox, toy, cosRadians, sinRadians);
c7ba96d16d58075a9ab8d5c1e46c6c83ce11cb4eTripp bounds.left = Math.min(tlx, Math.min(blx, Math.min(brx, trx)));
c7ba96d16d58075a9ab8d5c1e46c6c83ce11cb4eTripp bounds.right = Math.max(tlx, Math.max(blx, Math.max(brx, trx)));
c7ba96d16d58075a9ab8d5c1e46c6c83ce11cb4eTripp bounds.top = Math.min(tly, Math.min(bly, Math.min(bry, trY)));
c7ba96d16d58075a9ab8d5c1e46c6c83ce11cb4eTripp bounds.bottom = Math.max(tly, Math.max(bly, Math.max(bry, trY)));
c7ba96d16d58075a9ab8d5c1e46c6c83ce11cb4eTripp * Returns the x coordinate for a bounding box's corner based on the corner's original x/y coordinates, rotation and transform origin of the rotation.
c7ba96d16d58075a9ab8d5c1e46c6c83ce11cb4eTripp * @method _getRotatedCornerX
c7ba96d16d58075a9ab8d5c1e46c6c83ce11cb4eTripp * @param {Number} x original x-coordinate of corner
c7ba96d16d58075a9ab8d5c1e46c6c83ce11cb4eTripp * @param {Number} y original y-coordinate of corner
c7ba96d16d58075a9ab8d5c1e46c6c83ce11cb4eTripp * @param {Number} tox transform origin x-coordinate of rotation
c7ba96d16d58075a9ab8d5c1e46c6c83ce11cb4eTripp * @param {Number} toy transform origin y-coordinate of rotation
c7ba96d16d58075a9ab8d5c1e46c6c83ce11cb4eTripp * @param {Number} cosRadians cosine (in radians) of rotation
c7ba96d16d58075a9ab8d5c1e46c6c83ce11cb4eTripp * @param {Number} sinRadians sin (in radians) or rotation
c7ba96d16d58075a9ab8d5c1e46c6c83ce11cb4eTripp * @return Number
c7ba96d16d58075a9ab8d5c1e46c6c83ce11cb4eTripp _getRotatedCornerX: function(x, y, tox, toy, cosRadians, sinRadians)
c7ba96d16d58075a9ab8d5c1e46c6c83ce11cb4eTripp return (tox + (x - tox) * cosRadians + (y - toy) * sinRadians);
c7ba96d16d58075a9ab8d5c1e46c6c83ce11cb4eTripp * Returns the y coordinate for a bounding box's corner based on the corner's original x/y coordinates, rotation and transform origin of the rotation.
c7ba96d16d58075a9ab8d5c1e46c6c83ce11cb4eTripp * @method _getRotatedCornerY
c7ba96d16d58075a9ab8d5c1e46c6c83ce11cb4eTripp * @param {Number} x original x-coordinate of corner
c7ba96d16d58075a9ab8d5c1e46c6c83ce11cb4eTripp * @param {Number} y original y-coordinate of corner
c7ba96d16d58075a9ab8d5c1e46c6c83ce11cb4eTripp * @param {Number} tox transform origin x-coordinate of rotation
c7ba96d16d58075a9ab8d5c1e46c6c83ce11cb4eTripp * @param {Number} toy transform origin y-coordinate of rotation
c7ba96d16d58075a9ab8d5c1e46c6c83ce11cb4eTripp * @param {Number} cosRadians cosine (in radians) of rotation
c7ba96d16d58075a9ab8d5c1e46c6c83ce11cb4eTripp * @param {Number} sinRadians sin (in radians) or rotation
c7ba96d16d58075a9ab8d5c1e46c6c83ce11cb4eTripp * @return Number
c7ba96d16d58075a9ab8d5c1e46c6c83ce11cb4eTripp _getRotatedCornerY: function(x, y, tox, toy, cosRadians, sinRadians)
c7ba96d16d58075a9ab8d5c1e46c6c83ce11cb4eTripp return (toy - (x - tox) * sinRadians + (y - toy) * cosRadians);
a89ad754cce3cfc8aee71760e10217b54020360dTripp destroy: function()
828c58761d90445b8b9d20a82d85dc1479317f71Tripp * An array of x, y values which indicates the transformOrigin in which to rotate the shape. Valid values range between 0 and 1 representing a
828c58761d90445b8b9d20a82d85dc1479317f71Tripp * fraction of the shape's corresponding bounding box dimension. The default value is [0.5, 0.5].
828c58761d90445b8b9d20a82d85dc1479317f71Tripp * @attribute transformOrigin
828c58761d90445b8b9d20a82d85dc1479317f71Tripp * @type Array
828c58761d90445b8b9d20a82d85dc1479317f71Tripp valueFn: function()
828c58761d90445b8b9d20a82d85dc1479317f71Tripp * The rotation (in degrees) of the shape.
828c58761d90445b8b9d20a82d85dc1479317f71Tripp * @attribute rotation
828c58761d90445b8b9d20a82d85dc1479317f71Tripp * @type Number
828c58761d90445b8b9d20a82d85dc1479317f71Tripp getter: function()
828c58761d90445b8b9d20a82d85dc1479317f71Tripp return this._rotation;
828c58761d90445b8b9d20a82d85dc1479317f71Tripp * Dom node of the shape
828c58761d90445b8b9d20a82d85dc1479317f71Tripp * @attribute node
828c58761d90445b8b9d20a82d85dc1479317f71Tripp * @type HTMLElement
828c58761d90445b8b9d20a82d85dc1479317f71Tripp * @readOnly
828c58761d90445b8b9d20a82d85dc1479317f71Tripp getter: function()
828c58761d90445b8b9d20a82d85dc1479317f71Tripp return this.node;
828c58761d90445b8b9d20a82d85dc1479317f71Tripp * Unique id for class instance.
828c58761d90445b8b9d20a82d85dc1479317f71Tripp * @attribute id
828c58761d90445b8b9d20a82d85dc1479317f71Tripp * @type String
828c58761d90445b8b9d20a82d85dc1479317f71Tripp valueFn: function()
828c58761d90445b8b9d20a82d85dc1479317f71Tripp return Y.guid();
e7c7565d9550eaa87043aef0df77125ada996deaTripp * Indicates the width of the shape
828c58761d90445b8b9d20a82d85dc1479317f71Tripp * @attribute width
e7c7565d9550eaa87043aef0df77125ada996deaTripp * @type Number
e7c7565d9550eaa87043aef0df77125ada996deaTripp * Indicates the height of the shape
828c58761d90445b8b9d20a82d85dc1479317f71Tripp * @attribute height
e7c7565d9550eaa87043aef0df77125ada996deaTripp * @type Number
e7c7565d9550eaa87043aef0df77125ada996deaTripp * Indicates the x position of shape.
e7c7565d9550eaa87043aef0df77125ada996deaTripp * @attribute x
e7c7565d9550eaa87043aef0df77125ada996deaTripp * @type Number
e7c7565d9550eaa87043aef0df77125ada996deaTripp * Indicates the y position of shape.
e7c7565d9550eaa87043aef0df77125ada996deaTripp * @attribute y
e7c7565d9550eaa87043aef0df77125ada996deaTripp * @type Number
828c58761d90445b8b9d20a82d85dc1479317f71Tripp * Indicates whether the shape is visible.
828c58761d90445b8b9d20a82d85dc1479317f71Tripp * @attribute visible
828c58761d90445b8b9d20a82d85dc1479317f71Tripp * @type Boolean
828c58761d90445b8b9d20a82d85dc1479317f71Tripp * Contains information about the fill of the shape.
828c58761d90445b8b9d20a82d85dc1479317f71Tripp * <dt>color</dt><dd>The color of the fill.</dd>
828c58761d90445b8b9d20a82d85dc1479317f71Tripp * <dt>opacity</dt><dd>Number between 0 and 1 that indicates the opacity of the fill. The default value is 1.</dd>
e7c7565d9550eaa87043aef0df77125ada996deaTripp * <dt>type</dt><dd>Type of fill.
e7c7565d9550eaa87043aef0df77125ada996deaTripp * <dt>solid</dt><dd>Solid single color fill. (default)</dd>
e7c7565d9550eaa87043aef0df77125ada996deaTripp * <dt>linear</dt><dd>Linear gradient fill.</dd>
e7c7565d9550eaa87043aef0df77125ada996deaTripp * <dt>radial</dt><dd>Radial gradient fill.</dd>
e7c7565d9550eaa87043aef0df77125ada996deaTripp * <p>If a gradient (linear or radial) is specified as the fill type. The following properties are used:
e7c7565d9550eaa87043aef0df77125ada996deaTripp * <dt>stops</dt><dd>An array of objects containing the following properties:
e7c7565d9550eaa87043aef0df77125ada996deaTripp * <dt>color</dt><dd>The color of the stop.</dd>
e7c7565d9550eaa87043aef0df77125ada996deaTripp * <dt>opacity</dt><dd>Number between 0 and 1 that indicates the opacity of the stop. The default value is 1. Note: No effect for IE <= 8</dd>
e7c7565d9550eaa87043aef0df77125ada996deaTripp * <dt>offset</dt><dd>Number between 0 and 1 indicating where the color stop is positioned.</dd>
e7c7565d9550eaa87043aef0df77125ada996deaTripp * <dt></dt><dd></dd>
e7c7565d9550eaa87043aef0df77125ada996deaTripp * <dt></dt><dd></dd>
e7c7565d9550eaa87043aef0df77125ada996deaTripp * <dt></dt><dd></dd>
828c58761d90445b8b9d20a82d85dc1479317f71Tripp * @attribute fill
828c58761d90445b8b9d20a82d85dc1479317f71Tripp * @type Object
828c58761d90445b8b9d20a82d85dc1479317f71Tripp * Contains information about the stroke of the shape.
828c58761d90445b8b9d20a82d85dc1479317f71Tripp * <dt>color</dt><dd>The color of the stroke.</dd>
828c58761d90445b8b9d20a82d85dc1479317f71Tripp * <dt>weight</dt><dd>Number that indicates the width of the stroke.</dd>
828c58761d90445b8b9d20a82d85dc1479317f71Tripp * <dt>opacity</dt><dd>Number between 0 and 1 that indicates the opacity of the stroke. The default value is 1.</dd>
828c58761d90445b8b9d20a82d85dc1479317f71Tripp * <dt>dashstyle</dt>Indicates whether to draw a dashed stroke. When set to "none", a solid stroke is drawn. When set to an array, the first index indicates the
828c58761d90445b8b9d20a82d85dc1479317f71Tripp * length of the dash. The second index indicates the length of gap.
828c58761d90445b8b9d20a82d85dc1479317f71Tripp * @attribute stroke
828c58761d90445b8b9d20a82d85dc1479317f71Tripp * @type Object
828c58761d90445b8b9d20a82d85dc1479317f71Tripp var tmpl = this.get("stroke") || this._getDefaultStroke();
828c58761d90445b8b9d20a82d85dc1479317f71Tripp * Indicates whether or not the instance will size itself based on its contents.
828c58761d90445b8b9d20a82d85dc1479317f71Tripp * @attribute autoSize
828c58761d90445b8b9d20a82d85dc1479317f71Tripp * @type Boolean
828c58761d90445b8b9d20a82d85dc1479317f71Tripp * Determines whether the instance will receive mouse events.
828c58761d90445b8b9d20a82d85dc1479317f71Tripp * @attribute pointerEvents
828c58761d90445b8b9d20a82d85dc1479317f71Tripp * @type string
828c58761d90445b8b9d20a82d85dc1479317f71Tripp * Reference to the container Graphic.
828c58761d90445b8b9d20a82d85dc1479317f71Tripp * @attribute graphic
828c58761d90445b8b9d20a82d85dc1479317f71Tripp * @type Graphic
828c58761d90445b8b9d20a82d85dc1479317f71Tripp getter: function()
828c58761d90445b8b9d20a82d85dc1479317f71Tripp return this._graphic;