From 63e68c9ed57253994b7424dd03059064cc656e98 Mon Sep 17 00:00:00 2001 From: Nivesh Rajbhandari Date: Thu, 9 Feb 2012 15:52:45 -0800 Subject: Fixed switching between webGL and canvas 2d modes. Signed-off-by: Nivesh Rajbhandari --- js/controllers/elements/shapes-controller.js | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) (limited to 'js/controllers') diff --git a/js/controllers/elements/shapes-controller.js b/js/controllers/elements/shapes-controller.js index b9c033aa..44723a1e 100644 --- a/js/controllers/elements/shapes-controller.js +++ b/js/controllers/elements/shapes-controller.js @@ -346,8 +346,10 @@ exports.ShapesController = Montage.create(CanvasController, { { world = new GLWorld(el, true); el.elementModel.shapeModel.GLWorld = world; - el.elementModel.shapeModel.GLGeomObj.setWorld(world); el.elementModel.shapeModel.useWebGl = true; + world.import(worldData); + el.elementModel.shapeModel.GLGeomObj = world.getGeomRoot(); + sm = Object.create(MaterialsLibrary.getMaterial("FlatMaterial")); fm = Object.create(MaterialsLibrary.getMaterial("FlatMaterial")); if(sm && fm) @@ -356,9 +358,7 @@ exports.ShapesController = Montage.create(CanvasController, { el.elementModel.shapeModel.GLGeomObj.setFillMaterial(fm); el.elementModel.shapeModel.strokeMaterial = sm; el.elementModel.shapeModel.fillMaterial = fm; - el.elementModel.shapeModel.GLGeomObj.buildBuffers(); } - world.import(worldData); } } @@ -378,13 +378,13 @@ exports.ShapesController = Montage.create(CanvasController, { world = new GLWorld(el, false); el.elementModel.shapeModel.GLWorld = world; el.elementModel.shapeModel.useWebGl = false; + world.import(worldData); + el.elementModel.shapeModel.GLGeomObj = world.getGeomRoot(); el.elementModel.shapeModel.GLGeomObj.setStrokeMaterial(null); el.elementModel.shapeModel.GLGeomObj.setFillMaterial(null); el.elementModel.shapeModel.strokeMaterial = null; el.elementModel.shapeModel.fillMaterial = null; - world.import(worldData); } - } } -- cgit v1.2.3 From 9e40945a5bf4330d1088b56b8011ee625b1adab9 Mon Sep 17 00:00:00 2001 From: Nivesh Rajbhandari Date: Fri, 10 Feb 2012 10:23:48 -0800 Subject: Support export/import of GLLine data. Signed-off-by: Nivesh Rajbhandari --- js/controllers/elements/shapes-controller.js | 19 ++++++++++++++----- 1 file changed, 14 insertions(+), 5 deletions(-) (limited to 'js/controllers') diff --git a/js/controllers/elements/shapes-controller.js b/js/controllers/elements/shapes-controller.js index 44723a1e..640119c4 100644 --- a/js/controllers/elements/shapes-controller.js +++ b/js/controllers/elements/shapes-controller.js @@ -351,12 +351,17 @@ exports.ShapesController = Montage.create(CanvasController, { el.elementModel.shapeModel.GLGeomObj = world.getGeomRoot(); sm = Object.create(MaterialsLibrary.getMaterial("FlatMaterial")); - fm = Object.create(MaterialsLibrary.getMaterial("FlatMaterial")); - if(sm && fm) + if(sm) { el.elementModel.shapeModel.GLGeomObj.setStrokeMaterial(sm); - el.elementModel.shapeModel.GLGeomObj.setFillMaterial(fm); el.elementModel.shapeModel.strokeMaterial = sm; + } + fm = Object.create(MaterialsLibrary.getMaterial("FlatMaterial")); + // TODO - Use consts after GL code is converted to object literal notation +// if( fm && (el.elementModel.shapeModel.GLGeomObj.geomType() !== GLGeomObj.GEOM_TYPE_LINE) ) + if( fm && (el.elementModel.shapeModel.GLGeomObj.geomType() !== 3) ) + { + el.elementModel.shapeModel.GLGeomObj.setFillMaterial(fm); el.elementModel.shapeModel.fillMaterial = fm; } } @@ -381,9 +386,13 @@ exports.ShapesController = Montage.create(CanvasController, { world.import(worldData); el.elementModel.shapeModel.GLGeomObj = world.getGeomRoot(); el.elementModel.shapeModel.GLGeomObj.setStrokeMaterial(null); - el.elementModel.shapeModel.GLGeomObj.setFillMaterial(null); el.elementModel.shapeModel.strokeMaterial = null; - el.elementModel.shapeModel.fillMaterial = null; + // TODO - Use consts after GL code is converted to object literal notation + if(el.elementModel.shapeModel.GLGeomObj.geomType() !== 3) + { + el.elementModel.shapeModel.GLGeomObj.setFillMaterial(null); + el.elementModel.shapeModel.fillMaterial = null; + } } } } -- cgit v1.2.3 From cde1dd9a9156b9682fdf85ce2cd4acdd94124c37 Mon Sep 17 00:00:00 2001 From: John Mayhew Date: Fri, 10 Feb 2012 16:00:35 -0800 Subject: -Changed the capitalization of all main top level menus from all caps -Added new main-menu-controller to be the default generic handler for menu item calls that do not need to call to a specific controller -Removed the test menu item -Finalized the help submenu items and hooked them up to the main-menu-controller --- js/controllers/main-menu-controller.js | 43 ++++++++++++++++++++++++++++++++++ 1 file changed, 43 insertions(+) create mode 100644 js/controllers/main-menu-controller.js (limited to 'js/controllers') diff --git a/js/controllers/main-menu-controller.js b/js/controllers/main-menu-controller.js new file mode 100644 index 00000000..5e126617 --- /dev/null +++ b/js/controllers/main-menu-controller.js @@ -0,0 +1,43 @@ +/* +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, + Component = require("montage/ui/component").Component; + +exports.MainMenuController = Montage.create(Component, { + deserializedFromTemplate:{ + value:function () { + this.eventManager.addEventListener("executeHelpFAQ", this, false); + this.eventManager.addEventListener("executeHelpForums", this, false); + this.eventManager.addEventListener("executeHelpTopics", this, false); + this.eventManager.addEventListener("executeHelpAbout", this, false); + } + }, + + // Basic help menu handling methods + handleExecuteHelpFAQ:{ + value:function () { + window.open('http://www.tetsubo.org/go/ninjafaq'); + } + }, + handleExecuteHelpForums:{ + value:function () { + window.open('http://www.tetsubo.org/go/ninjaforums'); + } + }, + handleExecuteHelpTopics:{ + value:function () { + window.open('http://www.tetsubo.org/go/ninjadocs'); + } + }, + handleExecuteHelpAbout:{ + value:function () { + // TODO + console.log("Pull up the about popup"); + } + } +}); -- cgit v1.2.3