From 5d7e470351fd150d5e70a97332fa2f2553797499 Mon Sep 17 00:00:00 2001 From: Armen Kesablyan Date: Mon, 7 May 2012 11:09:45 -0700 Subject: Initial Setup of the binding Tool Signed-off-by: Armen Kesablyan --- js/tools/bindingTool.js | 32 ++++++++++++++++++++++++++++++++ 1 file changed, 32 insertions(+) create mode 100644 js/tools/bindingTool.js (limited to 'js/tools/bindingTool.js') diff --git a/js/tools/bindingTool.js b/js/tools/bindingTool.js new file mode 100644 index 00000000..05a4965f --- /dev/null +++ b/js/tools/bindingTool.js @@ -0,0 +1,32 @@ +/* +This file contains proprietary software owned by Motorola Mobility, Inc.
+No rights, expressed or implied, whatsoever to this software are provided by Motorola Mobility, Inc. hereunder.
+(c) Copyright 2011 Motorola Mobility, Inc. All Rights Reserved. +
*/ + +var Montage = require("montage/core/core").Montage, + DrawingTool = require("js/tools/drawing-tool").DrawingTool; + +exports.BindingTool = Montage.create(DrawingTool, { + drawingFeedback: { value: { mode: "Draw2D", type: "" } }, + + HandleLeftButtonDown: { + value: function(event) { + NJevent("enableStageMove"); + + } + }, + + HandleMouseMove: { + value: function(event) { + this.doDraw(event); + } + }, + + HandleLeftButtonUp: { + value: function(event) { + this.endDraw(event); + NJevent("disableStageMove"); + } + } +}); \ No newline at end of file -- cgit v1.2.3 From c80e7df1702dff09b5cc8447ab0619747fed2024 Mon Sep 17 00:00:00 2001 From: Armen Kesablyan Date: Fri, 11 May 2012 15:03:10 -0700 Subject: created the initial environment requirements for workspace to be manipulated. Signed-off-by: Armen Kesablyan --- js/tools/bindingTool.js | 23 +++++++++++++++++++++-- 1 file changed, 21 insertions(+), 2 deletions(-) (limited to 'js/tools/bindingTool.js') diff --git a/js/tools/bindingTool.js b/js/tools/bindingTool.js index 05a4965f..282e3408 100644 --- a/js/tools/bindingTool.js +++ b/js/tools/bindingTool.js @@ -5,11 +5,30 @@ No rights, expressed or implied, whatsoever to this software are provided by Mot */ var Montage = require("montage/core/core").Montage, - DrawingTool = require("js/tools/drawing-tool").DrawingTool; + DrawingTool = require("js/tools/drawing-tool").DrawingTool, +ModifierToolBase = require("js/tools/modifier-tool-base").ModifierToolBase; -exports.BindingTool = Montage.create(DrawingTool, { + +exports.BindingTool = Montage.create(ModifierToolBase, { drawingFeedback: { value: { mode: "Draw2D", type: "" } }, + Configure: { + value: function (doActivate) + { + if (doActivate) + { + NJevent("enableStageMove"); + document.body.classList.add("ws-binding"); + + } + else + { + NJevent("disableStageMove"); + document.body.classList.remove("ws-binding"); + } + } + }, + HandleLeftButtonDown: { value: function(event) { NJevent("enableStageMove"); -- cgit v1.2.3 From c3452da7c18f73f45e4e6a58918f6459e7915b62 Mon Sep 17 00:00:00 2001 From: Armen Kesablyan Date: Tue, 15 May 2012 15:02:40 -0700 Subject: Finished skeleton structure for binding. Signed-off-by: Armen Kesablyan --- js/tools/bindingTool.js | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) (limited to 'js/tools/bindingTool.js') diff --git a/js/tools/bindingTool.js b/js/tools/bindingTool.js index 282e3408..f9e81223 100644 --- a/js/tools/bindingTool.js +++ b/js/tools/bindingTool.js @@ -18,13 +18,14 @@ exports.BindingTool = Montage.create(ModifierToolBase, { if (doActivate) { NJevent("enableStageMove"); - document.body.classList.add("ws-binding"); + this.application.ninja.workspaceMode = "binding"; } else { NJevent("disableStageMove"); - document.body.classList.remove("ws-binding"); + debugger; + this.application.ninja.workspaceMode = "default"; } } }, -- cgit v1.2.3 From 15a3aaebb56cb2c9409bfe55c862868726c7fd44 Mon Sep 17 00:00:00 2001 From: Armen Kesablyan Date: Tue, 15 May 2012 16:32:04 -0700 Subject: removed debugger line Signed-off-by: Armen Kesablyan --- js/tools/bindingTool.js | 1 - 1 file changed, 1 deletion(-) (limited to 'js/tools/bindingTool.js') diff --git a/js/tools/bindingTool.js b/js/tools/bindingTool.js index f9e81223..1a8cb47f 100644 --- a/js/tools/bindingTool.js +++ b/js/tools/bindingTool.js @@ -24,7 +24,6 @@ exports.BindingTool = Montage.create(ModifierToolBase, { else { NJevent("disableStageMove"); - debugger; this.application.ninja.workspaceMode = "default"; } } -- cgit v1.2.3 From d48f086ad64badf07b5f82bf6e0216074eac7a25 Mon Sep 17 00:00:00 2001 From: Armen Kesablyan Date: Wed, 16 May 2012 18:25:03 -0700 Subject: Initial Binding Hud Signed-off-by: Armen Kesablyan --- js/tools/bindingTool.js | 21 +++++++++++++++++++-- 1 file changed, 19 insertions(+), 2 deletions(-) (limited to 'js/tools/bindingTool.js') diff --git a/js/tools/bindingTool.js b/js/tools/bindingTool.js index 1a8cb47f..5953c409 100644 --- a/js/tools/bindingTool.js +++ b/js/tools/bindingTool.js @@ -7,6 +7,7 @@ No rights, expressed or implied, whatsoever to this software are provided by Mot var Montage = require("montage/core/core").Montage, DrawingTool = require("js/tools/drawing-tool").DrawingTool, ModifierToolBase = require("js/tools/modifier-tool-base").ModifierToolBase; +SelectionTool = require("js/tools/SelectionTool").SelectionTool; exports.BindingTool = Montage.create(ModifierToolBase, { @@ -44,8 +45,24 @@ exports.BindingTool = Montage.create(ModifierToolBase, { HandleLeftButtonUp: { value: function(event) { - this.endDraw(event); - NJevent("disableStageMove"); + + if(this._escape) { + this._escape = false; + return; + } + + if(this._hasDraw) { + this._hasDraw = false; + this.endDraw(event); + } else { + this.doSelection(event); + if (this.application.ninja.selectedElements.length !== 0 ) { + this.selectedElement = this.application.ninja.selectedElements[0]; + } + this._isDrawing = false; + } + //this.endDraw(event); + //NJevent("disableStageMove"); } } }); \ No newline at end of file -- cgit v1.2.3 From 3ed95247e9ea4b0a7833401ed6809647b7c4acbf Mon Sep 17 00:00:00 2001 From: Armen Kesablyan Date: Wed, 23 May 2012 14:26:46 -0700 Subject: Binding Visual Tool Initial setup Signed-off-by: Armen Kesablyan --- js/tools/bindingTool.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'js/tools/bindingTool.js') diff --git a/js/tools/bindingTool.js b/js/tools/bindingTool.js index 5953c409..3ebf319e 100644 --- a/js/tools/bindingTool.js +++ b/js/tools/bindingTool.js @@ -33,7 +33,6 @@ exports.BindingTool = Montage.create(ModifierToolBase, { HandleLeftButtonDown: { value: function(event) { NJevent("enableStageMove"); - } }, @@ -58,6 +57,7 @@ exports.BindingTool = Montage.create(ModifierToolBase, { this.doSelection(event); if (this.application.ninja.selectedElements.length !== 0 ) { this.selectedElement = this.application.ninja.selectedElements[0]; + this.application.stage.bindingView.selectedElement = this.selectedElement; } this._isDrawing = false; } -- cgit v1.2.3 From a581fb3c544ee2faeafbb75f7a3f5719f53cf323 Mon Sep 17 00:00:00 2001 From: Armen Kesablyan Date: Wed, 30 May 2012 15:30:38 -0700 Subject: Visual Bindings Initial generate from Array. Signed-off-by: Armen Kesablyan --- js/tools/bindingTool.js | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) (limited to 'js/tools/bindingTool.js') diff --git a/js/tools/bindingTool.js b/js/tools/bindingTool.js index 3ebf319e..1430e090 100644 --- a/js/tools/bindingTool.js +++ b/js/tools/bindingTool.js @@ -57,8 +57,10 @@ exports.BindingTool = Montage.create(ModifierToolBase, { this.doSelection(event); if (this.application.ninja.selectedElements.length !== 0 ) { this.selectedElement = this.application.ninja.selectedElements[0]; - this.application.stage.bindingView.selectedElement = this.selectedElement; + } else { + this.selectedElement = null; } + this.application.ninja.stage.bindingView.selectedElement = this.selectedElement; this._isDrawing = false; } //this.endDraw(event); -- cgit v1.2.3 From 9e187e40d9982654081e52be656e00b3ca4d36b5 Mon Sep 17 00:00:00 2001 From: Armen Kesablyan Date: Fri, 1 Jun 2012 13:13:10 -0700 Subject: Binding View Canvas Initial Development Signed-off-by: Armen Kesablyan --- js/tools/bindingTool.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'js/tools/bindingTool.js') diff --git a/js/tools/bindingTool.js b/js/tools/bindingTool.js index 1430e090..a467ed3e 100644 --- a/js/tools/bindingTool.js +++ b/js/tools/bindingTool.js @@ -20,7 +20,6 @@ exports.BindingTool = Montage.create(ModifierToolBase, { { NJevent("enableStageMove"); this.application.ninja.workspaceMode = "binding"; - } else { @@ -33,6 +32,7 @@ exports.BindingTool = Montage.create(ModifierToolBase, { HandleLeftButtonDown: { value: function(event) { NJevent("enableStageMove"); + this.application.ninja.stage.bindingView.handleMouseDown(event); } }, -- cgit v1.2.3 From 7655e32da5bcdf7b205afc1908c9b7bcc661b0d4 Mon Sep 17 00:00:00 2001 From: Armen Kesablyan Date: Sat, 2 Jun 2012 20:54:30 -0700 Subject: binding canvas Signed-off-by: Armen Kesablyan --- js/tools/bindingTool.js | 25 ++++++++++++++++++++----- 1 file changed, 20 insertions(+), 5 deletions(-) (limited to 'js/tools/bindingTool.js') diff --git a/js/tools/bindingTool.js b/js/tools/bindingTool.js index a467ed3e..6b541096 100644 --- a/js/tools/bindingTool.js +++ b/js/tools/bindingTool.js @@ -12,6 +12,18 @@ SelectionTool = require("js/tools/SelectionTool").SelectionTool; exports.BindingTool = Montage.create(ModifierToolBase, { drawingFeedback: { value: { mode: "Draw2D", type: "" } }, + _selectedComponent: { + value: null + }, + + selectedComponent: { + get:function() { + return this._selectedComponent; + }, + set: function(val) { + this._selectedComponent = val; + } + }, Configure: { value: function (doActivate) @@ -32,13 +44,13 @@ exports.BindingTool = Montage.create(ModifierToolBase, { HandleLeftButtonDown: { value: function(event) { NJevent("enableStageMove"); - this.application.ninja.stage.bindingView.handleMouseDown(event); + this.application.ninja.stage.bindingView.handleMousedown(event); } }, HandleMouseMove: { value: function(event) { - this.doDraw(event); + //this.doDraw(event); } }, @@ -56,11 +68,14 @@ exports.BindingTool = Montage.create(ModifierToolBase, { } else { this.doSelection(event); if (this.application.ninja.selectedElements.length !== 0 ) { - this.selectedElement = this.application.ninja.selectedElements[0]; + if(this.application.ninja.selectedElements[0].controller) { + this.selectedComponent = this.application.ninja.selectedElements[0].controller; + } } else { - this.selectedElement = null; + this.selectedComponent = null; } - this.application.ninja.stage.bindingView.selectedElement = this.selectedElement; + this.application.ninja.stage.bindingView.selectedElement = this.selectedComponent; + this.application.ninja.objectsController.currentObject = this.selectedComponent; this._isDrawing = false; } //this.endDraw(event); -- cgit v1.2.3 From cd089f6692934a68bda7c303928a7c78dd13ac07 Mon Sep 17 00:00:00 2001 From: Armen Kesablyan Date: Tue, 5 Jun 2012 12:55:34 -0700 Subject: Changes for binding View Signed-off-by: Armen Kesablyan --- js/tools/bindingTool.js | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) (limited to 'js/tools/bindingTool.js') diff --git a/js/tools/bindingTool.js b/js/tools/bindingTool.js index 6b541096..2d459a61 100644 --- a/js/tools/bindingTool.js +++ b/js/tools/bindingTool.js @@ -64,7 +64,7 @@ exports.BindingTool = Montage.create(ModifierToolBase, { if(this._hasDraw) { this._hasDraw = false; - this.endDraw(event); + //this.endDraw(event); } else { this.doSelection(event); if (this.application.ninja.selectedElements.length !== 0 ) { @@ -74,8 +74,7 @@ exports.BindingTool = Montage.create(ModifierToolBase, { } else { this.selectedComponent = null; } - this.application.ninja.stage.bindingView.selectedElement = this.selectedComponent; - this.application.ninja.objectsController.currentObject = this.selectedComponent; + this.application.ninja.stage.bindingView.selectedComponent = this.selectedComponent; this._isDrawing = false; } //this.endDraw(event); -- cgit v1.2.3 From cd8f5e98dd1ba97d81a7f1f2362f9ce481577957 Mon Sep 17 00:00:00 2001 From: Armen Kesablyan Date: Mon, 11 Jun 2012 10:44:59 -0700 Subject: Binding-View : Deselect Works Now, Rendering multiple Huds Available Signed-off-by: Armen Kesablyan --- js/tools/bindingTool.js | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) (limited to 'js/tools/bindingTool.js') diff --git a/js/tools/bindingTool.js b/js/tools/bindingTool.js index 2d459a61..6444d2a7 100644 --- a/js/tools/bindingTool.js +++ b/js/tools/bindingTool.js @@ -44,12 +44,17 @@ exports.BindingTool = Montage.create(ModifierToolBase, { HandleLeftButtonDown: { value: function(event) { NJevent("enableStageMove"); - this.application.ninja.stage.bindingView.handleMousedown(event); + this.application.ninja.stage.bindingView.validateOverHud(); } }, HandleMouseMove: { value: function(event) { + /* + In the mouse over event we need to validate if the mouse over is over a hud. + If it on top of a hud bring that single hud to the top to associate with. + + */ //this.doDraw(event); } }, -- cgit v1.2.3 From f5e70ca6204f78c395458d39f14ddaf45308edf7 Mon Sep 17 00:00:00 2001 From: Armen Kesablyan Date: Mon, 18 Jun 2012 13:22:08 -0700 Subject: Binding View - validate over huds Signed-off-by: Armen Kesablyan --- js/tools/bindingTool.js | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-) (limited to 'js/tools/bindingTool.js') diff --git a/js/tools/bindingTool.js b/js/tools/bindingTool.js index 6444d2a7..93af11c2 100644 --- a/js/tools/bindingTool.js +++ b/js/tools/bindingTool.js @@ -22,6 +22,7 @@ exports.BindingTool = Montage.create(ModifierToolBase, { }, set: function(val) { this._selectedComponent = val; + this.application.ninja.stage.bindingView.selectedComponent = val; } }, @@ -32,19 +33,23 @@ exports.BindingTool = Montage.create(ModifierToolBase, { { NJevent("enableStageMove"); this.application.ninja.workspaceMode = "binding"; + if (this.application.ninja.selectedElements.length !== 0 ) { + this.selectedComponent = this.application.ninja.selectedElements[0].controller; + } } else { NJevent("disableStageMove"); this.application.ninja.workspaceMode = "default"; + this.selectedComponent = null; } + } }, HandleLeftButtonDown: { value: function(event) { NJevent("enableStageMove"); - this.application.ninja.stage.bindingView.validateOverHud(); } }, @@ -53,8 +58,8 @@ exports.BindingTool = Montage.create(ModifierToolBase, { /* In the mouse over event we need to validate if the mouse over is over a hud. If it on top of a hud bring that single hud to the top to associate with. - */ + this.application.ninja.stage.bindingView.handleMousemove(event); //this.doDraw(event); } }, @@ -79,7 +84,6 @@ exports.BindingTool = Montage.create(ModifierToolBase, { } else { this.selectedComponent = null; } - this.application.ninja.stage.bindingView.selectedComponent = this.selectedComponent; this._isDrawing = false; } //this.endDraw(event); -- cgit v1.2.3 From 20ea3997661b068fc6628ffa573e1b2d47e3a800 Mon Sep 17 00:00:00 2001 From: Armen Kesablyan Date: Tue, 19 Jun 2012 22:51:04 -0700 Subject: Binding View - Mouse Over Element Pop up Hud Signed-off-by: Armen Kesablyan --- js/tools/bindingTool.js | 34 ++++++++++++++++++---------------- 1 file changed, 18 insertions(+), 16 deletions(-) (limited to 'js/tools/bindingTool.js') diff --git a/js/tools/bindingTool.js b/js/tools/bindingTool.js index 93af11c2..b284fc47 100644 --- a/js/tools/bindingTool.js +++ b/js/tools/bindingTool.js @@ -59,6 +59,7 @@ exports.BindingTool = Montage.create(ModifierToolBase, { In the mouse over event we need to validate if the mouse over is over a hud. If it on top of a hud bring that single hud to the top to associate with. */ + this.application.ninja.stage.bindingView.handleMousemove(event); //this.doDraw(event); } @@ -66,25 +67,26 @@ exports.BindingTool = Montage.create(ModifierToolBase, { HandleLeftButtonUp: { value: function(event) { + if(!this.application.ninja.stage.bindingView._isDrawingConnection) { + if(this._escape) { + this._escape = false; + return; + } - if(this._escape) { - this._escape = false; - return; - } - - if(this._hasDraw) { - this._hasDraw = false; - //this.endDraw(event); - } else { - this.doSelection(event); - if (this.application.ninja.selectedElements.length !== 0 ) { - if(this.application.ninja.selectedElements[0].controller) { - this.selectedComponent = this.application.ninja.selectedElements[0].controller; - } + if(this._hasDraw) { + this._hasDraw = false; + //this.endDraw(event); } else { - this.selectedComponent = null; + this.doSelection(event); + if (this.application.ninja.selectedElements.length !== 0 ) { + if(this.application.ninja.selectedElements[0].controller) { + this.selectedComponent = this.application.ninja.selectedElements[0].controller; + } + } else { + this.selectedComponent = null; + } + this._isDrawing = false; } - this._isDrawing = false; } //this.endDraw(event); //NJevent("disableStageMove"); -- cgit v1.2.3 From 24c6741d594b9d4167cd4de407a625eb43ebe7cc Mon Sep 17 00:00:00 2001 From: Armen Kesablyan Date: Sat, 23 Jun 2012 13:58:16 -0700 Subject: Binding View: Fixed If Selected Div Erroring Out Signed-off-by: Armen Kesablyan --- js/tools/bindingTool.js | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) (limited to 'js/tools/bindingTool.js') diff --git a/js/tools/bindingTool.js b/js/tools/bindingTool.js index b284fc47..1e1c9e5b 100644 --- a/js/tools/bindingTool.js +++ b/js/tools/bindingTool.js @@ -34,7 +34,12 @@ exports.BindingTool = Montage.create(ModifierToolBase, { NJevent("enableStageMove"); this.application.ninja.workspaceMode = "binding"; if (this.application.ninja.selectedElements.length !== 0 ) { - this.selectedComponent = this.application.ninja.selectedElements[0].controller; + if(typeof(this.application.ninja.selectedElements[0].controller) !== "undefined") { + this.selectedComponent = this.application.ninja.selectedElements[0].controller; + } else { + this.selectedComponent = null; + } + } } else @@ -81,6 +86,8 @@ exports.BindingTool = Montage.create(ModifierToolBase, { if (this.application.ninja.selectedElements.length !== 0 ) { if(this.application.ninja.selectedElements[0].controller) { this.selectedComponent = this.application.ninja.selectedElements[0].controller; + } else { + this.selectedComponent = null; } } else { this.selectedComponent = null; -- cgit v1.2.3