From a81fb74cd0f8c7a7da507fe7cb9ad94875687cc7 Mon Sep 17 00:00:00 2001 From: Nivesh Rajbhandari Date: Fri, 11 May 2012 12:11:14 -0700 Subject: Removing outdated tree-controller. Signed-off-by: Nivesh Rajbhandari --- js/controllers/tree-controller.js | 185 --------------------- .../materials-library-panel.html | 2 +- .../animations-presets.html | 2 +- .../presets/style-presets.reel/style-presets.html | 2 +- .../transitions-presets.html | 2 +- 5 files changed, 4 insertions(+), 189 deletions(-) delete mode 100644 js/controllers/tree-controller.js (limited to 'js') diff --git a/js/controllers/tree-controller.js b/js/controllers/tree-controller.js deleted file mode 100644 index 2b2e910c..00000000 --- a/js/controllers/tree-controller.js +++ /dev/null @@ -1,185 +0,0 @@ -/* - 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. -
*/ -/** - @module montage/ui/controller/tree-controller - @requires montage/core/core - @requires montage/ui/controller/object-controller - @requires montage/core/event/mutable-event - */ -var Montage = require("montage").Montage, - ObjectController = require("montage/ui/controller/object-controller").ObjectController, - ArrayController = require("montage/ui/controller/array-controller").ArrayController, - MutableEvent = require("montage/core/event/mutable-event").MutableEvent; -/** - TODO: Write description like the array controllers: The ArrayController helps with organizing a hierarchical - collection of objects, and managing user selection within that collection. - You can assign a TreeController instance as the contentProvider property for a TreeView object. - @class module:montage/ui/controller/tree-controller.TreeController - @classdesc - @extends module:montage/ui/controller/object-controller.ObjectController -*/ -var TreeController = exports.TreeController = Montage.create(ObjectController, /** @lends module:montage/ui/controller/tree-controller.TreeController# */ { - - rootKey : { - value: null - }, - - branchKey : { - value: 'children' - }, - - _root : { - value : null - }, - root : { - get: function() { - return this._root; - }, - set: function(value) { - this._root = value; - - this.initArrayControllers(); - } - }, - - rootController: { - value: null - }, - - initArrayControllers : { - value: function() { - var self = this; - - ///// Recursive function that finds all branch nodes and initializes - ///// sets the tree node type to "branch" or "leaf" - - function walk(node, init, depth) { - var branch = node[self.branchKey]; - - if(branch) { - branch.forEach(function(node) { - walk(node, init, ++depth); - }); - - node['treeNodeType'] = 'branch'; - } else { - node['treeNodeType'] = 'leaf'; - } - } - - walk(this._root, 0); - - } - }, - - /** - @private - */ - _selectedIndexes: { - value: null, - enumerable: false - }, - - /** - Description TODO - @type {Function} - @default null - */ - selectedIndexes: { - get: function() { - - }, - set: function(value) { - - } - }, - - branchControllers: { - value: [] - }, - - addBranchController : { - value: function(controller) { - if(this.delegate) { - controller.delegate = this.delegate; - } - - this.branchControllers.push(controller); - } - }, - - /** - @private - */ - _content: { - enumerable: false, - value: null - }, - /** - The content managed by the TreeController. - @type {Function} - @default {String} null - */ - content: { - get: function() { - return this._content; - }, - set: function(value) { - if (this._content === value) { - return; - } - - this._content = value; - - this.selectedObjects = null; - - if (this.rootKey) { - if (value[this.rootKey]) { - this.root = value[this.rootKey]; - } else { - console.log('No root key found in content data'); - } - } else { - this.root = value; - } - - } - }, - - addObjects : { - value: function() { - - var objects = Array.prototype.slice.call(arguments), - i, - objectCount = objects.length, - selectedContentIndexes, firstIndex; - - for (i = 0; i < objectCount; i++) { - this.content.push(objects[i]); - } - - if (this.selectObjectsOnAddition) { - selectedContentIndexes = []; - firstIndex = this.content.length-objectCount; - for (i = 0; i < objectCount; i++) { - selectedContentIndexes[i] = firstIndex++; - } - this.selectedContentIndexes = selectedContentIndexes; - this.selectedObjects = objects; - } - - if (this.clearFilterFunctionOnAddition) { - this.filterFunction = null; - } - - if (this.automaticallyOrganizeObjects) { - this.organizeObjects(); - } - - } - } - -}); diff --git a/js/panels/Materials/materials-library-panel.reel/materials-library-panel.html b/js/panels/Materials/materials-library-panel.reel/materials-library-panel.html index 7fc48a55..b5d7a869 100755 --- a/js/panels/Materials/materials-library-panel.reel/materials-library-panel.html +++ b/js/panels/Materials/materials-library-panel.reel/materials-library-panel.html @@ -50,7 +50,7 @@ "prototype": "js/panels/Materials/materials-popup.reel" }, "materialsController" : { - "prototype": "js/controllers/tree-controller", + "prototype": "js/components/controllers/tree-controller", "properties" : { "branchKey" : "children", "labelKey" : "label", diff --git a/js/panels/presets/animations-presets.reel/animations-presets.html b/js/panels/presets/animations-presets.reel/animations-presets.html index 347e5497..bd6369dd 100644 --- a/js/panels/presets/animations-presets.reel/animations-presets.html +++ b/js/panels/presets/animations-presets.reel/animations-presets.html @@ -18,7 +18,7 @@ No rights, expressed or implied, whatsoever to this software are provided by Mot } }, "presetsController" : { - "prototype": "js/controllers/tree-controller", + "prototype": "js/components/controllers/tree-controller", "properties" : { "branchKey" : "children", "labelKey" : "text", diff --git a/js/panels/presets/style-presets.reel/style-presets.html b/js/panels/presets/style-presets.reel/style-presets.html index a3d718bb..bebff22d 100644 --- a/js/panels/presets/style-presets.reel/style-presets.html +++ b/js/panels/presets/style-presets.reel/style-presets.html @@ -17,7 +17,7 @@ No rights, expressed or implied, whatsoever to this software are provided by Mot } }, "presetsController" : { - "prototype": "js/controllers/tree-controller", + "prototype": "js/components/controllers/tree-controller", "properties" : { "branchKey" : "children", "labelKey" : "text", diff --git a/js/panels/presets/transitions-presets.reel/transitions-presets.html b/js/panels/presets/transitions-presets.reel/transitions-presets.html index a6b98aeb..f0e0e9f9 100644 --- a/js/panels/presets/transitions-presets.reel/transitions-presets.html +++ b/js/panels/presets/transitions-presets.reel/transitions-presets.html @@ -18,7 +18,7 @@ No rights, expressed or implied, whatsoever to this software are provided by Mot } }, "presetsController" : { - "prototype": "js/controllers/tree-controller", + "prototype": "js/components/controllers/tree-controller", "properties" : { "branchKey" : "children", "labelKey" : "text", -- cgit v1.2.3 From a17299c6f317b29c6efd6e4180ad877cd2533526 Mon Sep 17 00:00:00 2001 From: Nivesh Rajbhandari Date: Fri, 11 May 2012 12:15:11 -0700 Subject: Removing obsolete treeList reference in preset templates. Signed-off-by: Nivesh Rajbhandari --- js/panels/presets/animations-presets.reel/animations-presets.html | 3 +-- js/panels/presets/transitions-presets.reel/transitions-presets.html | 3 +-- 2 files changed, 2 insertions(+), 4 deletions(-) (limited to 'js') diff --git a/js/panels/presets/animations-presets.reel/animations-presets.html b/js/panels/presets/animations-presets.reel/animations-presets.html index bd6369dd..2b5a33d6 100644 --- a/js/panels/presets/animations-presets.reel/animations-presets.html +++ b/js/panels/presets/animations-presets.reel/animations-presets.html @@ -13,8 +13,7 @@ No rights, expressed or implied, whatsoever to this software are provided by Mot "owner": { "prototype" : "js/panels/presets/animations-presets.reel[AnimationsLibrary]", "properties" : { - "element" : {"#" : "animationsLibrary"}, - "treeList" : {"@" : "treeList"} + "element" : {"#" : "animationsLibrary"} } }, "presetsController" : { diff --git a/js/panels/presets/transitions-presets.reel/transitions-presets.html b/js/panels/presets/transitions-presets.reel/transitions-presets.html index f0e0e9f9..add43ee7 100644 --- a/js/panels/presets/transitions-presets.reel/transitions-presets.html +++ b/js/panels/presets/transitions-presets.reel/transitions-presets.html @@ -13,8 +13,7 @@ No rights, expressed or implied, whatsoever to this software are provided by Mot "owner": { "prototype" : "js/panels/presets/transitions-presets.reel[TransitionsLibrary]", "properties" : { - "element" : {"#" : "transitionsLibrary"}, - "treeList" : {"@" : "treeList"} + "element" : {"#" : "transitionsLibrary"} } }, "presetsController" : { -- cgit v1.2.3