aboutsummaryrefslogtreecommitdiff
path: root/js/stage/stage.reel
diff options
context:
space:
mode:
Diffstat (limited to 'js/stage/stage.reel')
-rw-r--r--js/stage/stage.reel/stage.css13
-rw-r--r--js/stage/stage.reel/stage.html74
-rw-r--r--js/stage/stage.reel/stage.js861
3 files changed, 948 insertions, 0 deletions
diff --git a/js/stage/stage.reel/stage.css b/js/stage/stage.reel/stage.css
new file mode 100644
index 00000000..54b9761b
--- /dev/null
+++ b/js/stage/stage.reel/stage.css
@@ -0,0 +1,13 @@
1/* <copyright>
2 This file contains proprietary software owned by Motorola Mobility, Inc.<br/>
3 No rights, expressed or implied, whatsoever to this software are provided by Motorola Mobility, Inc. hereunder.<br/>
4 (c) Copyright 2011 Motorola Mobility, Inc. All Rights Reserved.
5 </copyright> */
6
7.stageAndScenesContainer {
8 -moz-box-flex: 1;
9 -webkit-box-flex: 1;
10 box-flex: 1;
11 position: relative;
12 overflow: hidden;
13} \ No newline at end of file
diff --git a/js/stage/stage.reel/stage.html b/js/stage/stage.reel/stage.html
new file mode 100644
index 00000000..49d10baf
--- /dev/null
+++ b/js/stage/stage.reel/stage.html
@@ -0,0 +1,74 @@
1<!DOCTYPE html>
2<!-- <copyright>
3 This file contains proprietary software owned by Motorola Mobility, Inc.<br/>
4 No rights, expressed or implied, whatsoever to this software are provided by Motorola Mobility, Inc. hereunder.<br/>
5 (c) Copyright 2011 Motorola Mobility, Inc. All Rights Reserved.
6 </copyright> -->
7<html>
8<head>
9 <meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
10 <link rel="stylesheet" type="text/css" href="stage.css">
11
12 <script type="text/montage-serialization">
13 {
14 "StageDeps1": {
15 "module": "js/stage/stage-deps",
16 "name": "StageDeps",
17 "properties": {
18 "stage": {"@": "owner"}
19 }
20 },
21
22 "layout1": {
23 "module": "js/stage/layout",
24 "name": "Layout",
25 "properties": {
26 "canvas": {"#": "layoutCanvas"},
27 "stage": {"@": "owner"}
28 },
29 "bindings": {
30 "layoutView": {
31 "boundObject": {"@": "owner" },
32 "boundObjectPropertyPath": "appModel.layoutView",
33 "oneway": true
34 }
35 }
36 },
37
38 "owner": {
39 "module": "js/stage/stage.reel",
40 "name": "Stage",
41 "properties": {
42 "element": {"#": "stageAndScenesContainer"},
43 "_iframeContainer": {"#": "iframeContainer"},
44 "codeViewContainer": {"#": "codeViewContainer"},
45 "_layoutCanvas": {"#": "layoutCanvas"},
46 "_canvas": {"#": "stageCanvas"},
47 "_drawingCanvas": {"#": "drawingCanvas"},
48 "stageDeps": {"@": "StageDeps1"},
49 "layout": {"@": "layout1"}
50 },
51 "bindings": {
52 "currentDocumentStageView": {
53 "boundObject": {"@": "owner" },
54 "boundObjectPropertyPath": "appModel.documentStageView",
55 "oneway": true
56 }
57 }
58 }
59 }
60 </script>
61
62</head>
63<body>
64
65 <section id="stageAndScenesContainer" class="stageAndScenesContainer">
66 <section id="iframeContainer"></section>
67 <section id="codeViewContainer"></section>
68 <canvas id="layoutCanvas"></canvas>
69 <canvas id="stageCanvas"></canvas>
70 <canvas id="drawingCanvas"></canvas>
71 </section>
72
73</body>
74</html>
diff --git a/js/stage/stage.reel/stage.js b/js/stage/stage.reel/stage.js
new file mode 100644
index 00000000..3e0b852e
--- /dev/null
+++ b/js/stage/stage.reel/stage.js
@@ -0,0 +1,861 @@
1/* <copyright>
2This file contains proprietary software owned by Motorola Mobility, Inc.<br/>
3No rights, expressed or implied, whatsoever to this software are provided by Motorola Mobility, Inc. hereunder.<br/>
4(c) Copyright 2011 Motorola Mobility, Inc. All Rights Reserved.
5</copyright> */
6
7var Montage = require("montage/core/core").Montage,
8 Component = require("montage/ui/component").Component;
9
10var drawUtils = require("js/helper-classes/3D/draw-utils").DrawUtils;
11var vecUtils = require("js/helper-classes/3D/vec-utils").VecUtils;
12
13exports.Stage = Montage.create(Component, {
14
15 // TODO - Need to figure out how to remove this dependency
16 // Needed by some tools that depend on selectionDrawn event to set up some logic
17 drawNow: { value : false },
18
19 // TO REVIEW
20 zoomFactor: {value : 1 },
21
22 _canvasSelectionPrefs: { value: { "thickness" : 1.0, "color" : "#46a1ff" } },
23 _editSymbolPrefs: { value: { "thickness" : 2.0, "color" : "#C61F00" } },
24
25 _canvasDrawingPrefs: { value: { "thickness" : 1.0, "color" : "#000" } },
26 drawingContextPreferences: { get: function() { return this._canvasDrawingPrefs; } },
27
28 _iframeContainer: { value: null },
29
30 _scrollFlag: {value: true, writable: true},
31 outFlag: { value: false, writable: true },
32
33 _resizeCanvases: { value: true },
34
35 viewUtils: {
36 get: function() { return this.stageDeps.viewUtils; }
37 },
38
39 snapManager: {
40 get: function() { return this.stageDeps.snapManager; }
41 },
42
43 resizeCanvases: {
44 get: function() {
45 return this._resizeCanvases;
46 },
47 set: function(value) {
48 this._resizeCanvases = value;
49 if(value) {
50 this.needsDraw = true;
51 }
52 }
53 },
54
55 _updatedStage: { value: false },
56
57 updatedStage: {
58 get: function() {
59 return this._updatedStage;
60 },
61 set: function(value) {
62 this._updatedStage = value;
63 if(value) {
64 this.needsDraw = true;
65 }
66 }
67 },
68
69 _currentDocumentStageView: {
70 value: "front"
71 },
72
73 currentDocumentStageView: {
74 get: function() {
75 return this._currentDocumentStageView;
76 },
77 set: function(value) {
78 if(this._currentDocumentStageView !== value) {
79 this._currentDocumentStageView = value;
80 this.setStageView(this.currentDocumentStageView);
81 }
82 }
83 },
84
85 contextMenu: {
86 value: false
87 },
88
89 /** MAIN CANVASES **/
90 _canvas: { value: null }, // selection bounds, 3d normals and the overall 3d selection box use this canvas
91 canvas: { get: function() { return this._canvas; } },
92
93 _context: { value: null },
94 context: { get: function() { return this._context; } },
95
96 _layoutCanvas: { value: null },
97 layoutCanvas: { get: function() { return this._layoutCanvas; } },
98
99 _drawingCanvas: { value: null },
100 drawingCanvas: { get: function() { return this._drawingCanvas; } },
101
102 _drawingContext: { value: null },
103 drawingContext: { get: function() { return this._drawingContext; } },
104
105 _clickPoint: { value: { x: { value: null }, y: { value: null } } },
106
107 // We will set this to false while moving objects to improve performance
108 showSelectionBounds: { value: true },
109
110 _documentRoot: { value: null },
111 _viewport: { value: null },
112 _documentOffsetLeft: { value: 0 },
113 _documentOffsetTop: { value: 0 },
114 _scrollLeft: { value: 0 },
115 _scrollTop: { value: 0 },
116 _userContentLeft: { value: 0 },
117 _userContentTop: { value: 0 },
118 _userContentBorder: { value: 0 },
119 savedLeftScroll: { value: null },
120 savedTopScroll: { value: null },
121
122
123 documentRoot: {
124 get: function () { return this._documentRoot; },
125 set: function(value) { this._documentRoot = value; }
126 },
127
128 viewport: {
129 get: function () { return this._viewport; },
130 set: function(value) { this._viewport = value; }
131 },
132
133 documentOffsetLeft: {
134 get: function() { return this._documentOffsetLeft; },
135 set: function(value) { this._documentOffsetLeft = value; }
136 },
137
138 documentOffsetTop: {
139 get: function() { return this._documentOffsetTop },
140 set: function(value) { this._documentOffsetTop = value; }
141 },
142
143 scrollLeft: {
144 get: function() { return this._scrollLeft; }
145 },
146
147 scrollTop: {
148 get: function() { return this._scrollTop; }
149 },
150
151 userContentLeft: {