aboutsummaryrefslogtreecommitdiff
path: root/js/panels/Materials/materials-library-panel.reel/materials-library-panel.js
diff options
context:
space:
mode:
authorJohn Mayhew2012-04-02 16:28:39 -0700
committerJohn Mayhew2012-04-02 16:28:39 -0700
commitb4155fb4c33675a8a7cd37473513718043fdf0ba (patch)
tree3d8c802473f2395d53d599ec9d8b70b60a4db50c /js/panels/Materials/materials-library-panel.reel/materials-library-panel.js
parent5ba9aeac94c86049423fd5d4b37b277263939c13 (diff)
parentc6de22bf42be90b403491b5f87b1818d9020310c (diff)
downloadninja-b4155fb4c33675a8a7cd37473513718043fdf0ba.tar.gz
Merge branch 'master' of github.com:Motorola-Mobility/ninja-internal into WorkingBranch
Conflicts: js/helper-classes/RDGE/rdge-compiled.js js/helper-classes/RDGE/runtime/GLRuntime.js js/helper-classes/RDGE/src/core/script/MeshManager.js js/helper-classes/RDGE/src/core/script/engine.js js/helper-classes/RDGE/src/core/script/fx/ssao.js js/helper-classes/RDGE/src/core/script/init_state.js js/helper-classes/RDGE/src/core/script/run_state.js js/helper-classes/RDGE/src/core/script/scenegraphNodes.js js/helper-classes/RDGE/src/core/script/utilities.js js/helper-classes/RDGE/src/tools/compile-rdge-core.bat js/helper-classes/RDGE/src/tools/compile-rdge-core.sh js/helper-classes/RDGE/src/tools/rdge-compiled.js js/lib/drawing/world.js js/lib/rdge/materials/bump-metal-material.js js/lib/rdge/materials/deform-material.js js/lib/rdge/materials/flat-material.js js/lib/rdge/materials/fly-material.js js/lib/rdge/materials/julia-material.js js/lib/rdge/materials/keleidoscope-material.js js/lib/rdge/materials/linear-gradient-material.js js/lib/rdge/materials/mandel-material.js js/lib/rdge/materials/plasma-material.js js/lib/rdge/materials/pulse-material.js js/lib/rdge/materials/radial-blur-material.js js/lib/rdge/materials/radial-gradient-material.js js/lib/rdge/materials/relief-tunnel-material.js js/lib/rdge/materials/square-tunnel-material.js js/lib/rdge/materials/star-material.js js/lib/rdge/materials/taper-material.js js/lib/rdge/materials/tunnel-material.js js/lib/rdge/materials/twist-material.js js/lib/rdge/materials/twist-vert-material.js js/lib/rdge/materials/uber-material.js js/lib/rdge/materials/water-material.js js/lib/rdge/materials/z-invert-material.js js/preloader/Preloader.js
Diffstat (limited to 'js/panels/Materials/materials-library-panel.reel/materials-library-panel.js')
-rwxr-xr-xjs/panels/Materials/materials-library-panel.reel/materials-library-panel.js87
1 files changed, 26 insertions, 61 deletions
diff --git a/js/panels/Materials/materials-library-panel.reel/materials-library-panel.js b/js/panels/Materials/materials-library-panel.reel/materials-library-panel.js
index b16c4376..2176c6d5 100755
--- a/js/panels/Materials/materials-library-panel.reel/materials-library-panel.js
+++ b/js/panels/Materials/materials-library-panel.reel/materials-library-panel.js
@@ -4,76 +4,35 @@ No rights, expressed or implied, whatsoever to this software are provided by Mot
4(c) Copyright 2011 Motorola Mobility, Inc. All Rights Reserved. 4(c) Copyright 2011 Motorola Mobility, Inc. All Rights Reserved.
5</copyright> */ 5</copyright> */
6 6
7var Tree = require("js/components/tree.reel").Tree, 7var Montage = require("montage/core/core").Montage,
8 Button = require("js/components/button.reel").Button, 8 Component = require("montage/ui/component").Component,
9 MaterialsPopup = require("js/panels/Materials/materials-popup.reel").MaterialsPopup, 9 MaterialsData = require("js/panels/Materials/materials-data.json"),
10 PopupMananger = require("js/components/popup-manager.reel").PopupMananger,
11 Popup = require("montage/ui/popup/popup.reel").Popup; 10 Popup = require("montage/ui/popup/popup.reel").Popup;
12 11
13exports.MaterialsLibraryPanel = (require("montage/core/core").Montage).create(require("montage/ui/component").Component, { 12exports.MaterialsLibraryPanel = Montage.create(Component, {
14 13
15 _hasFocus: { 14 materialsData: {
16 enumerable: false, 15 value: null
17 value: false
18 }, 16 },
19
20 prepareForDraw: {
21 enumerable: false,
22 value: function() {
23 var treeHolderDiv = document.getElementById("materials_library_tree");
24 var materialsTree = Tree.create();
25 materialsTree.element = treeHolderDiv;
26 materialsTree.dataProvider = this._loadXMLDoc("js/panels/Materials/Materials.xml");
27 materialsTree.needsDraw = true;
28
29 materialsTree.addEventListener("change", this, true);
30 17
31 var addButton = Button.create(); 18 _hasFocus: {
32 addButton.element = document.getElementById("ml_add_btn");
33 addButton.label = "Add";
34 addButton.needsDraw = true;
35 addButton.addEventListener("action", this, true);
36
37 var copyButton = Button.create();
38 copyButton.element = document.getElementById("ml_copy_btn");
39 copyButton.label = "Copy";
40 copyButton.needsDraw = true;
41 copyButton.addEventListener("action", this, true);
42
43 var deleteButton = Button.create();
44 deleteButton.element = document.getElementById("ml_delete_btn");
45 deleteButton.label = "Delete";
46 deleteButton.needsDraw = true;
47 deleteButton.addEventListener("action", this, true);
48 }
49 },
50
51 willDraw: {
52 enumerable: false, 19 enumerable: false,
53 value: function() { 20 value: false
54
55 }
56 }, 21 },
57
58 draw: {
59 enumerable: false,
60 value: function() {
61 22
62 } 23 didCreate: {
24 value: function() {
25 this.materialsData = MaterialsData;
26 }
63 }, 27 },
64 28
65 _loadXMLDoc: { 29 prepareForDraw: {
66 value:function(dname) { 30 value : function() {
67 if (window.XMLHttpRequest) { 31 this.eventManager.addEventListener("showMaterialPopup", this, false);
68 xhttp = new XMLHttpRequest();
69 }
70 xhttp.open("GET", dname, false);
71 xhttp.send();
72 return xhttp.responseXML;
73 } 32 }
74 }, 33 },
75 34
76 captureAction: { 35 handleAction: {
77 value:function(event) { 36 value:function(event) {
78 switch(event._currentTarget.label) 37 switch(event._currentTarget.label)
79 { 38 {
@@ -90,10 +49,16 @@ exports.MaterialsLibraryPanel = (require("montage/core/core").Montage).create(re
90 } 49 }
91 }, 50 },
92 51
93 captureChange: { 52 handleNodeActivation: {
94 value:function(e) { 53 value:function(obj) {
95 var tNode = e._event.treeNode; 54 this._showMaterialPopup(obj.id);
96 this._showMaterialPopup(tNode.id); 55 }
56 },
57
58 handleShowMaterialPopup: {
59 enumerable: false,
60 value: function (event) {
61 this._showMaterialPopup(event.detail.materialId);
97 } 62 }
98 }, 63 },
99 64