aboutsummaryrefslogtreecommitdiff
path: root/js/tools
diff options
context:
space:
mode:
Diffstat (limited to 'js/tools')
-rw-r--r--js/tools/bindingTool.js89
1 files changed, 89 insertions, 0 deletions
diff --git a/js/tools/bindingTool.js b/js/tools/bindingTool.js
new file mode 100644
index 00000000..6444d2a7
--- /dev/null
+++ b/js/tools/bindingTool.js
@@ -0,0 +1,89 @@
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 DrawingTool = require("js/tools/drawing-tool").DrawingTool,
9ModifierToolBase = require("js/tools/modifier-tool-base").ModifierToolBase;
10SelectionTool = require("js/tools/SelectionTool").SelectionTool;
11
12
13exports.BindingTool = Montage.create(ModifierToolBase, {
14 drawingFeedback: { value: { mode: "Draw2D", type: "" } },
15 _selectedComponent: {
16 value: null
17 },
18
19 selectedComponent: {
20 get:function() {
21 return this._selectedComponent;
22 },
23 set: function(val) {
24 this._selectedComponent = val;
25 }
26 },
27
28 Configure: {
29 value: function (doActivate)
30 {
31 if (doActivate)
32 {
33 NJevent("enableStageMove");
34 this.application.ninja.workspaceMode = "binding";
35 }
36 else
37 {
38 NJevent("disableStageMove");
39 this.application.ninja.workspaceMode = "default";
40 }
41 }
42 },
43
44 HandleLeftButtonDown: {
45 value: function(event) {
46 NJevent("enableStageMove");
47 this.application.ninja.stage.bindingView.validateOverHud();
48 }
49 },
50
51 HandleMouseMove: {
52 value: function(event) {
53 /*
54 In the mouse over event we need to validate if the mouse over is over a hud.
55 If it on top of a hud bring that single hud to the top to associate with.
56
57 */
58 //this.doDraw(event);
59 }
60 },
61
62 HandleLeftButtonUp: {
63 value: function(event) {
64
65 if(this._escape) {
66 this._escape = false;
67 return;
68 }
69
70 if(this._hasDraw) {
71 this._hasDraw = false;
72 //this.endDraw(event);
73 } else {
74 this.doSelection(event);
75 if (this.application.ninja.selectedElements.length !== 0 ) {
76 if(this.application.ninja.selectedElements[0].controller) {
77 this.selectedComponent = this.application.ninja.selectedElements[0].controller;
78 }
79 } else {
80 this.selectedComponent = null;
81 }
82 this.application.ninja.stage.bindingView.selectedComponent = this.selectedComponent;
83 this._isDrawing = false;
84 }
85 //this.endDraw(event);
86 //NJevent("disableStageMove");
87 }
88 }
89}); \ No newline at end of file