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.reel/flow.js | 348 ++++++++++++++++++++++++++++++ 1 file changed, 348 insertions(+) create mode 100644 node_modules/montage/ui/flow.reel/flow.js (limited to 'node_modules/montage/ui/flow.reel/flow.js') diff --git a/node_modules/montage/ui/flow.reel/flow.js b/node_modules/montage/ui/flow.reel/flow.js new file mode 100644 index 00000000..c0a6b32f --- /dev/null +++ b/node_modules/montage/ui/flow.reel/flow.js @@ -0,0 +1,348 @@ +/* +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, + Component = require("ui/component").Component; + +var Flow = exports.Flow = Montage.create(Component, { + + _path: { + enumerable: false, + value: { + value: function (slide) { + return { + translateX: slide.time, + translateY: 0, + translateZ: 0, + scale: 1, + rotateX: 0, + rotateY: 0, + rotateZ: 0, + transformOriginX: 0, + transformOriginY: 0, + transformOriginZ: 0, + style: {} + }; + } + } + }, + + path: { + get: function () { + return this._path; + }, + set: function (value) { + this._path = value; + this.needsDraw = true; + } + }, + + _rotationOrder: { + enumerable: false, + value: "xyz" + }, + + rotationOrder: { + get: function () { + return this._rotationOrder; + }, + set: function (value) { + switch (value) { + case "xzy": + case "yxz": + case "yzx": + case "zxy": + case "zyx": + this._rotationOrder=value; + break; + default: + this._rotationOrder="xyz"; + break; + } + this.needsDraw = true; + } + }, + + numberOfNodes: { + value: null + }, + + _nodeOffset: { + enumerable: false, + value: { + value: function (nodeNumber) { + return { + time: nodeNumber*100, + speed: 0 + } + } + } + }, + + nodeOffset: { + get: function () { + return this._nodeOffset; + }, + set: function (value) { + this._nodeOffset = value; + this.needsDraw = true; + } + }, + + _width: { + enumerable: false, + value: null + }, + + _height: { + enumerable: false, + value: null + }, + + _repetitionComponents: { + enumerable: false, + value: null + }, + + prepareForDraw: { + enumerable: false, + value: function () { + this._repetitionComponents=this._repetition._childComponents; + } + }, + + draw: { + enumerable: false, + value: function () { + var i, + length = this.numberOfNodes, + slide={ + index: null, + time: null, + speed: null + }, + transform, + origin, + iPath, + j, + jPath, + iOffset, + iStyle; + + for (i=0; i