diff options
Diffstat (limited to 'js/tools')
-rw-r--r-- | js/tools/bindingTool.js | 68 |
1 files changed, 68 insertions, 0 deletions
diff --git a/js/tools/bindingTool.js b/js/tools/bindingTool.js new file mode 100644 index 00000000..5953c409 --- /dev/null +++ b/js/tools/bindingTool.js | |||
@@ -0,0 +1,68 @@ | |||
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 | var Montage = require("montage/core/core").Montage, | ||
8 | DrawingTool = require("js/tools/drawing-tool").DrawingTool, | ||
9 | ModifierToolBase = require("js/tools/modifier-tool-base").ModifierToolBase; | ||
10 | SelectionTool = require("js/tools/SelectionTool").SelectionTool; | ||
11 | |||
12 | |||
13 | exports.BindingTool = Montage.create(ModifierToolBase, { | ||
14 | drawingFeedback: { value: { mode: "Draw2D", type: "" } }, | ||
15 | |||
16 | Configure: { | ||
17 | value: function (doActivate) | ||
18 | { | ||
19 | if (doActivate) | ||
20 | { | ||
21 | NJevent("enableStageMove"); | ||
22 | this.application.ninja.workspaceMode = "binding"; | ||
23 | |||
24 | } | ||
25 | else | ||
26 | { | ||
27 | NJevent("disableStageMove"); | ||
28 | this.application.ninja.workspaceMode = "default"; | ||
29 | } | ||
30 | } | ||
31 | }, | ||
32 | |||
33 | HandleLeftButtonDown: { | ||
34 | value: function(event) { | ||
35 | NJevent("enableStageMove"); | ||
36 | |||
37 | } | ||
38 | }, | ||
39 | |||
40 | HandleMouseMove: { | ||
41 | value: function(event) { | ||
42 | this.doDraw(event); | ||
43 | } | ||
44 | }, | ||
45 | |||
46 | HandleLeftButtonUp: { | ||
47 | value: function(event) { | ||
48 | |||
49 | if(this._escape) { | ||
50 | this._escape = false; | ||
51 | return; | ||
52 | } | ||
53 | |||
54 | if(this._hasDraw) { | ||
55 | this._hasDraw = false; | ||
56 | this.endDraw(event); | ||
57 | } else { | ||
58 | this.doSelection(event); | ||
59 | if (this.application.ninja.selectedElements.length !== 0 ) { | ||
60 | this.selectedElement = this.application.ninja.selectedElements[0]; | ||
61 | } | ||
62 | this._isDrawing = false; | ||
63 | } | ||
64 | //this.endDraw(event); | ||
65 | //NJevent("disableStageMove"); | ||
66 | } | ||
67 | } | ||
68 | }); \ No newline at end of file | ||