From 73ad904de60b0b6bad768ac622fa59021592fbca Mon Sep 17 00:00:00 2001 From: Eric Rowell Date: Thu, 14 Jun 2012 02:19:51 -0700 Subject: [PATCH] updated jsdocs --- dist/kinetic-core.js | 221 +++++++++++++++++++++++++++++++++-- dist/kinetic-core.min.js | 2 +- src/Node.js | 38 +++++- src/Shape.js | 37 +++++- src/Stage.js | 12 ++ src/shapes/Circle.js | 4 + src/shapes/Image.js | 14 +++ src/shapes/Line.js | 10 ++ src/shapes/Path.js | 10 +- src/shapes/Polygon.js | 4 +- src/shapes/Rect.js | 12 ++ src/shapes/RegularPolygon.js | 8 ++ src/shapes/Sprite.js | 12 ++ src/shapes/Star.js | 12 ++ src/shapes/Text.js | 46 +++++++- 15 files changed, 428 insertions(+), 14 deletions(-) diff --git a/dist/kinetic-core.js b/dist/kinetic-core.js index e3bf0ac1..daca83b4 100644 --- a/dist/kinetic-core.js +++ b/dist/kinetic-core.js @@ -3,7 +3,7 @@ * http://www.kineticjs.com/ * Copyright 2012, Eric Rowell * Licensed under the MIT or GPL Version 2 licenses. - * Date: Jun 12 2012 + * Date: Jun 14 2012 * * Copyright (C) 2011 - 2012 by Eric Rowell * @@ -1199,21 +1199,29 @@ Kinetic.GlobalObject.addGetters(Kinetic.Node, ['scale', 'x', 'y', 'detectionType /** * set node x position + * @name setX + * @methodOf Kinetic.Node.prototype * @param {Number} x */ /** * set node y position + * @name setY + * @methodOf Kinetic.Node.prototype * @param {Number} y */ /** * set detection type + * @name setDetectionType + * @methodOf Kinetic.Node.prototype * @param {String} type can be "path" or "pixel" */ /** * set node rotation in radians + * @name setRotation + * @methodOf Kinetic.Node.prototype * @param {Number} theta */ @@ -1221,16 +1229,22 @@ Kinetic.GlobalObject.addGetters(Kinetic.Node, ['scale', 'x', 'y', 'detectionType * set alpha. Alpha values range from 0 to 1. * A node with an alpha of 0 is fully transparent, and a node * with an alpha of 1 is fully opaque + * @name setAlpha + * @methodOf Kinetic.Node.prototype * @param {Object} alpha */ /** * set drag constraint + * @name setDragConstraint + * @methodOf Kinetic.Node.prototype * @param {String} constraint */ /** * set drag bounds + * @name setDragBounds + * @methodOf Kinetic.Node.prototype * @param {Object} bounds * @config {Number} [left] left bounds position * @config {Number} [top] top bounds position @@ -1240,48 +1254,70 @@ Kinetic.GlobalObject.addGetters(Kinetic.Node, ['scale', 'x', 'y', 'detectionType /** * get scale + * @name getScale + * @methodOf Kinetic.Node.prototype */ /** * get node x position + * @name getX + * @methodOf Kinetic.Node.prototype */ /** * get node y position + * @name getY + * @methodOf Kinetic.Node.prototype */ /** * get detection type + * @name getDetectionType + * @methodOf Kinetic.Node.prototype */ /** * get rotation in radians + * @name getRotation + * @methodOf Kinetic.Node.prototype */ /** * get alpha. Alpha values range from 0 to 1. * A node with an alpha of 0 is fully transparent, and a node * with an alpha of 1 is fully opaque + * @name getAlpha + * @methodOf Kinetic.Node.prototype */ /** * get name + * @name getName + * @methodOf Kinetic.Node.prototype */ /** * get id + * @name getId + * @methodOf Kinetic.Node.prototype */ /** - * get center offset + * get offset + * @name getOffset + * @methodOf Kinetic.Node.prototype */ /** * get drag constraint + * @name getDragConstraint + * @methodOf Kinetic.Node.prototype */ /** * get drag bounds + * @name getDragBounds + * @methodOf Kinetic.Node.prototype */ /////////////////////////////////////////////////////////////////////// // Container @@ -2494,23 +2530,33 @@ Kinetic.GlobalObject.addGetters(Kinetic.Stage, ['width', 'height', 'throttle']); /** * get width + * @name getWidth + * @methodOf Kinetic.Stage.prototype */ /** * get height + * @name getHeight + * @methodOf Kinetic.Stage.prototype */ /** * get throttle + * @name getThrottle + * @methodOf Kinetic.Stage.prototype */ /** * set width + * @name setWidth + * @methodOf Kinetic.Stage.prototype * @param {Number} width */ /** * set height + * @name setHeight + * @methodOf Kinetic.Stage.prototype * @param {Number} height */ @@ -2519,6 +2565,8 @@ Kinetic.GlobalObject.addGetters(Kinetic.Stage, ['width', 'height', 'throttle']); * the number of mousemove and touchmove event detections, * and decreasing the throttle will decrease the number * of mousemove and touchmove events which improves performance + * @name setThrottle + * @methodOf Kinetic.Stage.prototype * @param {Number} throttle */ /////////////////////////////////////////////////////////////////////// @@ -2808,7 +2856,7 @@ Kinetic.Shape.prototype = { context.save(); var fill = this.attrs.fill; - + if(!!fill) { if(!this.appliedShadow) { appliedShadow = this._applyShadow(); @@ -2881,6 +2929,9 @@ Kinetic.Shape.prototype = { }, /** * helper method to fill text and appy shadows if needed + * @param {String} text + * @param {Number} x + * @param {Number} y */ fillText: function(text, x, y) { var appliedShadow = false; @@ -2902,6 +2953,9 @@ Kinetic.Shape.prototype = { /** * helper method to stroke text and apply shadows * if needed + * @param {String} text + * @param {Number} x + * @param {Number} y */ strokeText: function(text, x, y) { var appliedShadow = false; @@ -3084,6 +3138,7 @@ Kinetic.Shape.prototype = { }; // extend Node Kinetic.GlobalObject.extend(Kinetic.Shape, Kinetic.Node); + // add setters and getters Kinetic.GlobalObject.addSetters(Kinetic.Shape, ['fill', 'stroke', 'lineJoin', 'strokeWidth', 'shadow', 'drawFunc']); Kinetic.GlobalObject.addGetters(Kinetic.Shape, ['fill', 'stroke', 'lineJoin', 'strokeWidth', 'shadow', 'drawFunc']); @@ -3091,53 +3146,81 @@ Kinetic.GlobalObject.addGetters(Kinetic.Shape, ['fill', 'stroke', 'lineJoin', 's /** * set fill which can be a color, linear gradient object, * radial gradient object, or pattern object + * @name setFill + * @methodOf Kinetic.Shape.prototype * @param {String|Object} fill */ /** * set stroke color + * @name setStroke + * @methodOf Kinetic.Shape.prototype * @param {String} stroke */ /** * set line join + * @name setLineJoin + * @methodOf Kinetic.Shape.prototype * @param {String} lineJoin. Can be miter, round, or bevel. The * default is miter */ /** * set stroke width + * @name setStrokeWidth + * @methodOf Kinetic.Shape.prototype * @param {Number} strokeWidth */ /** * set shadow object + * @name setShadow + * @methodOf Kinetic.Shape.prototype * @param {Object} config */ /** * set draw function + * @name setDrawFunc + * @methodOf Kinetic.Shape.prototype * @param {Function} drawFunc drawing function */ /** * get fill + * @name getFill + * @methodOf Kinetic.Shape.prototype */ /** * get stroke color + * @name getStrokeColor + * @methodOf Kinetic.Shape.prototype */ /** * get line join + * @name getLineJoin + * @methodOf Kinetic.Shape.prototype */ /** * get stroke width + * @name getStrokeWidth + * @methodOf Kinetic.Shape.prototype */ /** * get shadow object + * @name getShadow + * @methodOf Kinetic.Shape.prototype + */ + +/** + * get draw function + * @name getDrawFunc + * @methodOf Kinetic.Shape.prototype */ /////////////////////////////////////////////////////////////////////// // Rect @@ -3215,29 +3298,41 @@ Kinetic.GlobalObject.addGetters(Kinetic.Rect, ['width', 'height', 'cornerRadius' /** * set width + * @name setWidth + * @methodOf Kinetic.Rect.prototype * @param {Number} width */ /** * set height + * @name setHeight + * @methodOf Kinetic.Rect.prototype * @param {Number} height */ /** * set corner radius + * @name setCornerRadius + * @methodOf Kinetic.Rect.prototype * @param {Number} radius */ /** * get width + * @name getWidth + * @methodOf Kinetic.Rect.prototype */ /** * get height + * @name getHeight + * @methodOf Kinetic.Rect.prototype */ /** * get corner radius + * @name getCornerRadius + * @methodOf Kinetic.Rect.prototype */ /////////////////////////////////////////////////////////////////////// // Circle @@ -3275,11 +3370,15 @@ Kinetic.GlobalObject.addGetters(Kinetic.Circle, ['radius']); /** * set radius + * @name setRadius + * @methodOf Kinetic.Circle.prototype * @param {Number} radius */ /** * get radius + * @name getRadius + * @methodOf Kinetic.Circle.prototype */ /////////////////////////////////////////////////////////////////////// // Image @@ -3368,33 +3467,47 @@ Kinetic.GlobalObject.addGetters(Kinetic.Image, ['crop', 'height', 'width', 'imag /** * set width + * @name setWidth + * @methodOf Kinetic.Image.prototype * @param {Number} width */ /** * set height + * @name setHeight + * @methodOf Kinetic.Image.prototype * @param {Number} height */ /** * set image + * @name setImage + * @methodOf Kinetic.Image.prototype * @param {ImageObject} image */ /** * get crop + * @name getCrop + * @methodOf Kinetic.Image.prototype */ /** * get width + * @name getWidth + * @methodOf Kinetic.Image.prototype */ /** * get height + * @name getHeight + * @methodOf Kinetic.Image.prototype */ /** * get image + * @name getImage + * @methodOf Kinetic.Image.prototype */ /////////////////////////////////////////////////////////////////////// // Sprite @@ -3481,29 +3594,41 @@ Kinetic.GlobalObject.addGetters(Kinetic.Sprite, ['animation', 'animations', 'ind /** * set animation key + * @name setAnimation + * @methodOf Kinetic.Sprite.prototype * @param {String} anim animation key */ /** * set animations obect + * @name setAnimations + * @methodOf Kinetic.Sprite.prototype * @param {Object} animations */ /** * set animation frame index + * @name setIndex + * @methodOf Kinetic.Sprite.prototype * @param {Integer} index frame index */ /** * get animation key + * @name getAnimation + * @methodOf Kinetic.Sprite.prototype */ /** * get animations object + * @name getAnimations + * @methodOf Kinetic.Sprite.prototype */ /** * get animation frame index + * @name getIndex + * @methodOf Kinetic.Sprite.prototype */ /////////////////////////////////////////////////////////////////////// // Polygon @@ -3540,7 +3665,7 @@ Kinetic.Polygon = function(config) { Kinetic.Polygon.prototype = { /** * set points array - * @param {Array} can be an array of point objects or an array + * @param {Array} points can be an array of point objects or an array * of Numbers. e.g. [{x:1,y:2},{x:3,y:4}] or [1,2,3,4] */ setPoints: function(points) { @@ -3558,6 +3683,8 @@ Kinetic.GlobalObject.addGetters(Kinetic.Polygon, ['points']); /** * get points array + * @name getPoints + * @methodOf Kinetic.Polygon.prototype */ /////////////////////////////////////////////////////////////////////// // RegularPolygon @@ -3601,19 +3728,27 @@ Kinetic.GlobalObject.addGetters(Kinetic.Rect, ['radius', 'sides']); /** * set radius + * @name setRadius + * @methodOf Kinetic.RegularPolygon.prototype * @param {Number} radius */ /** * set number of sides + * @name setSides + * @methodOf Kinetic.RegularPolygon.prototype * @param {int} sides */ /** * get radius + * @name getRadius + * @methodOf Kinetic.RegularPolygon.prototype */ /** * get number of sides + * @name getSides + * @methodOf Kinetic.RegularPolygon.prototype */ /////////////////////////////////////////////////////////////////////// // Star @@ -3660,29 +3795,41 @@ Kinetic.GlobalObject.addGetters(Kinetic.Star, ['numPoints', 'innerRadius', 'oute /** * set number of points + * @name setNumPoints + * @methodOf Kinetic.Star.prototype * @param {Integer} points */ /** * set outer radius + * @name setOuterRadius + * @methodOf Kinetic.Star.prototype * @param {Number} radius */ /** * set inner radius + * @name setInnerRadius + * @methodOf Kinetic.Star.prototype * @param {Number} radius */ /** * get number of points + * @name getNumPoints + * @methodOf Kinetic.Star.prototype */ /** * get outer radius + * @name getOuterRadius + * @methodOf Kinetic.Star.prototype */ /** * get inner radius + * @name getInnerRadius + * @methodOf Kinetic.Star.prototype */ /////////////////////////////////////////////////////////////////////// // Text @@ -3820,101 +3967,145 @@ Kinetic.GlobalObject.addGetters(Kinetic.Text, ['fontFamily', 'fontSize', 'fontSt /** * set font family + * @name setFontFamily + * @methodOf Kinetic.Text.prototype * @param {String} fontFamily */ /** * set font size + * @name setFontSize + * @methodOf Kinetic.Text.prototype * @param {int} fontSize */ /** * set font style. Can be "normal", "italic", or "bold". "normal" is the default. + * @name setFontStyle + * @methodOf Kinetic.Text.prototype * @param {String} fontStyle */ /** * set text fill color + * @name setFontFill + * @methodOf Kinetic.Text.prototype * @param {String} textFill */ /** * set text stroke color + * @name setFontStroke + * @methodOf Kinetic.Text.prototype * @param {String} textStroke */ /** * set text stroke width + * @name setTextStrokeWidth + * @methodOf Kinetic.Text.prototype * @param {int} textStrokeWidth */ /** * set padding + * @name setPadding + * @methodOf Kinetic.Text.prototype * @param {int} padding */ /** * set horizontal align of text + * @name setAlign + * @methodOf Kinetic.Text.prototype * @param {String} align align can be 'left', 'center', or 'right' */ /** * set vertical align of text + * @name setVerticalAlign + * @methodOf Kinetic.Text.prototype * @param {String} verticalAlign verticalAlign can be "top", "middle", or "bottom" */ /** * set text + * @name setText + * @methodOf Kinetic.Text.prototype * @param {String} text */ /** * set width + * @name setWidth + * @methodOf Kinetic.Text.prototype * @param {Number} width */ /** * get font family + * @name getFontFamily + * @methodOf Kinetic.Text.prototype */ /** * get font size + * @name getFontSize + * @methodOf Kinetic.Text.prototype */ /** * get font style + * @name getFontStyle + * @methodOf Kinetic.Text.prototype */ /** * get text fill color + * @name getTextFill + * @methodOf Kinetic.Text.prototype */ /** * get text stroke color + * @name getTextStroke + * @methodOf Kinetic.Text.prototype */ /** * get text stroke width + * @name getTextStrokeWidth + * @methodOf Kinetic.Text.prototype */ /** * get padding + * @name getPadding + * @methodOf Kinetic.Text.prototype */ /** * get horizontal align + * @name getAlign + * @methodOf Kinetic.Text.prototype */ /** * get vertical align + * @name getVerticalAlign + * @methodOf Kinetic.Text.prototype */ /** * get text + * @name getText + * @methodOf Kinetic.Text.prototype */ /** - * get width in pixels + * get total width including padding and borders + * @name getWidth + * @methodOf Kinetic.Text.prototype */ /////////////////////////////////////////////////////////////////////// // Line @@ -4036,6 +4227,8 @@ Kinetic.GlobalObject.addGetters(Kinetic.Line, ['dashArray', 'lineCap', 'points'] /** * set dash array. + * @name setDashArray + * @methodOf Kinetic.Line.prototype * @param {Array} dashArray * examples:
* [10, 5] dashes are 10px long and 5 pixels apart @@ -4047,19 +4240,27 @@ Kinetic.GlobalObject.addGetters(Kinetic.Line, ['dashArray', 'lineCap', 'points'] /** * set line cap. Can be butt, round, or square + * @name setLineCap + * @methodOf Kinetic.Line.prototype * @param {String} lineCap */ /** * get dash array + * @name getDashArray + * @methodOf Kinetic.Line.prototype */ /** * get line cap + * @name getLineCap + * @methodOf Kinetic.Line.prototype */ /** * get points array + * @name getPoints + * @methodOf Kinetic.Line.prototype */ /////////////////////////////////////////////////////////////////////// // SVG Path @@ -4336,13 +4537,15 @@ Kinetic.Path.prototype = { break; case 'A': var rx = p.shift(), ry = p.shift(), psi = p.shift(), fa = p.shift(), fs = p.shift(); - var x1 = cpx, y1 = cpy; cpx = p.shift(), cpy = p.shift(); + var x1 = cpx, y1 = cpy; + cpx = p.shift(), cpy = p.shift(); cmd = 'A'; points = this._convertEndpointToCenterParameterization(x1, y1, cpx, cpy, fa, fs, rx, ry, psi); break; case 'a': var rx = p.shift(), ry = p.shift(), psi = p.shift(), fa = p.shift(), fs = p.shift(); - var x1 = cpx, y1 = cpy; cpx += p.shift(), cpy += p.shift(); + var x1 = cpx, y1 = cpy; + cpx += p.shift(), cpy += p.shift(); cmd = 'A'; points = this._convertEndpointToCenterParameterization(x1, y1, cpx, cpy, fa, fs, rx, ry, psi); break; @@ -4434,11 +4637,15 @@ Kinetic.GlobalObject.addGetters(Kinetic.Path, ['data']); * also automatically parses the data string * into a data array. Currently supported SVG data: * M, m, L, l, H, h, V, v, Q, q, T, t, C, c, S, s, A, a, Z, z + * @name setData + * @methodOf Kinetic.Path.prototype * @param {String} SVG path command string */ /** * get SVG path data string + * @name getData + * @methodOf Kinetic.Path.prototype */ /* * Last updated November 2011 diff --git a/dist/kinetic-core.min.js b/dist/kinetic-core.min.js index ef7bc340..8bc89b46 100644 --- a/dist/kinetic-core.min.js +++ b/dist/kinetic-core.min.js @@ -3,7 +3,7 @@ * http://www.kineticjs.com/ * Copyright 2012, Eric Rowell * Licensed under the MIT or GPL Version 2 licenses. - * Date: Jun 12 2012 + * Date: Jun 14 2012 * * Copyright (C) 2011 - 2012 by Eric Rowell * diff --git a/src/Node.js b/src/Node.js index 54903dab..b1064265 100644 --- a/src/Node.js +++ b/src/Node.js @@ -815,21 +815,29 @@ Kinetic.GlobalObject.addGetters(Kinetic.Node, ['scale', 'x', 'y', 'detectionType /** * set node x position + * @name setX + * @methodOf Kinetic.Node.prototype * @param {Number} x */ /** * set node y position + * @name setY + * @methodOf Kinetic.Node.prototype * @param {Number} y */ /** * set detection type + * @name setDetectionType + * @methodOf Kinetic.Node.prototype * @param {String} type can be "path" or "pixel" */ /** * set node rotation in radians + * @name setRotation + * @methodOf Kinetic.Node.prototype * @param {Number} theta */ @@ -837,16 +845,22 @@ Kinetic.GlobalObject.addGetters(Kinetic.Node, ['scale', 'x', 'y', 'detectionType * set alpha. Alpha values range from 0 to 1. * A node with an alpha of 0 is fully transparent, and a node * with an alpha of 1 is fully opaque + * @name setAlpha + * @methodOf Kinetic.Node.prototype * @param {Object} alpha */ /** * set drag constraint + * @name setDragConstraint + * @methodOf Kinetic.Node.prototype * @param {String} constraint */ /** * set drag bounds + * @name setDragBounds + * @methodOf Kinetic.Node.prototype * @param {Object} bounds * @config {Number} [left] left bounds position * @config {Number} [top] top bounds position @@ -856,46 +870,68 @@ Kinetic.GlobalObject.addGetters(Kinetic.Node, ['scale', 'x', 'y', 'detectionType /** * get scale + * @name getScale + * @methodOf Kinetic.Node.prototype */ /** * get node x position + * @name getX + * @methodOf Kinetic.Node.prototype */ /** * get node y position + * @name getY + * @methodOf Kinetic.Node.prototype */ /** * get detection type + * @name getDetectionType + * @methodOf Kinetic.Node.prototype */ /** * get rotation in radians + * @name getRotation + * @methodOf Kinetic.Node.prototype */ /** * get alpha. Alpha values range from 0 to 1. * A node with an alpha of 0 is fully transparent, and a node * with an alpha of 1 is fully opaque + * @name getAlpha + * @methodOf Kinetic.Node.prototype */ /** * get name + * @name getName + * @methodOf Kinetic.Node.prototype */ /** * get id + * @name getId + * @methodOf Kinetic.Node.prototype */ /** - * get center offset + * get offset + * @name getOffset + * @methodOf Kinetic.Node.prototype */ /** * get drag constraint + * @name getDragConstraint + * @methodOf Kinetic.Node.prototype */ /** * get drag bounds + * @name getDragBounds + * @methodOf Kinetic.Node.prototype */ \ No newline at end of file diff --git a/src/Shape.js b/src/Shape.js index 67ee2d33..6de1c4ba 100644 --- a/src/Shape.js +++ b/src/Shape.js @@ -104,7 +104,7 @@ Kinetic.Shape.prototype = { context.save(); var fill = this.attrs.fill; - + if(!!fill) { if(!this.appliedShadow) { appliedShadow = this._applyShadow(); @@ -177,6 +177,9 @@ Kinetic.Shape.prototype = { }, /** * helper method to fill text and appy shadows if needed + * @param {String} text + * @param {Number} x + * @param {Number} y */ fillText: function(text, x, y) { var appliedShadow = false; @@ -198,6 +201,9 @@ Kinetic.Shape.prototype = { /** * helper method to stroke text and apply shadows * if needed + * @param {String} text + * @param {Number} x + * @param {Number} y */ strokeText: function(text, x, y) { var appliedShadow = false; @@ -380,6 +386,7 @@ Kinetic.Shape.prototype = { }; // extend Node Kinetic.GlobalObject.extend(Kinetic.Shape, Kinetic.Node); + // add setters and getters Kinetic.GlobalObject.addSetters(Kinetic.Shape, ['fill', 'stroke', 'lineJoin', 'strokeWidth', 'shadow', 'drawFunc']); Kinetic.GlobalObject.addGetters(Kinetic.Shape, ['fill', 'stroke', 'lineJoin', 'strokeWidth', 'shadow', 'drawFunc']); @@ -387,51 +394,79 @@ Kinetic.GlobalObject.addGetters(Kinetic.Shape, ['fill', 'stroke', 'lineJoin', 's /** * set fill which can be a color, linear gradient object, * radial gradient object, or pattern object + * @name setFill + * @methodOf Kinetic.Shape.prototype * @param {String|Object} fill */ /** * set stroke color + * @name setStroke + * @methodOf Kinetic.Shape.prototype * @param {String} stroke */ /** * set line join + * @name setLineJoin + * @methodOf Kinetic.Shape.prototype * @param {String} lineJoin. Can be miter, round, or bevel. The * default is miter */ /** * set stroke width + * @name setStrokeWidth + * @methodOf Kinetic.Shape.prototype * @param {Number} strokeWidth */ /** * set shadow object + * @name setShadow + * @methodOf Kinetic.Shape.prototype * @param {Object} config */ /** * set draw function + * @name setDrawFunc + * @methodOf Kinetic.Shape.prototype * @param {Function} drawFunc drawing function */ /** * get fill + * @name getFill + * @methodOf Kinetic.Shape.prototype */ /** * get stroke color + * @name getStrokeColor + * @methodOf Kinetic.Shape.prototype */ /** * get line join + * @name getLineJoin + * @methodOf Kinetic.Shape.prototype */ /** * get stroke width + * @name getStrokeWidth + * @methodOf Kinetic.Shape.prototype */ /** * get shadow object + * @name getShadow + * @methodOf Kinetic.Shape.prototype + */ + +/** + * get draw function + * @name getDrawFunc + * @methodOf Kinetic.Shape.prototype */ \ No newline at end of file diff --git a/src/Stage.js b/src/Stage.js index fa4f49c9..59b75c60 100644 --- a/src/Stage.js +++ b/src/Stage.js @@ -981,23 +981,33 @@ Kinetic.GlobalObject.addGetters(Kinetic.Stage, ['width', 'height', 'throttle']); /** * get width + * @name getWidth + * @methodOf Kinetic.Stage.prototype */ /** * get height + * @name getHeight + * @methodOf Kinetic.Stage.prototype */ /** * get throttle + * @name getThrottle + * @methodOf Kinetic.Stage.prototype */ /** * set width + * @name setWidth + * @methodOf Kinetic.Stage.prototype * @param {Number} width */ /** * set height + * @name setHeight + * @methodOf Kinetic.Stage.prototype * @param {Number} height */ @@ -1006,5 +1016,7 @@ Kinetic.GlobalObject.addGetters(Kinetic.Stage, ['width', 'height', 'throttle']); * the number of mousemove and touchmove event detections, * and decreasing the throttle will decrease the number * of mousemove and touchmove events which improves performance + * @name setThrottle + * @methodOf Kinetic.Stage.prototype * @param {Number} throttle */ \ No newline at end of file diff --git a/src/shapes/Circle.js b/src/shapes/Circle.js index c6dc8c4e..89052e9a 100644 --- a/src/shapes/Circle.js +++ b/src/shapes/Circle.js @@ -34,9 +34,13 @@ Kinetic.GlobalObject.addGetters(Kinetic.Circle, ['radius']); /** * set radius + * @name setRadius + * @methodOf Kinetic.Circle.prototype * @param {Number} radius */ /** * get radius + * @name getRadius + * @methodOf Kinetic.Circle.prototype */ \ No newline at end of file diff --git a/src/shapes/Image.js b/src/shapes/Image.js index 25ab811b..9ba8974d 100644 --- a/src/shapes/Image.js +++ b/src/shapes/Image.js @@ -85,31 +85,45 @@ Kinetic.GlobalObject.addGetters(Kinetic.Image, ['crop', 'height', 'width', 'imag /** * set width + * @name setWidth + * @methodOf Kinetic.Image.prototype * @param {Number} width */ /** * set height + * @name setHeight + * @methodOf Kinetic.Image.prototype * @param {Number} height */ /** * set image + * @name setImage + * @methodOf Kinetic.Image.prototype * @param {ImageObject} image */ /** * get crop + * @name getCrop + * @methodOf Kinetic.Image.prototype */ /** * get width + * @name getWidth + * @methodOf Kinetic.Image.prototype */ /** * get height + * @name getHeight + * @methodOf Kinetic.Image.prototype */ /** * get image + * @name getImage + * @methodOf Kinetic.Image.prototype */ \ No newline at end of file diff --git a/src/shapes/Line.js b/src/shapes/Line.js index 433f009e..f603522d 100644 --- a/src/shapes/Line.js +++ b/src/shapes/Line.js @@ -118,6 +118,8 @@ Kinetic.GlobalObject.addGetters(Kinetic.Line, ['dashArray', 'lineCap', 'points'] /** * set dash array. + * @name setDashArray + * @methodOf Kinetic.Line.prototype * @param {Array} dashArray * examples:
* [10, 5] dashes are 10px long and 5 pixels apart @@ -129,17 +131,25 @@ Kinetic.GlobalObject.addGetters(Kinetic.Line, ['dashArray', 'lineCap', 'points'] /** * set line cap. Can be butt, round, or square + * @name setLineCap + * @methodOf Kinetic.Line.prototype * @param {String} lineCap */ /** * get dash array + * @name getDashArray + * @methodOf Kinetic.Line.prototype */ /** * get line cap + * @name getLineCap + * @methodOf Kinetic.Line.prototype */ /** * get points array + * @name getPoints + * @methodOf Kinetic.Line.prototype */ \ No newline at end of file diff --git a/src/shapes/Path.js b/src/shapes/Path.js index 405684c8..8482f3a3 100644 --- a/src/shapes/Path.js +++ b/src/shapes/Path.js @@ -273,13 +273,15 @@ Kinetic.Path.prototype = { break; case 'A': var rx = p.shift(), ry = p.shift(), psi = p.shift(), fa = p.shift(), fs = p.shift(); - var x1 = cpx, y1 = cpy; cpx = p.shift(), cpy = p.shift(); + var x1 = cpx, y1 = cpy; + cpx = p.shift(), cpy = p.shift(); cmd = 'A'; points = this._convertEndpointToCenterParameterization(x1, y1, cpx, cpy, fa, fs, rx, ry, psi); break; case 'a': var rx = p.shift(), ry = p.shift(), psi = p.shift(), fa = p.shift(), fs = p.shift(); - var x1 = cpx, y1 = cpy; cpx += p.shift(), cpy += p.shift(); + var x1 = cpx, y1 = cpy; + cpx += p.shift(), cpy += p.shift(); cmd = 'A'; points = this._convertEndpointToCenterParameterization(x1, y1, cpx, cpy, fa, fs, rx, ry, psi); break; @@ -371,9 +373,13 @@ Kinetic.GlobalObject.addGetters(Kinetic.Path, ['data']); * also automatically parses the data string * into a data array. Currently supported SVG data: * M, m, L, l, H, h, V, v, Q, q, T, t, C, c, S, s, A, a, Z, z + * @name setData + * @methodOf Kinetic.Path.prototype * @param {String} SVG path command string */ /** * get SVG path data string + * @name getData + * @methodOf Kinetic.Path.prototype */ \ No newline at end of file diff --git a/src/shapes/Polygon.js b/src/shapes/Polygon.js index 68de3512..76895edb 100644 --- a/src/shapes/Polygon.js +++ b/src/shapes/Polygon.js @@ -33,7 +33,7 @@ Kinetic.Polygon = function(config) { Kinetic.Polygon.prototype = { /** * set points array - * @param {Array} can be an array of point objects or an array + * @param {Array} points can be an array of point objects or an array * of Numbers. e.g. [{x:1,y:2},{x:3,y:4}] or [1,2,3,4] */ setPoints: function(points) { @@ -51,4 +51,6 @@ Kinetic.GlobalObject.addGetters(Kinetic.Polygon, ['points']); /** * get points array + * @name getPoints + * @methodOf Kinetic.Polygon.prototype */ \ No newline at end of file diff --git a/src/shapes/Rect.js b/src/shapes/Rect.js index 232da0c5..0fb32960 100644 --- a/src/shapes/Rect.js +++ b/src/shapes/Rect.js @@ -74,27 +74,39 @@ Kinetic.GlobalObject.addGetters(Kinetic.Rect, ['width', 'height', 'cornerRadius' /** * set width + * @name setWidth + * @methodOf Kinetic.Rect.prototype * @param {Number} width */ /** * set height + * @name setHeight + * @methodOf Kinetic.Rect.prototype * @param {Number} height */ /** * set corner radius + * @name setCornerRadius + * @methodOf Kinetic.Rect.prototype * @param {Number} radius */ /** * get width + * @name getWidth + * @methodOf Kinetic.Rect.prototype */ /** * get height + * @name getHeight + * @methodOf Kinetic.Rect.prototype */ /** * get corner radius + * @name getCornerRadius + * @methodOf Kinetic.Rect.prototype */ \ No newline at end of file diff --git a/src/shapes/RegularPolygon.js b/src/shapes/RegularPolygon.js index d04cf4b6..da19e436 100644 --- a/src/shapes/RegularPolygon.js +++ b/src/shapes/RegularPolygon.js @@ -40,17 +40,25 @@ Kinetic.GlobalObject.addGetters(Kinetic.Rect, ['radius', 'sides']); /** * set radius + * @name setRadius + * @methodOf Kinetic.RegularPolygon.prototype * @param {Number} radius */ /** * set number of sides + * @name setSides + * @methodOf Kinetic.RegularPolygon.prototype * @param {int} sides */ /** * get radius + * @name getRadius + * @methodOf Kinetic.RegularPolygon.prototype */ /** * get number of sides + * @name getSides + * @methodOf Kinetic.RegularPolygon.prototype */ \ No newline at end of file diff --git a/src/shapes/Sprite.js b/src/shapes/Sprite.js index 695515df..244c153d 100644 --- a/src/shapes/Sprite.js +++ b/src/shapes/Sprite.js @@ -83,27 +83,39 @@ Kinetic.GlobalObject.addGetters(Kinetic.Sprite, ['animation', 'animations', 'ind /** * set animation key + * @name setAnimation + * @methodOf Kinetic.Sprite.prototype * @param {String} anim animation key */ /** * set animations obect + * @name setAnimations + * @methodOf Kinetic.Sprite.prototype * @param {Object} animations */ /** * set animation frame index + * @name setIndex + * @methodOf Kinetic.Sprite.prototype * @param {Integer} index frame index */ /** * get animation key + * @name getAnimation + * @methodOf Kinetic.Sprite.prototype */ /** * get animations object + * @name getAnimations + * @methodOf Kinetic.Sprite.prototype */ /** * get animation frame index + * @name getIndex + * @methodOf Kinetic.Sprite.prototype */ \ No newline at end of file diff --git a/src/shapes/Star.js b/src/shapes/Star.js index 6ee606d5..e8db5bd5 100644 --- a/src/shapes/Star.js +++ b/src/shapes/Star.js @@ -43,27 +43,39 @@ Kinetic.GlobalObject.addGetters(Kinetic.Star, ['numPoints', 'innerRadius', 'oute /** * set number of points + * @name setNumPoints + * @methodOf Kinetic.Star.prototype * @param {Integer} points */ /** * set outer radius + * @name setOuterRadius + * @methodOf Kinetic.Star.prototype * @param {Number} radius */ /** * set inner radius + * @name setInnerRadius + * @methodOf Kinetic.Star.prototype * @param {Number} radius */ /** * get number of points + * @name getNumPoints + * @methodOf Kinetic.Star.prototype */ /** * get outer radius + * @name getOuterRadius + * @methodOf Kinetic.Star.prototype */ /** * get inner radius + * @name getInnerRadius + * @methodOf Kinetic.Star.prototype */ \ No newline at end of file diff --git a/src/shapes/Text.js b/src/shapes/Text.js index 33c0ae17..c43d8dd3 100644 --- a/src/shapes/Text.js +++ b/src/shapes/Text.js @@ -134,99 +134,143 @@ Kinetic.GlobalObject.addGetters(Kinetic.Text, ['fontFamily', 'fontSize', 'fontSt /** * set font family + * @name setFontFamily + * @methodOf Kinetic.Text.prototype * @param {String} fontFamily */ /** * set font size + * @name setFontSize + * @methodOf Kinetic.Text.prototype * @param {int} fontSize */ /** * set font style. Can be "normal", "italic", or "bold". "normal" is the default. + * @name setFontStyle + * @methodOf Kinetic.Text.prototype * @param {String} fontStyle */ /** * set text fill color + * @name setFontFill + * @methodOf Kinetic.Text.prototype * @param {String} textFill */ /** * set text stroke color + * @name setFontStroke + * @methodOf Kinetic.Text.prototype * @param {String} textStroke */ /** * set text stroke width + * @name setTextStrokeWidth + * @methodOf Kinetic.Text.prototype * @param {int} textStrokeWidth */ /** * set padding + * @name setPadding + * @methodOf Kinetic.Text.prototype * @param {int} padding */ /** * set horizontal align of text + * @name setAlign + * @methodOf Kinetic.Text.prototype * @param {String} align align can be 'left', 'center', or 'right' */ /** * set vertical align of text + * @name setVerticalAlign + * @methodOf Kinetic.Text.prototype * @param {String} verticalAlign verticalAlign can be "top", "middle", or "bottom" */ /** * set text + * @name setText + * @methodOf Kinetic.Text.prototype * @param {String} text */ /** * set width + * @name setWidth + * @methodOf Kinetic.Text.prototype * @param {Number} width */ /** * get font family + * @name getFontFamily + * @methodOf Kinetic.Text.prototype */ /** * get font size + * @name getFontSize + * @methodOf Kinetic.Text.prototype */ /** * get font style + * @name getFontStyle + * @methodOf Kinetic.Text.prototype */ /** * get text fill color + * @name getTextFill + * @methodOf Kinetic.Text.prototype */ /** * get text stroke color + * @name getTextStroke + * @methodOf Kinetic.Text.prototype */ /** * get text stroke width + * @name getTextStrokeWidth + * @methodOf Kinetic.Text.prototype */ /** * get padding + * @name getPadding + * @methodOf Kinetic.Text.prototype */ /** * get horizontal align + * @name getAlign + * @methodOf Kinetic.Text.prototype */ /** * get vertical align + * @name getVerticalAlign + * @methodOf Kinetic.Text.prototype */ /** * get text + * @name getText + * @methodOf Kinetic.Text.prototype */ /** - * get width in pixels + * get total width including padding and borders + * @name getWidth + * @methodOf Kinetic.Text.prototype */ \ No newline at end of file