diff options
author | hwc487 | 2012-07-09 16:08:02 -0700 |
---|---|---|
committer | hwc487 | 2012-07-09 16:08:02 -0700 |
commit | 5085d0f67df89a21715308956004164597a6ba79 (patch) | |
tree | 2c896163143a66331205a39b0a3b1b45d51bf12a /js/tools | |
parent | 51f1691f792dbda9b740ded8aa0457c9406db156 (diff) | |
parent | 84b3327bd92faafab7954b5eb64c7abe24a3fe13 (diff) | |
download | ninja-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.js | 4 | ||||
-rwxr-xr-x | js/tools/EyedropperTool.js | 22 | ||||
-rwxr-xr-x | js/tools/FillTool.js | 14 | ||||
-rwxr-xr-x | js/tools/InkBottleTool.js | 12 | ||||
-rwxr-xr-x | js/tools/LineTool.js | 30 | ||||
-rwxr-xr-x | js/tools/OvalTool.js | 30 | ||||
-rwxr-xr-x | js/tools/PanTool.js | 632 | ||||
-rwxr-xr-x | js/tools/PenTool.js | 46 | ||||
-rwxr-xr-x | js/tools/RectTool.js | 18 | ||||
-rwxr-xr-x | js/tools/Rotate3DToolBase.js | 324 | ||||
-rwxr-xr-x | js/tools/RotateStage3DTool.js | 20 | ||||
-rwxr-xr-x | js/tools/SelectionTool.js | 70 | ||||
-rwxr-xr-x | js/tools/ShapeTool.js | 178 | ||||
-rwxr-xr-x | js/tools/TextTool.js | 3 | ||||
-rwxr-xr-x | js/tools/ToolBase.js | 8 | ||||
-rwxr-xr-x | js/tools/Translate3DToolBase.js | 430 | ||||
-rwxr-xr-x | js/tools/TranslateObject3DTool.js | 84 | ||||
-rwxr-xr-x | js/tools/ZoomTool.js | 314 | ||||
-rwxr-xr-x | js/tools/drawing-tool-base.js | 856 | ||||
-rwxr-xr-x | js/tools/drawing-tool.js | 12 | ||||
-rwxr-xr-x | js/tools/modifier-tool-base.js | 796 |
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 | ||
31 | var ShapeTool = require("js/tools/ShapeTool").ShapeTool; | 31 | var ShapeTool = require("js/tools/ShapeTool").ShapeTool; |
32 | var ShapesController = require("js/controllers/elements/shapes-controller").ShapesController; | 32 | var ShapesController = require("js/controllers/elements/shapes-controller").ShapesController; |
33 | var DrawingToolBase = require("js/tools/drawing-tool-base").DrawingToolBase; | 33 | var DrawingToolBase = require("js/tools/drawing-tool-base").DrawingToolBase; |
34 | var defaultEventManager = require("montage/core/event/event-manager").defaultEventManager; | 34 | var defaultEventManager = require("montage/core/event/event-manager").defaultEventManager; |
35 | var Montage = require("montage/core/core").Montage; | 35 | var 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 | ||
42 | exports.FillTool = Montage.create(ModifierToolBase, { | 42 | exports.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 | ||
35 | exports.InkBottleTool = Montage.create(ModifierToolBase, { | 35 | exports.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 | |||
28 | POSSIBILITY OF SUCH DAMAGE. | 28 | POSSIBILITY OF SUCH DAMAGE. |
29 | </copyright> */ | 29 | </copyright> */ |
30 | 30 | ||
31 | var Montage = require("montage/core/core").Montage, | 31 | var 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 | ||
39 | var Line = require("js/lib/geom/line").Line; | 39 | var Line = require("js/lib/geom/line").Line; |
40 | var MaterialsModel = require("js/models/materials-model").MaterialsModel; | 40 | var MaterialsModel = require("js/models/materials-model").MaterialsModel; |
41 | 41 | ||
42 | exports.LineTool = Montage.create(ShapeTool, { | 42 | exports.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" }, | <