From b1038e99bf623186bd4ea9b5045ccfbdbd2e1e31 Mon Sep 17 00:00:00 2001 From: Eric Rowell Date: Sat, 26 Jan 2013 20:42:19 -0800 Subject: [PATCH] pulled Node config params and Shape config params into a textfile, and now using token replacement to auto fill Node and Shape config params throughout the code base. In this way, if I need to make changes to the Node or Shape configs, those changes are propagated to all of the other constructors --- Thorfile | 9 +++--- configParams/NodeParams.txt | 19 ++++++++++++ configParams/ShapeParams.txt | 34 ++++++++++++++++++++ src/Container.js | 1 + src/Global.js | 6 ++-- src/Group.js | 23 ++------------ src/Layer.js | 21 +------------ src/Node.js | 20 +----------- src/Shape.js | 55 ++------------------------------- src/Stage.js | 22 +------------ src/shapes/Blob.js | 51 ++---------------------------- src/shapes/Circle.js | 54 ++------------------------------ src/shapes/Ellipse.js | 60 ++---------------------------------- src/shapes/Image.js | 60 ++---------------------------------- src/shapes/Line.js | 60 ++---------------------------------- src/shapes/Path.js | 60 ++---------------------------------- src/shapes/Polygon.js | 60 ++---------------------------------- src/shapes/Rect.js | 56 ++------------------------------- src/shapes/RegularPolygon.js | 60 ++---------------------------------- src/shapes/Spline.js | 60 ++---------------------------------- src/shapes/Sprite.js | 60 ++---------------------------------- src/shapes/Star.js | 60 ++---------------------------------- src/shapes/Text.js | 60 ++---------------------------------- src/shapes/TextPath.js | 60 ++---------------------------------- src/shapes/Wedge.js | 60 ++---------------------------------- 25 files changed, 98 insertions(+), 993 deletions(-) create mode 100644 configParams/NodeParams.txt create mode 100644 configParams/ShapeParams.txt diff --git a/Thorfile b/Thorfile index 478d8615..32bc9056 100644 --- a/Thorfile +++ b/Thorfile @@ -143,11 +143,10 @@ class Build < Thor def replace_tokens(content, version) date = Time.now.strftime("%b %d %Y") - # Add the version number - content.gsub!("@version", version) - - # Add the date - content.sub!("@date", date) + content.gsub!("{{version}}", version) + content.sub!("{{date}}", date) + content.gsub!("{{NodeParams}}", IO.read("configParams/NodeParams.txt")) + content.gsub!("{{ShapeParams}}", IO.read("configParams/ShapeParams.txt")) return content end diff --git a/configParams/NodeParams.txt b/configParams/NodeParams.txt new file mode 100644 index 00000000..9609ef35 --- /dev/null +++ b/configParams/NodeParams.txt @@ -0,0 +1,19 @@ +@param {Number} [config.x] + * @param {Number} [config.y] + * @param {Number} [config.width] + * @param {Number} [config.height] + * @param {Boolean} [config.visible] + * @param {Boolean} [config.listening] whether or not the node is listening for events + * @param {String} [config.id] unique id + * @param {String} [config.name] non-unique name + * @param {Number} [config.opacity] determines node opacity. Can be any number between 0 and 1 + * @param {Object} [config.scale] + * @param {Number} [config.scale.x] + * @param {Number} [config.scale.y] + * @param {Number} [config.rotation] rotation in radians + * @param {Number} [config.rotationDeg] rotation in degrees + * @param {Object} [config.offset] offset from center point and rotation point + * @param {Number} [config.offset.x] + * @param {Number} [config.offset.y] + * @param {Boolean} [config.draggable] + * @param {Function} [config.dragBoundFunc] \ No newline at end of file diff --git a/configParams/ShapeParams.txt b/configParams/ShapeParams.txt new file mode 100644 index 00000000..d8b82f52 --- /dev/null +++ b/configParams/ShapeParams.txt @@ -0,0 +1,34 @@ +@param {String} [config.fill] fill color + * @param {Image} [config.fillPatternImage] fill pattern image + * @param {Number} [config.fillPatternX] + * @param {Number} [config.fillPatternY] + * @param {Array|Object} [config.fillPatternOffset] array with two elements or object with x and y component + * @param {Array|Object} [config.fillPatternScale] array with two elements or object with x and y component + * @param {Number} [config.fillPatternRotation] + * @param {String} [config.fillPatternRepeat] can be 'repeat', 'repeat-x', 'repeat-y', or 'no-repeat'. The default is 'no-repeat' +@param {Array|Object} [config.fillLinearGradientStartPoint] array with two elements or object with x and y component + * @param {Array|Object} [config.fillLinearGradientEndPoint] array with two elements or object with x and y component + * @param {Array} [config.fillLinearGradientColorStops] array of color stops + * @param {Array|Object} [config.fillRadialGradientStartPoint] array with two elements or object with x and y component + * @param {Array|Object} [config.fillRadialGradientEndPoint] array with two elements or object with x and y component + * @param {Number} [config.fillRadialGradientStartRadius] + * @param {Number} [config.fillRadialGradientEndRadius] + * @param {Array} [config.fillRadialGradientColorStops] array of color stops + * @param {Boolean} [config.fillEnabled] flag which enables or disables the fill. The default value is true + * @param {String} [config.stroke] stroke color + * @param {Number} [config.strokeWidth] stroke width + * @param {Boolean} [config.strokeEnabled] flag which enables or disables the stroke. The default value is true + * @param {String} [config.lineJoin] can be miter, round, or bevel. The default + * is miter + * @param {String} [config.lineCap] can be butt, round, or sqare. The default + * is butt + * @param {String} [config.shadowColor] + * @param {Number} [config.shadowBlur] + * @param {Obect} [config.shadowOffset] + * @param {Number} [config.shadowOffset.x] + * @param {Number} [config.shadowOffset.y] + * @param {Number} [config.shadowOpacity] shadow opacity. Can be any real number + * between 0 and 1 + * @param {Boolean} [config.shadowEnabled] flag which enables or disables the shadow. The default value is true + * @param {Array} [config.dashArray] + * @param {Boolean} [config.dashArrayEnabled] flag which enables or disables the dashArray. The default value is true \ No newline at end of file diff --git a/src/Container.js b/src/Container.js index 1dc26989..5f9ad4c4 100644 --- a/src/Container.js +++ b/src/Container.js @@ -4,6 +4,7 @@ * @constructor * @augments Kinetic.Node * @param {Object} config + * {{NodeParams}} */ Kinetic.Container = function(config) { this._containerInit(config); diff --git a/src/Global.js b/src/Global.js index a48b5585..bf871316 100644 --- a/src/Global.js +++ b/src/Global.js @@ -1,9 +1,9 @@ /** - * KineticJS JavaScript Framework v@version + * KineticJS JavaScript Framework v{{version}} * http://www.kineticjs.com/ * Copyright 2013, Eric Rowell * Licensed under the MIT or GPL Version 2 licenses. - * Date: @date + * Date: {{date}} * * Copyright (C) 2011 - 2013 by Eric Rowell * @@ -29,7 +29,7 @@ * @namespace */ var Kinetic = {}; (function() { - Kinetic.version = '@version'; + Kinetic.version = '{{version}}'; /** * @namespace */ diff --git a/src/Group.js b/src/Group.js index 669e96d8..7877419e 100644 --- a/src/Group.js +++ b/src/Group.js @@ -3,27 +3,8 @@ * Group constructor. Groups are used to contain shapes or other groups. * @constructor * @augments Kinetic.Container - * - * - * @param {Number} [config.x] - * @param {Number} [config.y] - * @param {Number} [config.width] - * @param {Number} [config.height] - * @param {Boolean} [config.visible] - * @param {Boolean} [config.listening] whether or not the node is listening for events - * @param {String} [config.id] unique id - * @param {String} [config.name] non-unique name - * @param {Number} [config.opacity] determines node opacity. Can be any number between 0 and 1 - * @param {Object} [config.scale] - * @param {Number} [config.scale.x] - * @param {Number} [config.scale.y] - * @param {Number} [config.rotation] rotation in radians - * @param {Number} [config.rotationDeg] rotation in degrees - * @param {Object} [config.offset] offset from center point and rotation point - * @param {Number} [config.offset.x] - * @param {Number} [config.offset.y] - * @param {Boolean} [config.draggable] - * @param {Function} [config.dragBoundFunc] + * @param {Object} config + * {{NodeParams}} */ Kinetic.Group = function(config) { this._initGroup(config); diff --git a/src/Layer.js b/src/Layer.js index fa179c20..b4f20d60 100644 --- a/src/Layer.js +++ b/src/Layer.js @@ -7,26 +7,7 @@ * @param {Object} config * @param {Boolean} [config.clearBeforeDraw] set this property to false if you don't want * to clear the canvas before each layer draw. The default value is true. - * - * @param {Number} [config.x] - * @param {Number} [config.y] - * @param {Number} [config.width] - * @param {Number} [config.height] - * @param {Boolean} [config.visible] - * @param {Boolean} [config.listening] whether or not the node is listening for events - * @param {String} [config.id] unique id - * @param {String} [config.name] non-unique name - * @param {Number} [config.opacity] determines node opacity. Can be any number between 0 and 1 - * @param {Object} [config.scale] - * @param {Number} [config.scale.x] - * @param {Number} [config.scale.y] - * @param {Number} [config.rotation] rotation in radians - * @param {Number} [config.rotationDeg] rotation in degrees - * @param {Object} [config.offset] offset from center point and rotation point - * @param {Number} [config.offset.x] - * @param {Number} [config.offset.y] - * @param {Boolean} [config.draggable] - * @param {Function} [config.dragBoundFunc] + * {{NodeParams}} */ Kinetic.Layer = function(config) { this._initLayer(config); diff --git a/src/Node.js b/src/Node.js index 1fb4f041..6abc0b32 100644 --- a/src/Node.js +++ b/src/Node.js @@ -4,25 +4,7 @@ * and have bound events. The stage, layers, groups, and shapes all extend Node. * @constructor * @param {Object} config - * @param {Number} [config.x] - * @param {Number} [config.y] - * @param {Number} [config.width] - * @param {Number} [config.height] - * @param {Boolean} [config.visible] - * @param {Boolean} [config.listening] whether or not the node is listening for events - * @param {String} [config.id] unique id - * @param {String} [config.name] non-unique name - * @param {Number} [config.opacity] determines node opacity. Can be any number between 0 and 1 - * @param {Object} [config.scale] - * @param {Number} [config.scale.x] - * @param {Number} [config.scale.y] - * @param {Number} [config.rotation] rotation in radians - * @param {Number} [config.rotationDeg] rotation in degrees - * @param {Object} [config.offset] offset from center point and rotation point - * @param {Number} [config.offset.x] - * @param {Number} [config.offset.y] - * @param {Boolean} [config.draggable] - * @param {Function} [config.dragBoundFunc] + * {{NodeParams}} */ Kinetic.Node = function(config) { this._nodeInit(config); diff --git a/src/Shape.js b/src/Shape.js index a88065e1..cad98ad5 100644 --- a/src/Shape.js +++ b/src/Shape.js @@ -5,59 +5,8 @@ * @constructor * @augments Kinetic.Node * @param {Object} config - * @param {String} [config.fill] fill color - * @param {Image} [config.fillPatternImage] fill pattern image - * @param {Number} [config.fillPatternX] - * @param {Number} [config.fillPatternY] - * @param {Array|Object} [config.fillPatternOffset] array with two elements or object with x and y component - * @param {Array|Object} [config.fillPatternScale] array with two elements or object with x and y component - * @param {Number} [config.fillPatternRotation] - * @param {String} [config.fillPatternRepeat] can be 'repeat', 'repeat-x', 'repeat-y', or 'no-repeat'. The default is 'no-repeat' - * @param {Array|Object} [config.fillLinearGradientStartPoint] array with two elements or object with x and y component - * @param {Array|Object} [config.fillLinearGradientEndPoint] array with two elements or object with x and y component - * @param {Array} [config.fillLinearGradientColorStops] array of color stops - * @param {Array|Object} [config.fillRadialGradientStartPoint] array with two elements or object with x and y component - * @param {Array|Object} [config.fillRadialGradientEndPoint] array with two elements or object with x and y component - * @param {Number} [config.fillRadialGradientStartRadius] - * @param {Number} [config.fillRadialGradientEndRadius] - * @param {Array} [config.fillRadialGradientColorStops] array of color stops - * @param {Boolean} [config.fillEnabled] flag which enables or disables the fill. The default value is true - * @param {String} [config.stroke] stroke color - * @param {Number} [config.strokeWidth] stroke width - * @param {Boolean} [config.strokeEnabled] flag which enables or disables the stroke. The default value is true - * @param {String} [config.lineJoin] can be miter, round, or bevel. The default - * is miter - * @param {String} [config.lineCap] can be butt, round, or sqare. The default - * is butt - * @param {String} [config.shadowColor] - * @param {Number} [config.shadowBlur] - * @param {Obect} [config.shadowOffset] - * @param {Number} [config.shadowOffset.x] - * @param {Number} [config.shadowOffset.y] - * @param {Number} [config.shadowOpacity] shadow opacity. Can be any real number - * between 0 and 1 - * @param {Boolean} [config.shadowEnabled] flag which enables or disables the shadow. The default value is true - * @param {Array} [config.dashArray] - * @param {Boolean} [config.dashArrayEnabled] flag which enables or disables the dashArray. The default value is true - * @param {Number} [config.x] - * @param {Number} [config.y] - * @param {Number} [config.width] - * @param {Number} [config.height] - * @param {Boolean} [config.visible] - * @param {Boolean} [config.listening] whether or not the node is listening for events - * @param {String} [config.id] unique id - * @param {String} [config.name] non-unique name - * @param {Number} [config.opacity] determines node opacity. Can be any number between 0 and 1 - * @param {Object} [config.scale] - * @param {Number} [config.scale.x] - * @param {Number} [config.scale.y] - * @param {Number} [config.rotation] rotation in radians - * @param {Number} [config.rotationDeg] rotation in degrees - * @param {Object} [config.offset] offset from center point and rotation point - * @param {Number} [config.offset.x] - * @param {Number} [config.offset.y] - * @param {Boolean} [config.draggable] - * @param {Function} [config.dragBoundFunc] + * {{ShapeParams}} + * {{NodeParams}} */ Kinetic.Shape = function(config) { this._initShape(config); diff --git a/src/Stage.js b/src/Stage.js index ad60f647..c883509c 100644 --- a/src/Stage.js +++ b/src/Stage.js @@ -5,27 +5,7 @@ * @augments Kinetic.Container * @param {Object} config * @param {String|DomElement} config.container Container id or DOM element - * - * - * @param {Number} [config.x] - * @param {Number} [config.y] - * @param {Number} [config.width] - * @param {Number} [config.height] - * @param {Boolean} [config.visible] - * @param {Boolean} [config.listening] whether or not the node is listening for events - * @param {String} [config.id] unique id - * @param {String} [config.name] non-unique name - * @param {Number} [config.opacity] determines node opacity. Can be any number between 0 and 1 - * @param {Object} [config.scale] - * @param {Number} [config.scale.x] - * @param {Number} [config.scale.y] - * @param {Number} [config.rotation] rotation in radians - * @param {Number} [config.rotationDeg] rotation in degrees - * @param {Object} [config.offset] offset from center point and rotation point - * @param {Number} [config.offset.x] - * @param {Number} [config.offset.y] - * @param {Boolean} [config.draggable] - * @param {Function} [config.dragBoundFunc] + * {{NodeParams}} */ Kinetic.Stage = function(config) { this._initStage(config); diff --git a/src/shapes/Blob.js b/src/shapes/Blob.js index 1fd4d0ef..155e0312 100644 --- a/src/shapes/Blob.js +++ b/src/shapes/Blob.js @@ -8,55 +8,8 @@ * @param {Array} config.points can be a flattened array of points, an array of point arrays, or an array of point objects. * e.g. [0,1,2,3], [[0,1],[2,3]] and [{x:0,y:1},{x:2,y:3}] are equivalent * @param {Number} [config.tension] default value is 1. Higher values will result in a more curvy line. A value of 0 will result in no interpolation. - * @param {String} [config.fill] fill color - * @param {Image} [config.fillPatternImage] fill pattern image - * @param {Number} [config.fillPatternX] - * @param {Number} [config.fillPatternY] - * @param {Array|Object} [config.fillPatternOffset] array with two elements or object with x and y component - * @param {Array|Object} [config.fillPatternScale] array with two elements or object with x and y component - * @param {Number} [config.fillPatternRotation] - * @param {String} [config.fillPatternRepeat] can be 'repeat', 'repeat-x', 'repeat-y', or 'no-repeat'. The default is 'no-repeat' - * @param {Array|Object} [config.fillLinearGradientStartPoint] array with two elements or object with x and y component - * @param {Array|Object} [config.fillLinearGradientEndPoint] array with two elements or object with x and y component - * @param {Array} [config.fillLinearGradientColorStops] array of color stops - * @param {Array|Object} [config.fillRadialGradientStartPoint] array with two elements or object with x and y component - * @param {Array|Object} [config.fillRadialGradientEndPoint] array with two elements or object with x and y component - * @param {Number} [config.fillRadialGradientStartRadius] - * @param {Number} [config.fillRadialGradientEndRadius] - * @param {Array} [config.fillRadialGradientColorStops] array of color stops - * @param {String} [config.stroke] stroke color - * @param {Number} [config.strokeWidth] stroke width - * @param {String} [config.lineJoin] can be miter, round, or bevel. The default - * is miter - * @param {String} [config.lineCap] can be butt, round, or sqare. The default - * is butt - * @param {String} [config.shadowColor] - * @param {Number} [config.shadowBlur] - * @param {Obect} [config.shadowOffset] - * @param {Number} [config.shadowOffset.x] - * @param {Number} [config.shadowOffset.y] - * @param {Number} [config.shadowOpacity] shadow opacity. Can be any real number - * between 0 and 1 - * @param {Array} [config.dashArray] - * @param {Number} [config.x] - * @param {Number} [config.y] - * @param {Number} [config.width] - * @param {Number} [config.height] - * @param {Boolean} [config.visible] - * @param {Boolean} [config.listening] whether or not the node is listening for events - * @param {String} [config.id] unique id - * @param {String} [config.name] non-unique name - * @param {Number} [config.opacity] determines node opacity. Can be any number between 0 and 1 - * @param {Object} [config.scale] - * @param {Number} [config.scale.x] - * @param {Number} [config.scale.y] - * @param {Number} [config.rotation] rotation in radians - * @param {Number} [config.rotationDeg] rotation in degrees - * @param {Object} [config.offset] offset from center point and rotation point - * @param {Number} [config.offset.x] - * @param {Number} [config.offset.y] - * @param {Boolean} [config.draggable] - * @param {Function} [config.dragBoundFunc] + * {{ShapeParams}} + * {{NodeParams}} */ Kinetic.Blob = function(config) { this._initBlob(config); diff --git a/src/shapes/Circle.js b/src/shapes/Circle.js index 8e59a22c..75fc217c 100644 --- a/src/shapes/Circle.js +++ b/src/shapes/Circle.js @@ -5,58 +5,8 @@ * @augments Kinetic.Shape * @param {Object} config * @param {Number} config.radius - * @param {String} [config.fill] fill color - * @param {Image} [config.fillPatternImage] fill pattern image - * @param {Number} [config.fillPatternX] - * @param {Number} [config.fillPatternY] - * @param {Array|Object} [config.fillPatternOffset] array with two elements or object with x and y component - * @param {Array|Object} [config.fillPatternScale] array with two elements or object with x and y component - * @param {Number} [config.fillPatternRotation] - * @param {String} [config.fillPatternRepeat] can be 'repeat', 'repeat-x', 'repeat-y', or 'no-repeat'. The default is 'no-repeat' - * @param {Array|Object} [config.fillLinearGradientStartPoint] array with two elements or object with x and y component - * @param {Array|Object} [config.fillLinearGradientEndPoint] array with two elements or object with x and y component - * @param {Array} [config.fillLinearGradientColorStops] array of color stops - * @param {Array|Object} [config.fillRadialGradientStartPoint] array with two elements or object with x and y component - * @param {Array|Object} [config.fillRadialGradientEndPoint] array with two elements or object with x and y component - * @param {Number} [config.fillRadialGradientStartRadius] - * @param {Number} [config.fillRadialGradientEndRadius] - * @param {Array} [config.fillRadialGradientColorStops] array of color stops - * @param {String} [config.stroke] stroke color - * @param {Number} [config.strokeWidth] stroke width - * @param {String} [config.lineJoin] can be miter, round, or bevel. The default - * is miter - * @param {String} [config.lineCap] can be butt, round, or sqare. The default - * is butt - * @param {String} [config.shadowColor] - * @param {Number} [config.shadowBlur] - * @param {Obect} [config.shadowOffset] - * @param {Number} [config.shadowOffset.x] - * @param {Number} [config.shadowOffset.y] - * @param {Number} [config.shadowOpacity] shadow opacity. Can be any real number - * between 0 and 1 - * @param {Array} [config.dashArray] - * - * - * - * @param {Number} [config.x] - * @param {Number} [config.y] - * @param {Number} [config.width] - * @param {Number} [config.height] - * @param {Boolean} [config.visible] - * @param {Boolean} [config.listening] whether or not the node is listening for events - * @param {String} [config.id] unique id - * @param {String} [config.name] non-unique name - * @param {Number} [config.opacity] determines node opacity. Can be any number between 0 and 1 - * @param {Object} [config.scale] - * @param {Number} [config.scale.x] - * @param {Number} [config.scale.y] - * @param {Number} [config.rotation] rotation in radians - * @param {Number} [config.rotationDeg] rotation in degrees - * @param {Object} [config.offset] offset from center point and rotation point - * @param {Number} [config.offset.x] - * @param {Number} [config.offset.y] - * @param {Boolean} [config.draggable] - * @param {Function} [config.dragBoundFunc] + * {{ShapeParams}} + * {{NodeParams}} */ Kinetic.Circle = function(config) { this._initCircle(config); diff --git a/src/shapes/Ellipse.js b/src/shapes/Ellipse.js index b8f05047..8e830b25 100644 --- a/src/shapes/Ellipse.js +++ b/src/shapes/Ellipse.js @@ -5,64 +5,8 @@ * @augments Kinetic.Shape * @param {Object} config * @param {Number|Array|Object} config.radius defines x and y radius - * - * - * @param {String} [config.fill] fill color - * - * @param {Image} [config.fillPatternImage] fill pattern image - * @param {Number} [config.fillPatternX] - * @param {Number} [config.fillPatternY] - * @param {Array|Object} [config.fillPatternOffset] array with two elements or object with x and y component - * @param {Array|Object} [config.fillPatternScale] array with two elements or object with x and y component - * @param {Number} [config.fillPatternRotation] - * @param {String} [config.fillPatternRepeat] can be 'repeat', 'repeat-x', 'repeat-y', or 'no-repeat'. The default is 'no-repeat' - * - * @param {Array|Object} [config.fillLinearGradientStartPoint] array with two elements or object with x and y component - * @param {Array|Object} [config.fillLinearGradientEndPoint] array with two elements or object with x and y component - * @param {Array} [config.fillLinearGradientColorStops] array of color stops - * - * @param {Array|Object} [config.fillRadialGradientStartPoint] array with two elements or object with x and y component - * @param {Array|Object} [config.fillRadialGradientEndPoint] array with two elements or object with x and y component - * @param {Number} [config.fillRadialGradientStartRadius] - * @param {Number} [config.fillRadialGradientEndRadius] - * @param {Array} [config.fillRadialGradientColorStops] array of color stops - * - * @param {String} [config.stroke] stroke color - * @param {Number} [config.strokeWidth] stroke width - * @param {String} [config.lineJoin] can be miter, round, or bevel. The default - * is miter - * @param {String} [config.lineCap] can be butt, round, or sqare. The default - * is butt - * @param {String} [config.shadowColor] - * @param {Number} [config.shadowBlur] - * @param {Obect} [config.shadowOffset] - * @param {Number} [config.shadowOffset.x] - * @param {Number} [config.shadowOffset.y] - * @param {Number} [config.shadowOpacity] shadow opacity. Can be any real number - * between 0 and 1 - * @param {Array} [config.dashArray] - * - * - * - * @param {Number} [config.x] - * @param {Number} [config.y] - * @param {Number} [config.width] - * @param {Number} [config.height] - * @param {Boolean} [config.visible] - * @param {Boolean} [config.listening] whether or not the node is listening for events - * @param {String} [config.id] unique id - * @param {String} [config.name] non-unique name - * @param {Number} [config.opacity] determines node opacity. Can be any number between 0 and 1 - * @param {Object} [config.scale] - * @param {Number} [config.scale.x] - * @param {Number} [config.scale.y] - * @param {Number} [config.rotation] rotation in radians - * @param {Number} [config.rotationDeg] rotation in degrees - * @param {Object} [config.offset] offset from center point and rotation point - * @param {Number} [config.offset.x] - * @param {Number} [config.offset.y] - * @param {Boolean} [config.draggable] - * @param {Function} [config.dragBoundFunc] + * {{ShapeParams}} + * {{NodeParams}} */ Kinetic.Ellipse = function(config) { this._initEllipse(config); diff --git a/src/shapes/Image.js b/src/shapes/Image.js index 8fcef4a3..bf9690b7 100644 --- a/src/shapes/Image.js +++ b/src/shapes/Image.js @@ -6,64 +6,8 @@ * @param {Object} config * @param {ImageObject} config.image * @param {Object} [config.crop] - * - * - * @param {String} [config.fill] fill color - * - * @param {Image} [config.fillPatternImage] fill pattern image - * @param {Number} [config.fillPatternX] - * @param {Number} [config.fillPatternY] - * @param {Array|Object} [config.fillPatternOffset] array with two elements or object with x and y component - * @param {Array|Object} [config.fillPatternScale] array with two elements or object with x and y component - * @param {Number} [config.fillPatternRotation] - * @param {String} [config.fillPatternRepeat] can be 'repeat', 'repeat-x', 'repeat-y', or 'no-repeat'. The default is 'no-repeat' - * - * @param {Array|Object} [config.fillLinearGradientStartPoint] array with two elements or object with x and y component - * @param {Array|Object} [config.fillLinearGradientEndPoint] array with two elements or object with x and y component - * @param {Array} [config.fillLinearGradientColorStops] array of color stops - * - * @param {Array|Object} [config.fillRadialGradientStartPoint] array with two elements or object with x and y component - * @param {Array|Object} [config.fillRadialGradientEndPoint] array with two elements or object with x and y component - * @param {Number} [config.fillRadialGradientStartRadius] - * @param {Number} [config.fillRadialGradientEndRadius] - * @param {Array} [config.fillRadialGradientColorStops] array of color stops - * - * @param {String} [config.stroke] stroke color - * @param {Number} [config.strokeWidth] stroke width - * @param {String} [config.lineJoin] can be miter, round, or bevel. The default - * is miter - * @param {String} [config.lineCap] can be butt, round, or sqare. The default - * is butt - * @param {String} [config.shadowColor] - * @param {Number} [config.shadowBlur] - * @param {Obect} [config.shadowOffset] - * @param {Number} [config.shadowOffset.x] - * @param {Number} [config.shadowOffset.y] - * @param {Number} [config.shadowOpacity] shadow opacity. Can be any real number - * between 0 and 1 - * @param {Array} [config.dashArray] - * - * - * - * @param {Number} [config.x] - * @param {Number} [config.y] - * @param {Number} [config.width] - * @param {Number} [config.height] - * @param {Boolean} [config.visible] - * @param {Boolean} [config.listening] whether or not the node is listening for events - * @param {String} [config.id] unique id - * @param {String} [config.name] non-unique name - * @param {Number} [config.opacity] determines node opacity. Can be any number between 0 and 1 - * @param {Object} [config.scale] - * @param {Number} [config.scale.x] - * @param {Number} [config.scale.y] - * @param {Number} [config.rotation] rotation in radians - * @param {Number} [config.rotationDeg] rotation in degrees - * @param {Object} [config.offset] offset from center point and rotation point - * @param {Number} [config.offset.x] - * @param {Number} [config.offset.y] - * @param {Boolean} [config.draggable] - * @param {Function} [config.dragBoundFunc] + * {{ShapeParams}} + * {{NodeParams}} */ Kinetic.Image = function(config) { this._initImage(config); diff --git a/src/shapes/Line.js b/src/shapes/Line.js index 7f84f248..ceb5bc86 100644 --- a/src/shapes/Line.js +++ b/src/shapes/Line.js @@ -6,64 +6,8 @@ * @param {Object} config * @param {Array} config.points can be a flattened array of points, an array of point arrays, or an array of point objects. * e.g. [0,1,2,3], [[0,1],[2,3]] and [{x:0,y:1},{x:2,y:3}] are equivalent - * - * - * @param {String} [config.fill] fill color - * - * @param {Image} [config.fillPatternImage] fill pattern image - * @param {Number} [config.fillPatternX] - * @param {Number} [config.fillPatternY] - * @param {Array|Object} [config.fillPatternOffset] array with two elements or object with x and y component - * @param {Array|Object} [config.fillPatternScale] array with two elements or object with x and y component - * @param {Number} [config.fillPatternRotation] - * @param {String} [config.fillPatternRepeat] can be 'repeat', 'repeat-x', 'repeat-y', or 'no-repeat'. The default is 'no-repeat' - * - * @param {Array|Object} [config.fillLinearGradientStartPoint] array with two elements or object with x and y component - * @param {Array|Object} [config.fillLinearGradientEndPoint] array with two elements or object with x and y component - * @param {Array} [config.fillLinearGradientColorStops] array of color stops - * - * @param {Array|Object} [config.fillRadialGradientStartPoint] array with two elements or object with x and y component - * @param {Array|Object} [config.fillRadialGradientEndPoint] array with two elements or object with x and y component - * @param {Number} [config.fillRadialGradientStartRadius] - * @param {Number} [config.fillRadialGradientEndRadius] - * @param {Array} [config.fillRadialGradientColorStops] array of color stops - * - * @param {String} [config.stroke] stroke color - * @param {Number} [config.strokeWidth] stroke width - * @param {String} [config.lineJoin] can be miter, round, or bevel. The default - * is miter - * @param {String} [config.lineCap] can be butt, round, or sqare. The default - * is butt - * @param {String} [config.shadowColor] - * @param {Number} [config.shadowBlur] - * @param {Obect} [config.shadowOffset] - * @param {Number} [config.shadowOffset.x] - * @param {Number} [config.shadowOffset.y] - * @param {Number} [config.shadowOpacity] shadow opacity. Can be any real number - * between 0 and 1 - * @param {Array} [config.dashArray] - * - * - * - * @param {Number} [config.x] - * @param {Number} [config.y] - * @param {Number} [config.width] - * @param {Number} [config.height] - * @param {Boolean} [config.visible] - * @param {Boolean} [config.listening] whether or not the node is listening for events - * @param {String} [config.id] unique id - * @param {String} [config.name] non-unique name - * @param {Number} [config.opacity] determines node opacity. Can be any number between 0 and 1 - * @param {Object} [config.scale] - * @param {Number} [config.scale.x] - * @param {Number} [config.scale.y] - * @param {Number} [config.rotation] rotation in radians - * @param {Number} [config.rotationDeg] rotation in degrees - * @param {Object} [config.offset] offset from center point and rotation point - * @param {Number} [config.offset.x] - * @param {Number} [config.offset.y] - * @param {Boolean} [config.draggable] - * @param {Function} [config.dragBoundFunc] + * {{ShapeParams}} + * {{NodeParams}} */ Kinetic.Line = function(config) { this._initLine(config); diff --git a/src/shapes/Path.js b/src/shapes/Path.js index aa0208f9..17a3f6bc 100644 --- a/src/shapes/Path.js +++ b/src/shapes/Path.js @@ -6,64 +6,8 @@ * @augments Kinetic.Shape * @param {Object} config * @param {String} config.data SVG data string - * - * - * @param {String} [config.fill] fill color - * - * @param {Image} [config.fillPatternImage] fill pattern image - * @param {Number} [config.fillPatternX] - * @param {Number} [config.fillPatternY] - * @param {Array|Object} [config.fillPatternOffset] array with two elements or object with x and y component - * @param {Array|Object} [config.fillPatternScale] array with two elements or object with x and y component - * @param {Number} [config.fillPatternRotation] - * @param {String} [config.fillPatternRepeat] can be 'repeat', 'repeat-x', 'repeat-y', or 'no-repeat'. The default is 'no-repeat' - * - * @param {Array|Object} [config.fillLinearGradientStartPoint] array with two elements or object with x and y component - * @param {Array|Object} [config.fillLinearGradientEndPoint] array with two elements or object with x and y component - * @param {Array} [config.fillLinearGradientColorStops] array of color stops - * - * @param {Array|Object} [config.fillRadialGradientStartPoint] array with two elements or object with x and y component - * @param {Array|Object} [config.fillRadialGradientEndPoint] array with two elements or object with x and y component - * @param {Number} [config.fillRadialGradientStartRadius] - * @param {Number} [config.fillRadialGradientEndRadius] - * @param {Array} [config.fillRadialGradientColorStops] array of color stops - * - * @param {String} [config.stroke] stroke color - * @param {Number} [config.strokeWidth] stroke width - * @param {String} [config.lineJoin] can be miter, round, or bevel. The default - * is miter - * @param {String} [config.lineCap] can be butt, round, or sqare. The default - * is butt - * @param {String} [config.shadowColor] - * @param {Number} [config.shadowBlur] - * @param {Obect} [config.shadowOffset] - * @param {Number} [config.shadowOffset.x] - * @param {Number} [config.shadowOffset.y] - * @param {Number} [config.shadowOpacity] shadow opacity. Can be any real number - * between 0 and 1 - * @param {Array} [config.dashArray] - * - * - * - * @param {Number} [config.x] - * @param {Number} [config.y] - * @param {Number} [config.width] - * @param {Number} [config.height] - * @param {Boolean} [config.visible] - * @param {Boolean} [config.listening] whether or not the node is listening for events - * @param {String} [config.id] unique id - * @param {String} [config.name] non-unique name - * @param {Number} [config.opacity] determines node opacity. Can be any number between 0 and 1 - * @param {Object} [config.scale] - * @param {Number} [config.scale.x] - * @param {Number} [config.scale.y] - * @param {Number} [config.rotation] rotation in radians - * @param {Number} [config.rotationDeg] rotation in degrees - * @param {Object} [config.offset] offset from center point and rotation point - * @param {Number} [config.offset.x] - * @param {Number} [config.offset.y] - * @param {Boolean} [config.draggable] - * @param {Function} [config.dragBoundFunc] + * {{ShapeParams}} + * {{NodeParams}} */ Kinetic.Path = function(config) { this._initPath(config); diff --git a/src/shapes/Polygon.js b/src/shapes/Polygon.js index e4d56145..a6c0f54c 100644 --- a/src/shapes/Polygon.js +++ b/src/shapes/Polygon.js @@ -6,64 +6,8 @@ * @param {Object} config * @param {Array} config.points can be a flattened array of points, an array of point arrays, or an array of point objects. * e.g. [0,1,2,3], [[0,1],[2,3]] and [{x:0,y:1},{x:2,y:3}] are equivalent - * - * - * @param {String} [config.fill] fill color - * - * @param {Image} [config.fillPatternImage] fill pattern image - * @param {Number} [config.fillPatternX] - * @param {Number} [config.fillPatternY] - * @param {Array|Object} [config.fillPatternOffset] array with two elements or object with x and y component - * @param {Array|Object} [config.fillPatternScale] array with two elements or object with x and y component - * @param {Number} [config.fillPatternRotation] - * @param {String} [config.fillPatternRepeat] can be 'repeat', 'repeat-x', 'repeat-y', or 'no-repeat'. The default is 'no-repeat' - * - * @param {Array|Object} [config.fillLinearGradientStartPoint] array with two elements or object with x and y component - * @param {Array|Object} [config.fillLinearGradientEndPoint] array with two elements or object with x and y component - * @param {Array} [config.fillLinearGradientColorStops] array of color stops - * - * @param {Array|Object} [config.fillRadialGradientStartPoint] array with two elements or object with x and y component - * @param {Array|Object} [config.fillRadialGradientEndPoint] array with two elements or object with x and y component - * @param {Number} [config.fillRadialGradientStartRadius] - * @param {Number} [config.fillRadialGradientEndRadius] - * @param {Array} [config.fillRadialGradientColorStops] array of color stops - * - * @param {String} [config.stroke] stroke color - * @param {Number} [config.strokeWidth] stroke width - * @param {String} [config.lineJoin] can be miter, round, or bevel. The default - * is miter - * @param {String} [config.lineCap] can be butt, round, or sqare. The default - * is butt - * @param {String} [config.shadowColor] - * @param {Number} [config.shadowBlur] - * @param {Obect} [config.shadowOffset] - * @param {Number} [config.shadowOffset.x] - * @param {Number} [config.shadowOffset.y] - * @param {Number} [config.shadowOpacity] shadow opacity. Can be any real number - * between 0 and 1 - * @param {Array} [config.dashArray] - * - * - * - * @param {Number} [config.x] - * @param {Number} [config.y] - * @param {Number} [config.width] - * @param {Number} [config.height] - * @param {Boolean} [config.visible] - * @param {Boolean} [config.listening] whether or not the node is listening for events - * @param {String} [config.id] unique id - * @param {String} [config.name] non-unique name - * @param {Number} [config.opacity] determines node opacity. Can be any number between 0 and 1 - * @param {Object} [config.scale] - * @param {Number} [config.scale.x] - * @param {Number} [config.scale.y] - * @param {Number} [config.rotation] rotation in radians - * @param {Number} [config.rotationDeg] rotation in degrees - * @param {Object} [config.offset] offset from center point and rotation point - * @param {Number} [config.offset.x] - * @param {Number} [config.offset.y] - * @param {Boolean} [config.draggable] - * @param {Function} [config.dragBoundFunc] + * {{ShapeParams}} + * {{NodeParams}} */ Kinetic.Polygon = function(config) { this._initPolygon(config); diff --git a/src/shapes/Rect.js b/src/shapes/Rect.js index 581a98d1..bba77ccd 100644 --- a/src/shapes/Rect.js +++ b/src/shapes/Rect.js @@ -5,60 +5,8 @@ * @augments Kinetic.Shape * @param {Object} config * @param {Number} [config.cornerRadius] - * - - * @param {String} [config.fill] fill color - * @param {Image} [config.fillPatternImage] fill pattern image - * @param {Number} [config.fillPatternX] - * @param {Number} [config.fillPatternY] - * @param {Array|Object} [config.fillPatternOffset] array with two elements or object with x and y component - * @param {Array|Object} [config.fillPatternScale] array with two elements or object with x and y component - * @param {Number} [config.fillPatternRotation] - * @param {String} [config.fillPatternRepeat] can be 'repeat', 'repeat-x', 'repeat-y', or 'no-repeat'. The default is 'no-repeat' - * @param {Array|Object} [config.fillLinearGradientStartPoint] array with two elements or object with x and y component - * @param {Array|Object} [config.fillLinearGradientEndPoint] array with two elements or object with x and y component - * @param {Array} [config.fillLinearGradientColorStops] array of color stops - * @param {Array|Object} [config.fillRadialGradientStartPoint] array with two elements or object with x and y component - * @param {Array|Object} [config.fillRadialGradientEndPoint] array with two elements or object with x and y component - * @param {Number} [config.fillRadialGradientStartRadius] - * @param {Number} [config.fillRadialGradientEndRadius] - * @param {Array} [config.fillRadialGradientColorStops] array of color stops - * @param {String} [config.stroke] stroke color - * @param {Number} [config.strokeWidth] stroke width - * @param {String} [config.lineJoin] can be miter, round, or bevel. The default - * is miter - * @param {String} [config.lineCap] can be butt, round, or sqare. The default - * is butt - * @param {String} [config.shadowColor] - * @param {Number} [config.shadowBlur] - * @param {Obect} [config.shadowOffset] - * @param {Number} [config.shadowOffset.x] - * @param {Number} [config.shadowOffset.y] - * @param {Number} [config.shadowOpacity] shadow opacity. Can be any real number - * between 0 and 1 - * @param {Array} [config.dashArray] - * - * - * - * @param {Number} [config.x] - * @param {Number} [config.y] - * @param {Number} [config.width] - * @param {Number} [config.height] - * @param {Boolean} [config.visible] - * @param {Boolean} [config.listening] whether or not the node is listening for events - * @param {String} [config.id] unique id - * @param {String} [config.name] non-unique name - * @param {Number} [config.opacity] determines node opacity. Can be any number between 0 and 1 - * @param {Object} [config.scale] - * @param {Number} [config.scale.x] - * @param {Number} [config.scale.y] - * @param {Number} [config.rotation] rotation in radians - * @param {Number} [config.rotationDeg] rotation in degrees - * @param {Object} [config.offset] offset from center point and rotation point - * @param {Number} [config.offset.x] - * @param {Number} [config.offset.y] - * @param {Boolean} [config.draggable] - * @param {Function} [config.dragBoundFunc] + * {{ShapeParams}} + * {{NodeParams}} */ Kinetic.Rect = function(config) { this._initRect(config); diff --git a/src/shapes/RegularPolygon.js b/src/shapes/RegularPolygon.js index 9d89cdde..d458d627 100644 --- a/src/shapes/RegularPolygon.js +++ b/src/shapes/RegularPolygon.js @@ -6,64 +6,8 @@ * @param {Object} config * @param {Number} config.sides * @param {Number} config.radius - * - * - * @param {String} [config.fill] fill color - * - * @param {Image} [config.fillPatternImage] fill pattern image - * @param {Number} [config.fillPatternX] - * @param {Number} [config.fillPatternY] - * @param {Array|Object} [config.fillPatternOffset] array with two elements or object with x and y component - * @param {Array|Object} [config.fillPatternScale] array with two elements or object with x and y component - * @param {Number} [config.fillPatternRotation] - * @param {String} [config.fillPatternRepeat] can be 'repeat', 'repeat-x', 'repeat-y', or 'no-repeat'. The default is 'no-repeat' - * - * @param {Array|Object} [config.fillLinearGradientStartPoint] array with two elements or object with x and y component - * @param {Array|Object} [config.fillLinearGradientEndPoint] array with two elements or object with x and y component - * @param {Array} [config.fillLinearGradientColorStops] array of color stops - * - * @param {Array|Object} [config.fillRadialGradientStartPoint] array with two elements or object with x and y component - * @param {Array|Object} [config.fillRadialGradientEndPoint] array with two elements or object with x and y component - * @param {Number} [config.fillRadialGradientStartRadius] - * @param {Number} [config.fillRadialGradientEndRadius] - * @param {Array} [config.fillRadialGradientColorStops] array of color stops - * - * @param {String} [config.stroke] stroke color - * @param {Number} [config.strokeWidth] stroke width - * @param {String} [config.lineJoin] can be miter, round, or bevel. The default - * is miter - * @param {String} [config.lineCap] can be butt, round, or sqare. The default - * is butt - * @param {String} [config.shadowColor] - * @param {Number} [config.shadowBlur] - * @param {Obect} [config.shadowOffset] - * @param {Number} [config.shadowOffset.x] - * @param {Number} [config.shadowOffset.y] - * @param {Number} [config.shadowOpacity] shadow opacity. Can be any real number - * between 0 and 1 - * @param {Array} [config.dashArray] - * - * - * - * @param {Number} [config.x] - * @param {Number} [config.y] - * @param {Number} [config.width] - * @param {Number} [config.height] - * @param {Boolean} [config.visible] - * @param {Boolean} [config.listening] whether or not the node is listening for events - * @param {String} [config.id] unique id - * @param {String} [config.name] non-unique name - * @param {Number} [config.opacity] determines node opacity. Can be any number between 0 and 1 - * @param {Object} [config.scale] - * @param {Number} [config.scale.x] - * @param {Number} [config.scale.y] - * @param {Number} [config.rotation] rotation in radians - * @param {Number} [config.rotationDeg] rotation in degrees - * @param {Object} [config.offset] offset from center point and rotation point - * @param {Number} [config.offset.x] - * @param {Number} [config.offset.y] - * @param {Boolean} [config.draggable] - * @param {Function} [config.dragBoundFunc] + * {{ShapeParams}} + * {{NodeParams}} */ Kinetic.RegularPolygon = function(config) { this._initRegularPolygon(config); diff --git a/src/shapes/Spline.js b/src/shapes/Spline.js index 5d51ee3c..294e3952 100644 --- a/src/shapes/Spline.js +++ b/src/shapes/Spline.js @@ -8,64 +8,8 @@ * @param {Array} config.points can be a flattened array of points, an array of point arrays, or an array of point objects. * e.g. [0,1,2,3], [[0,1],[2,3]] and [{x:0,y:1},{x:2,y:3}] are equivalent * @param {Number} [config.tension] default value is 1. Higher values will result in a more curvy line. A value of 0 will result in no interpolation. - * - * - * @param {String} [config.fill] fill color - * - * @param {Image} [config.fillPatternImage] fill pattern image - * @param {Number} [config.fillPatternX] - * @param {Number} [config.fillPatternY] - * @param {Array|Object} [config.fillPatternOffset] array with two elements or object with x and y component - * @param {Array|Object} [config.fillPatternScale] array with two elements or object with x and y component - * @param {Number} [config.fillPatternRotation] - * @param {String} [config.fillPatternRepeat] can be 'repeat', 'repeat-x', 'repeat-y', or 'no-repeat'. The default is 'no-repeat' - * - * @param {Array|Object} [config.fillLinearGradientStartPoint] array with two elements or object with x and y component - * @param {Array|Object} [config.fillLinearGradientEndPoint] array with two elements or object with x and y component - * @param {Array} [config.fillLinearGradientColorStops] array of color stops - * - * @param {Array|Object} [config.fillRadialGradientStartPoint] array with two elements or object with x and y component - * @param {Array|Object} [config.fillRadialGradientEndPoint] array with two elements or object with x and y component - * @param {Number} [config.fillRadialGradientStartRadius] - * @param {Number} [config.fillRadialGradientEndRadius] - * @param {Array} [config.fillRadialGradientColorStops] array of color stops - * - * @param {String} [config.stroke] stroke color - * @param {Number} [config.strokeWidth] stroke width - * @param {String} [config.lineJoin] can be miter, round, or bevel. The default - * is miter - * @param {String} [config.lineCap] can be butt, round, or sqare. The default - * is butt - * @param {String} [config.shadowColor] - * @param {Number} [config.shadowBlur] - * @param {Obect} [config.shadowOffset] - * @param {Number} [config.shadowOffset.x] - * @param {Number} [config.shadowOffset.y] - * @param {Number} [config.shadowOpacity] shadow opacity. Can be any real number - * between 0 and 1 - * @param {Array} [config.dashArray] - * - * - * - * @param {Number} [config.x] - * @param {Number} [config.y] - * @param {Number} [config.width] - * @param {Number} [config.height] - * @param {Boolean} [config.visible] - * @param {Boolean} [config.listening] whether or not the node is listening for events - * @param {String} [config.id] unique id - * @param {String} [config.name] non-unique name - * @param {Number} [config.opacity] determines node opacity. Can be any number between 0 and 1 - * @param {Object} [config.scale] - * @param {Number} [config.scale.x] - * @param {Number} [config.scale.y] - * @param {Number} [config.rotation] rotation in radians - * @param {Number} [config.rotationDeg] rotation in degrees - * @param {Object} [config.offset] offset from center point and rotation point - * @param {Number} [config.offset.x] - * @param {Number} [config.offset.y] - * @param {Boolean} [config.draggable] - * @param {Function} [config.dragBoundFunc] + * {{ShapeParams}} + * {{NodeParams}} */ Kinetic.Spline = function(config) { this._initSpline(config); diff --git a/src/shapes/Sprite.js b/src/shapes/Sprite.js index 6d7250c9..aae9a729 100644 --- a/src/shapes/Sprite.js +++ b/src/shapes/Sprite.js @@ -7,64 +7,8 @@ * @param {String} config.animation animation key * @param {Object} config.animations animation map * @param {Integer} [config.index] animation index - * - * - * @param {String} [config.fill] fill color - * - * @param {Image} [config.fillPatternImage] fill pattern image - * @param {Number} [config.fillPatternX] - * @param {Number} [config.fillPatternY] - * @param {Array|Object} [config.fillPatternOffset] array with two elements or object with x and y component - * @param {Array|Object} [config.fillPatternScale] array with two elements or object with x and y component - * @param {Number} [config.fillPatternRotation] - * @param {String} [config.fillPatternRepeat] can be 'repeat', 'repeat-x', 'repeat-y', or 'no-repeat'. The default is 'no-repeat' - * - * @param {Array|Object} [config.fillLinearGradientStartPoint] array with two elements or object with x and y component - * @param {Array|Object} [config.fillLinearGradientEndPoint] array with two elements or object with x and y component - * @param {Array} [config.fillLinearGradientColorStops] array of color stops - * - * @param {Array|Object} [config.fillRadialGradientStartPoint] array with two elements or object with x and y component - * @param {Array|Object} [config.fillRadialGradientEndPoint] array with two elements or object with x and y component - * @param {Number} [config.fillRadialGradientStartRadius] - * @param {Number} [config.fillRadialGradientEndRadius] - * @param {Array} [config.fillRadialGradientColorStops] array of color stops - * - * @param {String} [config.stroke] stroke color - * @param {Number} [config.strokeWidth] stroke width - * @param {String} [config.lineJoin] can be miter, round, or bevel. The default - * is miter - * @param {String} [config.lineCap] can be butt, round, or sqare. The default - * is butt - * @param {String} [config.shadowColor] - * @param {Number} [config.shadowBlur] - * @param {Obect} [config.shadowOffset] - * @param {Number} [config.shadowOffset.x] - * @param {Number} [config.shadowOffset.y] - * @param {Number} [config.shadowOpacity] shadow opacity. Can be any real number - * between 0 and 1 - * @param {Array} [config.dashArray] - * - * - * - * @param {Number} [config.x] - * @param {Number} [config.y] - * @param {Number} [config.width] - * @param {Number} [config.height] - * @param {Boolean} [config.visible] - * @param {Boolean} [config.listening] whether or not the node is listening for events - * @param {String} [config.id] unique id - * @param {String} [config.name] non-unique name - * @param {Number} [config.opacity] determines node opacity. Can be any number between 0 and 1 - * @param {Object} [config.scale] - * @param {Number} [config.scale.x] - * @param {Number} [config.scale.y] - * @param {Number} [config.rotation] rotation in radians - * @param {Number} [config.rotationDeg] rotation in degrees - * @param {Object} [config.offset] offset from center point and rotation point - * @param {Number} [config.offset.x] - * @param {Number} [config.offset.y] - * @param {Boolean} [config.draggable] - * @param {Function} [config.dragBoundFunc] + * {{ShapeParams}} + * {{NodeParams}} */ Kinetic.Sprite = function(config) { this._initSprite(config); diff --git a/src/shapes/Star.js b/src/shapes/Star.js index 6fa865bc..cf8e478c 100644 --- a/src/shapes/Star.js +++ b/src/shapes/Star.js @@ -7,64 +7,8 @@ * @param {Integer} config.numPoints * @param {Number} config.innerRadius * @param {Number} config.outerRadius - * - * - * @param {String} [config.fill] fill color - * - * @param {Image} [config.fillPatternImage] fill pattern image - * @param {Number} [config.fillPatternX] - * @param {Number} [config.fillPatternY] - * @param {Array|Object} [config.fillPatternOffset] array with two elements or object with x and y component - * @param {Array|Object} [config.fillPatternScale] array with two elements or object with x and y component - * @param {Number} [config.fillPatternRotation] - * @param {String} [config.fillPatternRepeat] can be 'repeat', 'repeat-x', 'repeat-y', or 'no-repeat'. The default is 'no-repeat' - * - * @param {Array|Object} [config.fillLinearGradientStartPoint] array with two elements or object with x and y component - * @param {Array|Object} [config.fillLinearGradientEndPoint] array with two elements or object with x and y component - * @param {Array} [config.fillLinearGradientColorStops] array of color stops - * - * @param {Array|Object} [config.fillRadialGradientStartPoint] array with two elements or object with x and y component - * @param {Array|Object} [config.fillRadialGradientEndPoint] array with two elements or object with x and y component - * @param {Number} [config.fillRadialGradientStartRadius] - * @param {Number} [config.fillRadialGradientEndRadius] - * @param {Array} [config.fillRadialGradientColorStops] array of color stops - * - * @param {String} [config.stroke] stroke color - * @param {Number} [config.strokeWidth] stroke width - * @param {String} [config.lineJoin] can be miter, round, or bevel. The default - * is miter - * @param {String} [config.lineCap] can be butt, round, or sqare. The default - * is butt - * @param {String} [config.shadowColor] - * @param {Number} [config.shadowBlur] - * @param {Obect} [config.shadowOffset] - * @param {Number} [config.shadowOffset.x] - * @param {Number} [config.shadowOffset.y] - * @param {Number} [config.shadowOpacity] shadow opacity. Can be any real number - * between 0 and 1 - * @param {Array} [config.dashArray] - * - * - * - * @param {Number} [config.x] - * @param {Number} [config.y] - * @param {Number} [config.width] - * @param {Number} [config.height] - * @param {Boolean} [config.visible] - * @param {Boolean} [config.listening] whether or not the node is listening for events - * @param {String} [config.id] unique id - * @param {String} [config.name] non-unique name - * @param {Number} [config.opacity] determines node opacity. Can be any number between 0 and 1 - * @param {Object} [config.scale] - * @param {Number} [config.scale.x] - * @param {Number} [config.scale.y] - * @param {Number} [config.rotation] rotation in radians - * @param {Number} [config.rotationDeg] rotation in degrees - * @param {Object} [config.offset] offset from center point and rotation point - * @param {Number} [config.offset.x] - * @param {Number} [config.offset.y] - * @param {Boolean} [config.draggable] - * @param {Function} [config.dragBoundFunc] + * {{ShapeParams}} + * {{NodeParams}} */ Kinetic.Star = function(config) { this._initStar(config); diff --git a/src/shapes/Text.js b/src/shapes/Text.js index 7a17e195..2c81345b 100644 --- a/src/shapes/Text.js +++ b/src/shapes/Text.js @@ -13,64 +13,8 @@ * @param {Number} [config.width] default is auto * @param {Number} [config.height] default is auto * @param {Number} [config.lineHeight] default is 1 - * - * - * @param {String} [config.fill] fill color - * - * @param {Image} [config.fillPatternImage] fill pattern image - * @param {Number} [config.fillPatternX] - * @param {Number} [config.fillPatternY] - * @param {Array|Object} [config.fillPatternOffset] array with two elements or object with x and y component - * @param {Array|Object} [config.fillPatternScale] array with two elements or object with x and y component - * @param {Number} [config.fillPatternRotation] - * @param {String} [config.fillPatternRepeat] can be 'repeat', 'repeat-x', 'repeat-y', or 'no-repeat'. The default is 'no-repeat' - * - * @param {Array|Object} [config.fillLinearGradientStartPoint] array with two elements or object with x and y component - * @param {Array|Object} [config.fillLinearGradientEndPoint] array with two elements or object with x and y component - * @param {Array} [config.fillLinearGradientColorStops] array of color stops - * - * @param {Array|Object} [config.fillRadialGradientStartPoint] array with two elements or object with x and y component - * @param {Array|Object} [config.fillRadialGradientEndPoint] array with two elements or object with x and y component - * @param {Number} [config.fillRadialGradientStartRadius] - * @param {Number} [config.fillRadialGradientEndRadius] - * @param {Array} [config.fillRadialGradientColorStops] array of color stops - * - * @param {String} [config.stroke] stroke color - * @param {Number} [config.strokeWidth] stroke width - * @param {String} [config.lineJoin] can be miter, round, or bevel. The default - * is miter - * @param {String} [config.lineCap] can be butt, round, or sqare. The default - * is butt - * @param {String} [config.shadowColor] - * @param {Number} [config.shadowBlur] - * @param {Obect} [config.shadowOffset] - * @param {Number} [config.shadowOffset.x] - * @param {Number} [config.shadowOffset.y] - * @param {Number} [config.shadowOpacity] shadow opacity. Can be any real number - * between 0 and 1 - * @param {Array} [config.dashArray] - * - * - * - * @param {Number} [config.x] - * @param {Number} [config.y] - * @param {Number} [config.width] - * @param {Number} [config.height] - * @param {Boolean} [config.visible] - * @param {Boolean} [config.listening] whether or not the node is listening for events - * @param {String} [config.id] unique id - * @param {String} [config.name] non-unique name - * @param {Number} [config.opacity] determines node opacity. Can be any number between 0 and 1 - * @param {Object} [config.scale] - * @param {Number} [config.scale.x] - * @param {Number} [config.scale.y] - * @param {Number} [config.rotation] rotation in radians - * @param {Number} [config.rotationDeg] rotation in degrees - * @param {Object} [config.offset] offset from center point and rotation point - * @param {Number} [config.offset.x] - * @param {Number} [config.offset.y] - * @param {Boolean} [config.draggable] - * @param {Function} [config.dragBoundFunc] + * {{ShapeParams}} + * {{NodeParams}} */ Kinetic.Text = function(config) { this._initText(config); diff --git a/src/shapes/TextPath.js b/src/shapes/TextPath.js index 19b03c6c..a625496d 100644 --- a/src/shapes/TextPath.js +++ b/src/shapes/TextPath.js @@ -9,64 +9,8 @@ * @param {Number} [config.fontSize] default is 12 * @param {String} [config.fontStyle] can be normal, bold, or italic. Default is normal * @param {String} config.text - * - * - * @param {String} [config.fill] fill color - * - * @param {Image} [config.fillPatternImage] fill pattern image - * @param {Number} [config.fillPatternX] - * @param {Number} [config.fillPatternY] - * @param {Array|Object} [config.fillPatternOffset] array with two elements or object with x and y component - * @param {Array|Object} [config.fillPatternScale] array with two elements or object with x and y component - * @param {Number} [config.fillPatternRotation] - * @param {String} [config.fillPatternRepeat] can be 'repeat', 'repeat-x', 'repeat-y', or 'no-repeat'. The default is 'no-repeat' - * - * @param {Array|Object} [config.fillLinearGradientStartPoint] array with two elements or object with x and y component - * @param {Array|Object} [config.fillLinearGradientEndPoint] array with two elements or object with x and y component - * @param {Array} [config.fillLinearGradientColorStops] array of color stops - * - * @param {Array|Object} [config.fillRadialGradientStartPoint] array with two elements or object with x and y component - * @param {Array|Object} [config.fillRadialGradientEndPoint] array with two elements or object with x and y component - * @param {Number} [config.fillRadialGradientStartRadius] - * @param {Number} [config.fillRadialGradientEndRadius] - * @param {Array} [config.fillRadialGradientColorStops] array of color stops - * - * @param {String} [config.stroke] stroke color - * @param {Number} [config.strokeWidth] stroke width - * @param {String} [config.lineJoin] can be miter, round, or bevel. The default - * is miter - * @param {String} [config.lineCap] can be butt, round, or sqare. The default - * is butt - * @param {String} [config.shadowColor] - * @param {Number} [config.shadowBlur] - * @param {Obect} [config.shadowOffset] - * @param {Number} [config.shadowOffset.x] - * @param {Number} [config.shadowOffset.y] - * @param {Number} [config.shadowOpacity] shadow opacity. Can be any real number - * between 0 and 1 - * @param {Array} [config.dashArray] - * - * - * - * @param {Number} [config.x] - * @param {Number} [config.y] - * @param {Number} [config.width] - * @param {Number} [config.height] - * @param {Boolean} [config.visible] - * @param {Boolean} [config.listening] whether or not the node is listening for events - * @param {String} [config.id] unique id - * @param {String} [config.name] non-unique name - * @param {Number} [config.opacity] determines node opacity. Can be any number between 0 and 1 - * @param {Object} [config.scale] - * @param {Number} [config.scale.x] - * @param {Number} [config.scale.y] - * @param {Number} [config.rotation] rotation in radians - * @param {Number} [config.rotationDeg] rotation in degrees - * @param {Object} [config.offset] offset from center point and rotation point - * @param {Number} [config.offset.x] - * @param {Number} [config.offset.y] - * @param {Boolean} [config.draggable] - * @param {Function} [config.dragBoundFunc] + * {{ShapeParams}} + * {{NodeParams}} */ Kinetic.TextPath = function(config) { this._initTextPath(config); diff --git a/src/shapes/Wedge.js b/src/shapes/Wedge.js index a024cc42..8e33df43 100644 --- a/src/shapes/Wedge.js +++ b/src/shapes/Wedge.js @@ -7,64 +7,8 @@ * @param {Number} config.angle * @param {Number} config.radius * @param {Boolean} [config.clockwise] - * - * ------------------------------------------------- - * @param {String} [config.fill] fill color - * ------------------------------------------------- - * @param {Image} [config.fillPatternImage] fill pattern image - * @param {Number} [config.fillPatternX] - * @param {Number} [config.fillPatternY] - * @param {Array|Object} [config.fillPatternOffset] array with two elements or object with x and y component - * @param {Array|Object} [config.fillPatternScale] array with two elements or object with x and y component - * @param {Number} [config.fillPatternRotation] - * @param {String} [config.fillPatternRepeat] can be 'repeat', 'repeat-x', 'repeat-y', or 'no-repeat'. The default is 'no-repeat' - * ------------------------------------------------- - * @param {Array|Object} [config.fillLinearGradientStartPoint] array with two elements or object with x and y component - * @param {Array|Object} [config.fillLinearGradientEndPoint] array with two elements or object with x and y component - * @param {Array} [config.fillLinearGradientColorStops] array of color stops - * ------------------------------------------------- - * @param {Array|Object} [config.fillRadialGradientStartPoint] array with two elements or object with x and y component - * @param {Array|Object} [config.fillRadialGradientEndPoint] array with two elements or object with x and y component - * @param {Number} [config.fillRadialGradientStartRadius] - * @param {Number} [config.fillRadialGradientEndRadius] - * @param {Array} [config.fillRadialGradientColorStops] array of color stops - * ------------------------------------------------- - * @param {String} [config.stroke] stroke color - * @param {Number} [config.strokeWidth] stroke width - * @param {String} [config.lineJoin] can be miter, round, or bevel. The default - * is miter - * @param {String} [config.lineCap] can be butt, round, or sqare. The default - * is butt - * @param {String} [config.shadowColor] - * @param {Number} [config.shadowBlur] - * @param {Obect} [config.shadowOffset] - * @param {Number} [config.shadowOffset.x] - * @param {Number} [config.shadowOffset.y] - * @param {Number} [config.shadowOpacity] shadow opacity. Can be any real number - * between 0 and 1 - * @param {Array} [config.dashArray] - * - * - * - * @param {Number} [config.x] - * @param {Number} [config.y] - * @param {Number} [config.width] - * @param {Number} [config.height] - * @param {Boolean} [config.visible] - * @param {Boolean} [config.listening] whether or not the node is listening for events - * @param {String} [config.id] unique id - * @param {String} [config.name] non-unique name - * @param {Number} [config.opacity] determines node opacity. Can be any number between 0 and 1 - * @param {Object} [config.scale] - * @param {Number} [config.scale.x] - * @param {Number} [config.scale.y] - * @param {Number} [config.rotation] rotation in radians - * @param {Number} [config.rotationDeg] rotation in degrees - * @param {Object} [config.offset] offset from center point and rotation point - * @param {Number} [config.offset.x] - * @param {Number} [config.offset.y] - * @param {Boolean} [config.draggable] - * @param {Function} [config.dragBoundFunc] + * {{ShapeParams}} + * {{NodeParams}} */ Kinetic.Wedge = function(config) { this._initWedge(config);