aboutsummaryrefslogtreecommitdiff
path: root/js/models
diff options
context:
space:
mode:
Diffstat (limited to 'js/models')
-rwxr-xr-xjs/models/app-model.js23
-rwxr-xr-xjs/models/color-model.js765
-rwxr-xr-xjs/models/element-model.js23
-rwxr-xr-xjs/models/materials-model.js279
-rwxr-xr-xjs/models/properties-3d.js29
-rwxr-xr-xjs/models/shape-model.js23
6 files changed, 574 insertions, 568 deletions
diff --git a/js/models/app-model.js b/js/models/app-model.js
index ee340da8..1fc1ba12 100755
--- a/js/models/app-model.js
+++ b/js/models/app-model.js
@@ -1,24 +1,25 @@
1/* <copyright> 1/* <copyright>
2Copyright (c) 2012, Motorola Mobility, Inc 2Copyright (c) 2012, Motorola Mobility LLC.
3All Rights Reserved. 3All Rights Reserved.
4BSD License.
5 4
6Redistribution and use in source and binary forms, with or without 5Redistribution and use in source and binary forms, with or without
7modification, are permitted provided that the following conditions are met: 6modification, are permitted provided that the following conditions are met:
8 7
9 - Redistributions of source code must retain the above copyright notice, 8* Redistributions of source code must retain the above copyright notice,
10 this list of conditions and the following disclaimer. 9 this list of conditions and the following disclaimer.
11 - Redistributions in binary form must reproduce the above copyright 10
12 notice, this list of conditions and the following disclaimer in the 11* Redistributions in binary form must reproduce the above copyright notice,
13 documentation and/or other materials provided with the distribution. 12 this list of conditions and the following disclaimer in the documentation
14 - Neither the name of Motorola Mobility nor the names of its contributors 13 and/or other materials provided with the distribution.
15 may be used to endorse or promote products derived from this software 14
16 without specific prior written permission. 15* Neither the name of Motorola Mobility LLC nor the names of its
16 contributors may be used to endorse or promote products derived from this
17 software without specific prior written permission.
17 18
18THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" 19THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
19AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE 20AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
20IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE 21IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
21ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE 22ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
22LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR 23LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
23CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF 24CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
24SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS 25SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
diff --git a/js/models/color-model.js b/js/models/color-model.js
index cc41b59e..2c22081c 100755
--- a/js/models/color-model.js
+++ b/js/models/color-model.js
@@ -1,24 +1,25 @@
1/* <copyright> 1/* <copyright>
2Copyright (c) 2012, Motorola Mobility, Inc 2Copyright (c) 2012, Motorola Mobility LLC.
3All Rights Reserved. 3All Rights Reserved.
4BSD License.
5 4
6Redistribution and use in source and binary forms, with or without 5Redistribution and use in source and binary forms, with or without
7modification, are permitted provided that the following conditions are met: 6modification, are permitted provided that the following conditions are met:
8 7
9 - Redistributions of source code must retain the above copyright notice, 8* Redistributions of source code must retain the above copyright notice,
10 this list of conditions and the following disclaimer. 9 this list of conditions and the following disclaimer.
11 - Redistributions in binary form must reproduce the above copyright 10
12 notice, this list of conditions and the following disclaimer in the 11* Redistributions in binary form must reproduce the above copyright notice,
13 documentation and/or other materials provided with the distribution. 12 this list of conditions and the following disclaimer in the documentation
14 - Neither the name of Motorola Mobility nor the names of its contributors 13 and/or other materials provided with the distribution.
15 may be used to endorse or promote products derived from this software 14
16 without specific prior written permission. 15* Neither the name of Motorola Mobility LLC nor the names of its
16 contributors may be used to endorse or promote products derived from this
17 software without specific prior written permission.
17 18
18THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" 19THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
19AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE 20AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
20IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE 21IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
21ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE 22ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
22LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR 23LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
23CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF 24CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
24SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS 25SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
@@ -30,426 +31,426 @@ POSSIBILITY OF SUCH DAMAGE.
30 31
31//////////////////////////////////////////////////////////////////////// 32////////////////////////////////////////////////////////////////////////
32// 33//
33var Montage = require("montage/core/core").Montage, 34var Montage = require("montage/core/core").Montage,
34 Component = require("montage/ui/component").Component; 35 Component = require("montage/ui/component").Component;
35//////////////////////////////////////////////////////////////////////// 36////////////////////////////////////////////////////////////////////////
36// 37//
37exports.ColorModel = Montage.create(Component, { 38exports.ColorModel = Montage.create(Component, {
38 //////////////////////////////////////////////////////////////////// 39 ////////////////////////////////////////////////////////////////////
39 // 40 //
40 hasTemplate: { 41 hasTemplate: {
41 enumerable: false, 42 enumerable: false,
42 value: false 43 value: false
43 }, 44 },
44 //////////////////////////////////////////////////////////////////// 45 ////////////////////////////////////////////////////////////////////
45 //HSV Value of current color selected 46 //HSV Value of current color selected
46 _gradient: { 47 _gradient: {
47 enumerable: false, 48 enumerable: false,
48 value: null 49 value: null
49 }, 50 },
50 //////////////////////////////////////////////////////////////////// 51 ////////////////////////////////////////////////////////////////////
51 //HSV Value of current color selected 52 //HSV Value of current color selected
52 gradient: { 53 gradient: {
53 enumerable: true, 54 enumerable: true,
54 get: function() { 55 get: function() {
55 return this._gradient; 56 return this._gradient;
56 }, 57 },
57 set: function(value) { 58 set: function(value) {
58 this._gradient = value; 59 this._gradient = value;
59 //Updating color selected (converting to all modes) 60 //Updating color selected (converting to all modes)
60 this.updateColorSelected('gradient', value); 61 this.updateColorSelected('gradient', value);
61 } 62 }
62 }, 63 },
63 //////////////////////////////////////////////////////////////////// 64 ////////////////////////////////////////////////////////////////////
64 //HSV Value of current color selected 65 //HSV Value of current color selected
65 _hsv: { 66 _hsv: {
66 enumerable: false, 67 enumerable: false,
67 value: null 68 value: null
68 }, 69 },
69 //////////////////////////////////////////////////////////////////// 70 ////////////////////////////////////////////////////////////////////
70 //HSV Value of current color selected 71 //HSV Value of current color selected
71 hsv: { 72 hsv: {
72 enumerable: true, 73 enumerable: true,
73 get: function() { 74 get: function() {
74 return this._hsv; 75 return this._hsv;
75 }, 76 },
76 set: function(value) { 77 set: function(value) {
77 this._hsv = value; 78 this._hsv = value;
78 //Updating color selected (converting to all modes) 79 //Updating color selected (converting to all modes)
79 this.updateColorSelected('hsv', value); 80 this.updateColorSelected('hsv', value);
80 } 81 }
81 }, 82 },
82 //////////////////////////////////////////////////////////////////// 83 ////////////////////////////////////////////////////////////////////
83 //RGB Value of current color selected 84 //RGB Value of current color selected
84 _rgb: { 85 _rgb: {
85 enumerable: false, 86 enumerable: false,
86 value: null 87 value: null
87 }, 88 },
88 //////////////////////////////////////////////////////////////////// 89 ////////////////////////////////////////////////////////////////////
89 //RGB Value of current color selected 90 //RGB Value of current color selected
90 rgb: { 91 rgb: {
91 enumerable: true, 92 enumerable: true,
92 get: function() { 93 get: function() {
93 return this._rgb; 94 return this._rgb;
94 }, 95 },
95 set: function(value) { 96 set: function(value) {
96 this._rgb = value; 97 this._rgb = value;
97 //Updating color selected (converting to all modes) 98 //Updating color selected (converting to all modes)
98 this.updateColorSelected('rgb', value); 99 this.updateColorSelected('rgb', value);
99 } 100 }
100 }, 101 },
101 //////////////////////////////////////////////////////////////////// 102 ////////////////////////////////////////////////////////////////////
102 //HSL Value of current color selected 103 //HSL Value of current color selected
103 _hsl: { 104 _hsl: {
104 enumerable: false, 105 enumerable: false,
105 value: null 106 value: null
106 }, 107 },
107 //////////////////////////////////////////////////////////////////// 108 ////////////////////////////////////////////////////////////////////
108 //HSL Value of current color selected 109 //HSL Value of current color selected
109 hsl: { 110 hsl: {
110 enumerable: true, 111 enumerable: true,
111 get: function() { 112 get: function() {
112 return this._hsl; 113 return this._hsl;
113 }, 114 },
114 set: function(value) { 115 set: function(value) {
115 this._hsl = value; 116 this._hsl = value;
116 //Updating color selected (converting to all modes) 117 //Updating color selected (converting to all modes)
117 this.updateColorSelected('hsl', value); 118 this.updateColorSelected('hsl', value);
118 } 119 }
119 }, 120 },
120 //////////////////////////////////////////////////////////////////// 121 ////////////////////////////////////////////////////////////////////
121 //HEX Value of current color selected 122 //HEX Value of current color selected
122 _hex: { 123 _hex: {
123 numerable: false, 124 numerable: false,
124 value: null 125 value: null
125 }, 126 },
126 //////////////////////////////////////////////////////////////////// 127 ////////////////////////////////////////////////////////////////////
127 //HEX Value of current