From dd663d8fe9191cc57c9cebe6d425562cb45982c2 Mon Sep 17 00:00:00 2001 From: John Mayhew Date: Tue, 8 May 2012 07:25:09 -0700 Subject: Removed unused SubSelect Tool --- css/ninja.css | 2 - .../layout/tools-list.reel/tools-list.html | 4 -- js/components/layout/tools-list.reel/tools-list.js | 2 - .../tools-properties.reel/tools-properties.html | 8 ---- .../subselection-properties.html | 32 ------------- .../subselection-properties.js | 14 ------ js/data/tools-data.js | 52 +++++++++++++++++----- js/mediators/keyboard-mediator.js | 32 ++++++------- js/ninja.reel/ninja.js | 6 +-- scss/imports/scss/_toolbar.scss | 4 -- 10 files changed, 60 insertions(+), 96 deletions(-) delete mode 100755 js/components/tools-properties/subselection-properties.reel/subselection-properties.html delete mode 100755 js/components/tools-properties/subselection-properties.reel/subselection-properties.js diff --git a/css/ninja.css b/css/ninja.css index b619eee1..2acfcb5d 100755 --- a/css/ninja.css +++ b/css/ninja.css @@ -833,8 +833,6 @@ input[type="radio"]:disabled { opacity: .3; background: #282828; border-width: 1 .SelectionTool { background-image: url("../images/tools/Tool-Selection.png"); } -.SubselectionTool { background-image: url("../images/tools/Tool-Subselect.png"); } - .RotateTool3D { background-image: url("../images/tools/Tool-3DRotate.png"); } .Translate3D { background-image: url("../images/tools/Tool-3DTranslate.png"); } diff --git a/js/components/layout/tools-list.reel/tools-list.html b/js/components/layout/tools-list.reel/tools-list.html index 0c51aa9a..d5c33624 100755 --- a/js/components/layout/tools-list.reel/tools-list.html +++ b/js/components/layout/tools-list.reel/tools-list.html @@ -55,9 +55,6 @@ "SelectionTool1": { "prototype": "js/tools/SelectionTool" }, - "SubselectionTool1": { - "prototype": "js/tools/SubSelectTool" - }, "Rotate3DTool1": { "prototype": "js/tools/RotateObject3DTool" }, @@ -126,7 +123,6 @@ "properties": { "element": {"#": "toolsList"}, "SelectionTool": {"@": "SelectionTool1"}, - "SubselectionTool": {"@": "SubselectionTool1"}, "Rotate3DTool": {"@": "Rotate3DTool1"}, "Translate3DTool": {"@": "Translate3DTool1"}, "TagTool": {"@": "TagTool1"}, diff --git a/js/components/layout/tools-list.reel/tools-list.js b/js/components/layout/tools-list.reel/tools-list.js index ed4ee45f..a10b6c3e 100755 --- a/js/components/layout/tools-list.reel/tools-list.js +++ b/js/components/layout/tools-list.reel/tools-list.js @@ -10,7 +10,6 @@ var Component = require("montage/ui/component").Component; exports.ToolsList = Montage.create(Component, { SelectionTool: { value: null }, - SubselectionTool: { value: null }, Rotate3DTool: { value: null }, Translate3DTool: { value: null }, TagTool: { value: null }, @@ -51,7 +50,6 @@ exports.ToolsList = Montage.create(Component, { this.PenTool.options = this.application.ninja.toolsProperties.shapeProperties.lineProperties;//this.application.Ninja.toolsProperties.penProperties; this.SelectionTool.options = this.application.ninja.toolsProperties.selectionProperties; - this.SubselectionTool.options = this.application.ninja.toolsProperties.subSelectionProperties; this.Rotate3DTool.options = this.application.ninja.toolsProperties.rotate3DProperties; this.Translate3DTool.options = this.application.ninja.toolsProperties.rotate3DProperties; diff --git a/js/components/layout/tools-properties.reel/tools-properties.html b/js/components/layout/tools-properties.reel/tools-properties.html index a24ce658..e7d1ac8b 100755 --- a/js/components/layout/tools-properties.reel/tools-properties.html +++ b/js/components/layout/tools-properties.reel/tools-properties.html @@ -18,12 +18,6 @@ "element": {"#": "selectionProperties"} } }, - "subSelectionProperties1": { - "prototype": "js/components/tools-properties/subselection-properties.reel[SubSelectionProperties]", - "properties": { - "element": {"#": "subSelectionProperties"} - } - }, "object3DProperties1": { "prototype": "js/components/tools-properties/object3d-properties.reel[Object3DProperties]", "properties": { @@ -128,7 +122,6 @@ "properties": { "element": {"#": "toolsProperties"}, "selectionProperties": {"@": "selectionProperties1"}, - "subSelectionProperties": {"@": "subSelectionProperties1"}, "rotate3DProperties": {"@": "object3DProperties1"}, "translate3DProperties": {"@": "object3DProperties1"}, "tagProperties": {"@": "tagProperties1"}, @@ -159,7 +152,6 @@
-
diff --git a/js/components/tools-properties/subselection-properties.reel/subselection-properties.html b/js/components/tools-properties/subselection-properties.reel/subselection-properties.html deleted file mode 100755 index bde47659..00000000 --- a/js/components/tools-properties/subselection-properties.reel/subselection-properties.html +++ /dev/null @@ -1,32 +0,0 @@ - - - - - - - - - - - - -
-
-
- - - \ No newline at end of file diff --git a/js/components/tools-properties/subselection-properties.reel/subselection-properties.js b/js/components/tools-properties/subselection-properties.reel/subselection-properties.js deleted file mode 100755 index bcd13642..00000000 --- a/js/components/tools-properties/subselection-properties.reel/subselection-properties.js +++ /dev/null @@ -1,14 +0,0 @@ -/* -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; -var Component = require("montage/ui/component").Component; -var ToolProperties = require("js/components/tools-properties/tool-properties").ToolProperties; - -exports.SubSelectionProperties = Montage.create(ToolProperties, { - - -}); \ No newline at end of file diff --git a/js/data/tools-data.js b/js/data/tools-data.js index ac6fe6e5..32eaf24d 100755 --- a/js/data/tools-data.js +++ b/js/data/tools-data.js @@ -7,7 +7,48 @@ No rights, expressed or implied, whatsoever to this software are provided by Mot var Montage = require("montage/core/core").Montage; exports.ToolsData = Montage.create(Montage, { + selectionToolIndex : { + value: 0 + }, + rotate3DToolIndex: { + value: 1 + }, + translate3DToolIndex: { + value: 2 + }, + tagToolIndex: { + value: 3 + }, + penToolIndex: { + value: 4 + }, + textToolIndex: { + value: 5 + }, + shapeToolIndex: { + value: 6 + }, + brushToolIndex: { + value: 7 + }, + fillToolIndex: { + value: 8 + }, + inkBottleToolIndex: { + value: 9 + }, + rotateStage3DToolIndex: { + value: 10 + }, + panToolIndex: { + value: 11 + }, + zoomToolIndex: { + value: 12 + }, + // NOTE: additions or removal of any tools, or any changes in the order of these entries requires updating the constant index properties above. + // Code in the keyboard mediator and ninja.js accesses the array below through the index constants above defaultToolsData: { value: [ { @@ -21,17 +62,6 @@ exports.ToolsData = Montage.create(Montage, { "container": false, "selected": true }, - { - "id": "SubselectionTool", - "properties": "subSelectionProperties", - "spriteSheet": true, - "action": "SubselectionTool", - "toolTip": "Subselect Tool", - "cursor": "auto", - "lastInGroup": true, - "container": false, - "selected": false - }, { "id": "RotateTool3D", "properties": "rotate3DProperties", diff --git a/js/mediators/keyboard-mediator.js b/js/mediators/keyboard-mediator.js index c647107f..665e3ce7 100755 --- a/js/mediators/keyboard-mediator.js +++ b/js/mediators/keyboard-mediator.js @@ -110,35 +110,35 @@ exports.KeyboardMediator = Montage.create(Component, { // Shortcut for Selection Tool is V if(evt.keyCode === Keyboard.V) { evt.preventDefault(); - this.application.ninja.handleSelectTool({"detail": this.application.ninja.toolsData.defaultToolsData[0]}); + this.application.ninja.handleSelectTool({ "detail": this.application.ninja.toolsData.defaultToolsData[this.application.ninja.toolsData.selectionToolIndex] }); return; } // Shortcut for Tag Tool is D if(evt.keyCode === Keyboard.D){ evt.preventDefault(); - this.application.ninja.handleSelectTool({"detail": this.application.ninja.toolsData.defaultToolsData[4]}); + this.application.ninja.handleSelectTool({ "detail": this.application.ninja.toolsData.defaultToolsData[this.application.ninja.toolsData.tagToolIndex] }); return; } // Shortcut for Rotate Tool is W if(evt.keyCode === Keyboard.W){ evt.preventDefault(); - this.application.ninja.handleSelectTool({"detail": this.application.ninja.toolsData.defaultToolsData[2]}); + this.application.ninja.handleSelectTool({ "detail": this.application.ninja.toolsData.defaultToolsData[this.application.ninja.toolsData.rotate3DToolIndex] }); return; } // Shortcut for Translate Tool is G if(evt.keyCode === Keyboard.G){ evt.preventDefault(); - this.application.ninja.handleSelectTool({"detail": this.application.ninja.toolsData.defaultToolsData[3]}); + this.application.ninja.handleSelectTool({ "detail": this.application.ninja.toolsData.defaultToolsData[this.application.ninja.toolsData.translate3DToolIndex] }); return; } // shortcut for Pen tool is P if (evt.keyCode === Keyboard.P){ evt.preventDefault(); - this.application.ninja.handleSelectTool({"detail": this.application.ninja.toolsData.defaultToolsData[5]}); + this.application.ninja.handleSelectTool({ "detail": this.application.ninja.toolsData.defaultToolsData[this.application.ninja.toolsData.penToolIndex] }); return; } @@ -147,24 +147,24 @@ exports.KeyboardMediator = Montage.create(Component, { // If the user is pressing the command key, they want to refresh the browser. if((evt.keyCode === Keyboard.R) && !evt.metaKey) { evt.preventDefault(); - this.application.ninja.handleSelectTool({"detail": this.application.ninja.toolsData.defaultToolsData[7]}); - this.application.ninja.handleSelectSubTool({"detail": this.application.ninja.toolsData.defaultToolsData[7].subtools[1]}); + this.application.ninja.handleSelectTool({ "detail": this.application.ninja.toolsData.defaultToolsData[this.application.ninja.toolsData.shapeToolIndex] }); + this.application.ninja.handleSelectSubTool({ "detail": this.application.ninja.toolsData.defaultToolsData[this.application.ninja.toolsData.shapeToolIndex].subtools[1] }); return; } // Shortcut for Oval Tool is O if(evt.keyCode === Keyboard.O) { evt.preventDefault(); - this.application.ninja.handleSelectTool({"detail": this.application.ninja.toolsData.defaultToolsData[7]}); - this.application.ninja.handleSelectSubTool({"detail": this.application.ninja.toolsData.defaultToolsData[7].subtools[0]}); + this.application.ninja.handleSelectTool({ "detail": this.application.ninja.toolsData.defaultToolsData[this.application.ninja.toolsData.shapeToolIndex] }); + this.application.ninja.handleSelectSubTool({ "detail": this.application.ninja.toolsData.defaultToolsData[this.application.ninja.toolsData.shapeToolIndex].subtools[0] }); return; } // Shortcut for Line Tool is L if(evt.keyCode === Keyboard.L ) { evt.preventDefault(); - this.application.ninja.handleSelectTool({"detail": this.application.ninja.toolsData.defaultToolsData[7]}); - this.application.ninja.handleSelectSubTool({"detail": this.application.ninja.toolsData.defaultToolsData[7].subtools[2]}); + this.application.ninja.handleSelectTool({ "detail": this.application.ninja.toolsData.defaultToolsData[this.application.ninja.toolsData.shapeToolIndex] }); + this.application.ninja.handleSelectSubTool({ "detail": this.application.ninja.toolsData.defaultToolsData[this.application.ninja.toolsData.shapeToolIndex].subtools[2] }); return; } @@ -172,9 +172,9 @@ exports.KeyboardMediator = Montage.create(Component, { if(evt.keyCode === Keyboard.K ) { evt.preventDefault(); if(this.application.ninja.toolsData.selectedTool.id === "FillTool") { - this.application.ninja.handleSelectTool({"detail": this.application.ninja.toolsData.defaultToolsData[11]}); + this.application.ninja.handleSelectTool({ "detail": this.application.ninja.toolsData.defaultToolsData[this.application.ninja.toolsData.fillToolIndex] }); } else { - this.application.ninja.handleSelectTool({"detail": this.application.ninja.toolsData.defaultToolsData[10]}); + this.application.ninja.handleSelectTool({ "detail": this.application.ninja.toolsData.defaultToolsData[this.application.ninja.toolsData.inkBottleToolIndex] }); } return; } @@ -182,21 +182,21 @@ exports.KeyboardMediator = Montage.create(Component, { // Rotate Stage Tool is M if(evt.keyCode === Keyboard.M ) { evt.preventDefault(); - this.application.ninja.handleSelectTool({"detail": this.application.ninja.toolsData.defaultToolsData[13]}); + this.application.ninja.handleSelectTool({ "detail": this.application.ninja.toolsData.defaultToolsData[this.application.ninja.toolsData.rotateStage3DToolIndex] }); return; } // Hand tool if(evt.keyCode === Keyboard.H ) { evt.preventDefault(); - this.application.ninja.handleSelectTool({"detail": this.application.ninja.toolsData.defaultToolsData[14]}); + this.application.ninja.handleSelectTool({"detail": this.application.ninja.toolsData.defaultToolsData[this.application.ninja.toolsData.panToolIndex]}); return; } // Zoom tool if((evt.keyCode === Keyboard.Z) && !(evt.ctrlKey || evt.metaKey) && !evt.shiftKey) {//ctrl or shift key not press with Z evt.preventDefault(); - this.application.ninja.handleSelectTool({"detail": this.application.ninja.toolsData.defaultToolsData[15]}); + this.application.ninja.handleSelectTool({"detail": this.application.ninja.toolsData.defaultToolsData[this.application.ninja.toolsData.zoomToolIndex]}); return; } diff --git a/js/ninja.reel/ninja.js b/js/ninja.reel/ninja.js index cf7c6cf4..1bdd0050 100755 --- a/js/ninja.reel/ninja.js +++ b/js/ninja.reel/ninja.js @@ -152,9 +152,9 @@ exports.Ninja = Montage.create(Component, { this.application.ninja = this; - this.toolsData.selectedTool = this.toolsData.defaultToolsData[0]; - this.toolsData.defaultSubToolsData = this.toolsData.defaultToolsData[7].subtools; - this.toolsData.selectedSubTool = this.toolsData.defaultToolsData[7].subtools[1]; + this.toolsData.selectedTool = this.toolsData.defaultToolsData[this.application.ninja.toolsData.selectionToolIndex]; + this.toolsData.defaultSubToolsData = this.toolsData.defaultToolsData[this.application.ninja.toolsData.shapeToolIndex].subtools; + this.toolsData.selectedSubTool = this.toolsData.defaultToolsData[this.application.ninja.toolsData.shapeToolIndex].subtools[1]; this.toolsData.selectedToolInstance = this.toolsList[this.toolsData.selectedTool.action]; this.setupGlobalHelpers(); diff --git a/scss/imports/scss/_toolbar.scss b/scss/imports/scss/_toolbar.scss index 11a69a79..a0e4f282 100755 --- a/scss/imports/scss/_toolbar.scss +++ b/scss/imports/scss/_toolbar.scss @@ -61,10 +61,6 @@ background-image:url("../images/tools/Tool-Selection.png"); } -.SubselectionTool { - background-image:url("../images/tools/Tool-Subselect.png"); -} - .RotateTool3D { background-image:url("../images/tools/Tool-3DRotate.png"); } -- cgit v1.2.3