From b89a7ee8b956c96a1dcee995ea840feddc5d4b27 Mon Sep 17 00:00:00 2001 From: Pierre Frisch Date: Thu, 22 Dec 2011 07:25:50 -0800 Subject: First commit of Ninja to ninja-internal Signed-off-by: Valerio Virgillito --- node_modules/montage/ui/flow-path-sigmoid.js | 148 +++++++++++++++++++++++++++ 1 file changed, 148 insertions(+) create mode 100644 node_modules/montage/ui/flow-path-sigmoid.js (limited to 'node_modules/montage/ui/flow-path-sigmoid.js') diff --git a/node_modules/montage/ui/flow-path-sigmoid.js b/node_modules/montage/ui/flow-path-sigmoid.js new file mode 100644 index 00000000..57cc9662 --- /dev/null +++ b/node_modules/montage/ui/flow-path-sigmoid.js @@ -0,0 +1,148 @@ +/* +This file contains proprietary software owned by Motorola Mobility, Inc.
+No rights, expressed or implied, whatsoever to this software are provided by Motorola Mobility, Inc. hereunder.
+(c) Copyright 2011 Motorola Mobility, Inc. All Rights Reserved. +
*/ + +var Montage = require("montage").Montage; + +var FlowPathSigmoid = exports.FlowPathSigmoid = Montage.create(Montage, { + + _variable: { + enumerable: false, + value: "time" + }, + + variable: { + get: function () { + return this._variable; + }, + set: function (value) { + switch (value) { + case "speed": + case "index": + this._variable = value; + break; + default: + this._variable = "time"; + } + this._updatePath(); + } + }, + + _smoothness: { + enumerable: false, + value: 0 + }, + + smoothness: { + get: function () { + return this._smoothness; + }, + set: function (value) { + this._smoothness = value; + this._updatePath(); + } + }, + + _scale: { + enumerable: false, + value: 0 + }, + + scale: { + get: function () { + return this._scale; + }, + set: function (value) { + this._scale = value; + this._updatePath(); + } + }, + + _width: { + enumerable: false, + value: 0 + }, + + width: { + get: function () { + return this._width; + }, + set: function (value) { + this._width = value; + this._updatePath(); + } + }, + + _origin: { + enumerable: false, + value: 0 + }, + + origin: { + get: function () { + return this._origin; + }, + set: function (value) { + this._origin = value; + this._updatePath(); + } + }, + + _sigmoidCenter: { + enumerable: false, + value: 0 + }, + + sigmoidCenter: { + get: function () { + return this._sigmoidCenter; + }, + set: function (value) { + this._sigmoidCenter = value; + this._updatePath(); + } + }, + + _slope: { + enumerable: false, + value: 1 + }, + + slope: { + get: function () { + return this._slope; + }, + set: function (value) { + this._slope = value; + this._updatePath(); + } + }, + + _path: { + enumerable: false, + value: "0" + }, + + path: { + get: function () { + return this._path; + }, + set: function (value) { + this._path = value; + } + }, + + _updatePath: { + enumerable: false, + value: function () { + var s = "(slide."+this._variable+"-("+this._origin+"))"; + + +/** parseInt((a/(1+Math.pow(c, -(j*d)))-(a/2)+j*b)*1000)/1000; + this.path = "parseInt(("+this._a+"/(1+Math.pow("+this._c+", -"+s+"*("+this._d+")))-(("+this._a+")/2)+"+s+"*("+this._b+"))*1000)/1000";*/ + this.path = "((("+this._width+")/(1+Math.pow(2, (("+this._sigmoidCenter+")-"+s+")/("+this._smoothness+"))))-("+(this._width/2)+")+"+s+"*("+this._slope+"))*("+this._scale+")"; + } + } +}); \ No newline at end of file -- cgit v1.2.3