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 --- .../binding-hud-option.reel/binding-hud-option.css | 5 ++++ .../binding-hud-option.html | 27 ++++++++++++++++++ .../binding-hud-option.reel/binding-hud-option.js | 18 ++++++++++++ .../binding-hud.reel/binding-hud.html | 13 +++++++-- .../binding-hud.reel/binding-hud.js | 9 ++++-- js/stage/binding-view.reel/binding-view.html | 11 +++++--- js/stage/binding-view.reel/binding-view.js | 33 ++++++++++++++++++---- .../non-visual-component.css | 5 ++++ .../non-visual-component.html | 27 ++++++++++++++++++ .../non-visual-component.js | 18 ++++++++++++ js/stage/stage.reel/stage.html | 12 ++++++-- js/tools/bindingTool.js | 2 +- 12 files changed, 164 insertions(+), 16 deletions(-) create mode 100755 js/stage/binding-view.reel/binding-hud-option.reel/binding-hud-option.css create mode 100755 js/stage/binding-view.reel/binding-hud-option.reel/binding-hud-option.html create mode 100755 js/stage/binding-view.reel/binding-hud-option.reel/binding-hud-option.js create mode 100755 js/stage/binding-view.reel/non-visual-component.reel/non-visual-component.css create mode 100755 js/stage/binding-view.reel/non-visual-component.reel/non-visual-component.html create mode 100755 js/stage/binding-view.reel/non-visual-component.reel/non-visual-component.js (limited to 'js') diff --git a/js/stage/binding-view.reel/binding-hud-option.reel/binding-hud-option.css b/js/stage/binding-view.reel/binding-hud-option.reel/binding-hud-option.css new file mode 100755 index 00000000..018448f1 --- /dev/null +++ b/js/stage/binding-view.reel/binding-hud-option.reel/binding-hud-option.css @@ -0,0 +1,5 @@ +/* + 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. +
*/ diff --git a/js/stage/binding-view.reel/binding-hud-option.reel/binding-hud-option.html b/js/stage/binding-view.reel/binding-hud-option.reel/binding-hud-option.html new file mode 100755 index 00000000..6b670455 --- /dev/null +++ b/js/stage/binding-view.reel/binding-hud-option.reel/binding-hud-option.html @@ -0,0 +1,27 @@ + + + + + + + + + + + +
Label for options
+ + diff --git a/js/stage/binding-view.reel/binding-hud-option.reel/binding-hud-option.js b/js/stage/binding-view.reel/binding-hud-option.reel/binding-hud-option.js new file mode 100755 index 00000000..91a0564e --- /dev/null +++ b/js/stage/binding-view.reel/binding-hud-option.reel/binding-hud-option.js @@ -0,0 +1,18 @@ +/* +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. +
*/ + +/** +@requires montage/core/core +@requires montage/ui/component +*/ +var Montage = require("montage/core/core").Montage, + Component = require("montage/ui/component").Component; + +exports.bindingHud = Montage.create(Component, { + title: { + value: "value" + } +}); \ No newline at end of file diff --git a/js/stage/binding-view.reel/binding-hud.reel/binding-hud.html b/js/stage/binding-view.reel/binding-hud.reel/binding-hud.html index 73252de4..c81b70d3 100755 --- a/js/stage/binding-view.reel/binding-hud.reel/binding-hud.html +++ b/js/stage/binding-view.reel/binding-hud.reel/binding-hud.html @@ -25,11 +25,20 @@ "bindings": { "objects": { "boundObject": {"@": "owner"}, - "boundObjectPropertyPath": "bindables", + "boundObjectPropertyPath": "properties", "oneway": true } } }, + "hudOption": { + "prototype": "js/stage/binding-view.reel/binding-hud-option.reel", + "properties": { + "element": {"#" : "hudOption"} + }, + "bindings": { + "title": {"<-": "@objectAtCurrentIteration.title"} + } + } } @@ -39,7 +48,7 @@
- +
diff --git a/js/stage/binding-view.reel/binding-hud.reel/binding-hud.js b/js/stage/binding-view.reel/binding-hud.reel/binding-hud.js index cbb4c1d7..a63f2775 100755 --- a/js/stage/binding-view.reel/binding-hud.reel/binding-hud.js +++ b/js/stage/binding-view.reel/binding-hud.reel/binding-hud.js @@ -11,6 +11,11 @@ No rights, expressed or implied, whatsoever to this software are provided by Mot var Montage = require("montage/core/core").Montage, Component = require("montage/ui/component").Component; -exports.bindingHud = Montage.create(Component, { - +exports.BindingHud = Montage.create(Component, { + properties: { + value: [ + {"title": "myProperty1"}, + {"title":"myproperty2"} + ] + } }); \ No newline at end of file diff --git a/js/stage/binding-view.reel/binding-view.html b/js/stage/binding-view.reel/binding-view.html index 43fa0112..152345d4 100755 --- a/js/stage/binding-view.reel/binding-view.html +++ b/js/stage/binding-view.reel/binding-view.html @@ -21,7 +21,7 @@ "hudRepeater": { "prototype": "montage/ui/repetition.reel", "properties": { - "element": {"#": "hudRepetition"} + "element": {"#": "hudRepeater"} }, "bindings": { "objects": { @@ -57,12 +57,12 @@ }, "bindings": { "objectName": { - "boundObject": {"@": "hudRepetition"}, + "boundObject": {"@": "hudRepeater"}, "boundObjectPropertyPath": "objectAtCurrentIteration.objectName", "oneway": true }, "objectImage": { - "boundObject": {"@": "undoList"}, + "boundObject": {"@": "hudRepeater"}, "boundObjectPropertyPath": "objectAtCurrentIteration.objectImage", "oneway": true } @@ -76,11 +76,14 @@
-
+
+
+
+
diff --git a/js/stage/binding-view.reel/binding-view.js b/js/stage/binding-view.reel/binding-view.js index d3d988c1..df3bc3ee 100755 --- a/js/stage/binding-view.reel/binding-view.js +++ b/js/stage/binding-view.reel/binding-view.js @@ -11,10 +11,31 @@ No rights, expressed or implied, whatsoever to this software are provided by Mot var Montage = require("montage/core/core").Montage, Component = require("montage/ui/component").Component; -exports.bindingView = Montage.create(Component, { +exports.BindingView = Montage.create(Component, { + //private Properties + _selectedElement: { + value: null + }, _bindables: { value: [] }, + _nonVisualComponents: { + value:null + }, + + //Public Objects + hudRepeater: { value: null }, + + + //Public Properties + selectedElement: { + get: function() { + return this._selectedElement; + }, + set: function(val) { + this._selectedElement = val; + } + }, bindables: { get: function() { return this._bindables; @@ -23,14 +44,16 @@ exports.bindingView = Montage.create(Component, { this._bindables = val; } }, - - nonVisualComponents: { get: function() { - return this._bindables; + return this._nonVisualComponents; }, set: function(val) { - this._bindables = val; + this._nonVisualComponents = val; } } + + //Methods + + }); \ No newline at end of file diff --git a/js/stage/binding-view.reel/non-visual-component.reel/non-visual-component.css b/js/stage/binding-view.reel/non-visual-component.reel/non-visual-component.css new file mode 100755 index 00000000..018448f1 --- /dev/null +++ b/js/stage/binding-view.reel/non-visual-component.reel/non-visual-component.css @@ -0,0 +1,5 @@ +/* + 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. +
*/ diff --git a/js/stage/binding-view.reel/non-visual-component.reel/non-visual-component.html b/js/stage/binding-view.reel/non-visual-component.reel/non-visual-component.html new file mode 100755 index 00000000..5b07bfe9 --- /dev/null +++ b/js/stage/binding-view.reel/non-visual-component.reel/non-visual-component.html @@ -0,0 +1,27 @@ + + + + + + + + + + + +
Label for options
+ + diff --git a/js/stage/binding-view.reel/non-visual-component.reel/non-visual-component.js b/js/stage/binding-view.reel/non-visual-component.reel/non-visual-component.js new file mode 100755 index 00000000..2ff2e2f7 --- /dev/null +++ b/js/stage/binding-view.reel/non-visual-component.reel/non-visual-component.js @@ -0,0 +1,18 @@ +/* +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. +
*/ + +/** +@requires montage/core/core +@requires montage/ui/component +*/ +var Montage = require("montage/core/core").Montage, + Component = require("montage/ui/component").Component; + +exports.NonVisualComponent = Montage.create(Component, { + title: { + value: "value" + } +}); \ No newline at end of file diff --git a/js/stage/stage.reel/stage.html b/js/stage/stage.reel/stage.html index 88cd6149..79e34802 100755 --- a/js/stage/stage.reel/stage.html +++ b/js/stage/stage.reel/stage.html @@ -53,7 +53,13 @@ "focusManager": { "object": "js/components/focus-manager.reel" }, - + + "bindingView": { + "prototype": "js/stage/binding-view.reel", + "properties" : { + "element": {"#": "bindingView" } + } + }, "owner": { "prototype": "js/stage/stage.reel", "properties": { @@ -66,7 +72,8 @@ "layout": {"@": "layout1"}, "stageView": {"@": "stageView"}, "textTool": {"@": "textTool"}, - "focusManager": {"@": "focusManager"} + "focusManager": {"@": "focusManager"}, + "bindingView": {"@": "bindingView"} }, "bindings": { "currentDocumentStageView": { @@ -89,6 +96,7 @@ +
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