aboutsummaryrefslogtreecommitdiff
path: root/js/tools
diff options
context:
space:
mode:
authorhwc4872012-07-09 16:08:02 -0700
committerhwc4872012-07-09 16:08:02 -0700
commit5085d0f67df89a21715308956004164597a6ba79 (patch)
tree2c896163143a66331205a39b0a3b1b45d51bf12a /js/tools
parent51f1691f792dbda9b740ded8aa0457c9406db156 (diff)
parent84b3327bd92faafab7954b5eb64c7abe24a3fe13 (diff)
downloadninja-5085d0f67df89a21715308956004164597a6ba79.tar.gz
Merge branch 'master' of github.com:Motorola-Mobility/ninja-internal into GridFixes
Conflicts: js/helper-classes/3D/StageLine.js
Diffstat (limited to 'js/tools')
-rw-r--r--js/tools/BrushTool.js4
-rwxr-xr-xjs/tools/EyedropperTool.js22
-rwxr-xr-xjs/tools/FillTool.js14
-rwxr-xr-xjs/tools/InkBottleTool.js12
-rwxr-xr-xjs/tools/LineTool.js30
-rwxr-xr-xjs/tools/OvalTool.js30
-rwxr-xr-xjs/tools/PanTool.js632
-rwxr-xr-xjs/tools/PenTool.js46
-rwxr-xr-xjs/tools/RectTool.js18
-rwxr-xr-xjs/tools/Rotate3DToolBase.js324
-rwxr-xr-xjs/tools/RotateStage3DTool.js20
-rwxr-xr-xjs/tools/SelectionTool.js70
-rwxr-xr-xjs/tools/ShapeTool.js178
-rwxr-xr-xjs/tools/TextTool.js3
-rwxr-xr-xjs/tools/ToolBase.js8
-rwxr-xr-xjs/tools/Translate3DToolBase.js430
-rwxr-xr-xjs/tools/TranslateObject3DTool.js84
-rwxr-xr-xjs/tools/ZoomTool.js314
-rwxr-xr-xjs/tools/drawing-tool-base.js856
-rwxr-xr-xjs/tools/drawing-tool.js12
-rwxr-xr-xjs/tools/modifier-tool-base.js796
21 files changed, 1961 insertions, 1942 deletions
<
diff --git a/js/tools/BrushTool.js b/js/tools/BrushTool.js
index 8861d226..8bfec186 100644
--- a/js/tools/BrushTool.js
+++ b/js/tools/BrushTool.js
@@ -29,7 +29,7 @@ POSSIBILITY OF SUCH DAMAGE.
29</copyright> */ 29</copyright> */
30 30
31var ShapeTool = require("js/tools/ShapeTool").ShapeTool; 31var ShapeTool = require("js/tools/ShapeTool").ShapeTool;
32var ShapesController = require("js/controllers/elements/shapes-controller").ShapesController; 32var ShapesController = require("js/controllers/elements/shapes-controller").ShapesController;
33var DrawingToolBase = require("js/tools/drawing-tool-base").DrawingToolBase; 33var DrawingToolBase = require("js/tools/drawing-tool-base").DrawingToolBase;
34var defaultEventManager = require("montage/core/event/event-manager").defaultEventManager; 34var defaultEventManager = require("montage/core/event/event-manager").defaultEventManager;
35var Montage = require("montage/core/core").Montage; 35var Montage = require("montage/core/core").Montage;
@@ -281,7 +281,7 @@ exports.BrushTool = Montage.create(ShapeTool, {
281 if (this.options.useCalligraphic){ 281 if (this.options.useCalligraphic){
282 useCalligraphic = this.options.useCalligraphic; 282 useCalligraphic = this.options.useCalligraphic;
283 } 283 }
284 284
285 var ctx = this.application.ninja.stage.drawingContext;//stageManagerModule.stageManager.drawingContext; 285 var ctx = this.application.ninja.stage.drawingContext;//stageManagerModule.stageManager.drawingContext;
286 if (ctx === null) 286 if (ctx === null)
287 throw ("null drawing context in Brushtool::ShowCurrentBrushStrokeOnStage"); 287 throw ("null drawing context in Brushtool::ShowCurrentBrushStrokeOnStage");
diff --git a/js/tools/EyedropperTool.js b/js/tools/EyedropperTool.js
index e9831d71..452c46d1 100755
--- a/js/tools/EyedropperTool.js
+++ b/js/tools/EyedropperTool.js
@@ -49,20 +49,20 @@ exports.EyedropperTool = Montage.create(toolBase, {
49 49
50 Configure: { 50 Configure: {
51 value: function ( doActivate ) 51 value: function ( doActivate )
52 { 52 {
53 if (doActivate) 53 if (doActivate)
54 { 54 {
55 NJevent("enableStageMove"); 55 NJevent("enableStageMove");
56 } 56 }
57 else 57 else
58 { 58 {
59 NJevent("disableStageMove"); 59 NJevent("disableStageMove");
60 this._deleteImageDataCanvas(); 60 this._deleteImageDataCanvas();
61 this._isMouseDown = false; 61 this._isMouseDown = false;
62 this._elementUnderMouse = null; 62 this._elementUnderMouse = null;
63 this._previousColor = null; 63 this._previousColor = null;
64 this._color = null; 64 this._color = null;
65 } 65 }
66 } 66 }
67 }, 67 },
68 68
@@ -78,7 +78,7 @@ exports.EyedropperTool = Montage.create(toolBase, {
78 78
79 HandleMouseMove: { 79 HandleMouseMove: {
80 value : function (event) 80 value : function (event)
81 { 81 {
82 if(this._escape) 82 if(this._escape)
83 { 83 {
84 this._isMouseDown = false; 84 this._isMouseDown = false;
@@ -90,12 +90,12 @@ exports.EyedropperTool = Montage.create(toolBase, {
90 { 90 {
91 this._updateColorFromPoint(event); 91 this._updateColorFromPoint(event);
92 } 92 }
93 } 93 }
94 }, 94 },
95 95
96 HandleLeftButtonUp: { 96 HandleLeftButtonUp: {
97 value : function (event) { 97 value : function (event) {
98 { 98 {
99 this._isMouseDown = false; 99 this._isMouseDown = false;
100 100
101 if(this._escape) 101 if(this._escape)
diff --git a/js/tools/FillTool.js b/js/tools/FillTool.js
index d779c655..b6f244e1 100755
--- a/js/tools/FillTool.js
+++ b/js/tools/FillTool.js
@@ -40,13 +40,13 @@ var Montage = require("montage/core/core").Montage,
40 ShapesController = require("js/controllers/elements/shapes-controller").ShapesController; 40 ShapesController = require("js/controllers/elements/shapes-controller").ShapesController;
41 41
42exports.FillTool = Montage.create(ModifierToolBase, { 42exports.FillTool = Montage.create(ModifierToolBase, {
43 _canSnap: { value: false }, 43 _canSnap: { value: false },
44 _canColor: { value: true }, 44 _canColor: { value: true },
45 _targetedElement: { value: null }, 45 _targetedElement: { value: null },
46 46
47 HandleMouseMove: { 47 HandleMouseMove: {
48 value : function (event) 48 value : function (event)
49 { 49 {
50 var obj = this.application.ninja.stage.getElement(event, true); 50 var obj = this.application.ninja.stage.getElement(event, true);
51 var cursor = "url('images/cursors/fill.png') 14 14, default"; 51 var cursor = "url('images/cursors/fill.png') 14 14, default";
52 var canColor = true; 52 var canColor = true;
@@ -78,13 +78,13 @@ exports.FillTool = Montage.create(ModifierToolBase, {
78 } 78 }
79 this.application.ninja.stage.drawingCanvas.style.cursor = cursor; 79 this.application.ninja.stage.drawingCanvas.style.cursor = cursor;
80 this._canColor = canColor; 80 this._canColor = canColor;
81 } 81 }
82 }, 82 },
83 83
84 HandleLeftButtonUp: { 84 HandleLeftButtonUp: {
85 value : function () { 85 value : function () {
86 //if(this._isDrawing) 86 //if(this._isDrawing)
87 { 87 {
88 this.application.ninja.stage.clearDrawingCanvas(); 88 this.application.ninja.stage.clearDrawingCanvas();
89 this._hasDraw = false; 89 this._hasDraw = false;
90 this._isDrawing = false; 90 this._isDrawing = false;
diff --git a/js/tools/InkBottleTool.js b/js/tools/InkBottleTool.js
index 3762641b..d8f06204 100755
--- a/js/tools/InkBottleTool.js
+++ b/js/tools/InkBottleTool.js
@@ -33,13 +33,13 @@ var Montage = require("montage/core/core").Montage,
33 ElementsMediator = require("js/mediators/element-mediator").ElementMediator; 33 ElementsMediator = require("js/mediators/element-mediator").ElementMediator;
34 34
35exports.InkBottleTool = Montage.create(ModifierToolBase, { 35exports.InkBottleTool = Montage.create(ModifierToolBase, {
36 _canSnap: { value: false }, 36 _canSnap: { value: false },
37 _canColor: { value: true }, 37 _canColor: { value: true },
38 _targetedElement: { value: null }, 38 _targetedElement: { value: null },
39 39
40 HandleMouseMove: { 40 HandleMouseMove: {
41 value : function (event) 41 value : function (event)
42 { 42 {
43 var obj = this.application.ninja.stage.getElement(event, true); 43 var obj = this.application.ninja.stage.getElement(event, true);
44 var cursor = "url('images/cursors/ink.png') 6 11, default"; 44 var cursor = "url('images/cursors/ink.png') 6 11, default";
45 var canColor = true; 45 var canColor = true;
@@ -72,13 +72,13 @@ exports.InkBottleTool = Montage.create(ModifierToolBase, {
72 } 72 }
73 this.application.ninja.stage.drawingCanvas.style.cursor = cursor; 73 this.application.ninja.stage.drawingCanvas.style.cursor = cursor;
74 this._canColor = canColor; 74 this._canColor = canColor;
75 } 75 }
76 }, 76 },
77 77
78 HandleLeftButtonUp: { 78 HandleLeftButtonUp: {
79 value : function () { 79 value : function () {
80 //if(this._isDrawing) 80 //if(this._isDrawing)
81 { 81 {
82 this.application.ninja.stage.clearDrawingCanvas(); 82 this.application.ninja.stage.clearDrawingCanvas();
83 this._hasDraw = false; 83 this._hasDraw = false;
84 this._isDrawing = false; 84 this._isDrawing = false;
diff --git a/js/tools/LineTool.js b/js/tools/LineTool.js
index 89f33a16..41458d01 100755
--- a/js/tools/LineTool.js
+++ b/js/tools/LineTool.js
@@ -28,23 +28,23 @@ ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
28POSSIBILITY OF SUCH DAMAGE. 28POSSIBILITY OF SUCH DAMAGE.
29</copyright> */ 29</copyright> */
30 30
31var Montage = require("montage/core/core").Montage, 31var Montage = require("montage/core/core").Montage,
32 ShapeTool = require("js/tools/ShapeTool").ShapeTool, 32 ShapeTool = require("js/tools/ShapeTool").ShapeTool,
33 DrawingToolBase = require("js/tools/drawing-tool-base").DrawingToolBase, 33 DrawingToolBase = require("js/tools/drawing-tool-base").DrawingToolBase,
34 NJUtils = require("js/lib/NJUtils").NJUtils, 34 NJUtils = require("js/lib/NJUtils").NJUtils,
35 TagTool = require("js/tools/TagTool").TagTool, 35 TagTool = require("js/tools/TagTool").TagTool,
36 ShapesController = require("js/controllers/elements/shapes-controller").ShapesController, 36 ShapesController = require("js/controllers/elements/shapes-controller").ShapesController,
37 ShapeModel = require("js/models/shape-model").ShapeModel; 37 ShapeModel = require("js/models/shape-model").ShapeModel;
38 38
39var Line = require("js/lib/geom/line").Line; 39var Line = require("js/lib/geom/line").Line;
40var MaterialsModel = require("js/models/materials-model").MaterialsModel; 40var MaterialsModel = require("js/models/materials-model").MaterialsModel;
41 41
42exports.LineTool = Montage.create(ShapeTool, { 42exports.LineTool = Montage.create(ShapeTool, {
43 _toolID: { value: "lineTool" }, 43 _toolID: { value: "lineTool" },
44 _imageID: { value: "lineToolImg" }, 44 _imageID: { value: "lineToolImg" },
45 _toolImageClass: { value: "lineToolUp" }, 45 _toolImageClass: { value: "lineToolUp" },