From 39ed103137dedaecdc24a547384dcb98d2ca8ff5 Mon Sep 17 00:00:00 2001 From: Richard Fairhurst Date: Thu, 12 Jul 2012 17:08:42 +0100 Subject: [PATCH] shape.* ControllerState documentation --- js/iD/controller/shape/NoSelection.js | 5 +++- js/iD/controller/shape/SelectedPOINode.js | 2 ++ js/iD/controller/shape/SelectedWay.js | 1 + js/iD/controller/shape/SelectedWayNode.js | 34 ----------------------- 4 files changed, 7 insertions(+), 35 deletions(-) delete mode 100644 js/iD/controller/shape/SelectedWayNode.js diff --git a/js/iD/controller/shape/NoSelection.js b/js/iD/controller/shape/NoSelection.js index dde25c635..b8078537c 100644 --- a/js/iD/controller/shape/NoSelection.js +++ b/js/iD/controller/shape/NoSelection.js @@ -28,6 +28,7 @@ define(['dojo/_base/declare','dojo/_base/lang', declare("iD.controller.shape.NoSelection", [iD.controller.ControllerState], { constructor:function() { + // summary: In 'Draw shape' mode but nothing is selected. }, enterState:function() { @@ -49,7 +50,9 @@ declare("iD.controller.shape.NoSelection", [iD.controller.ControllerState], { // Click to select a node var ways=entity.parentWays(); if (ways.length==0) { return new iD.controller.shape.SelectedPOINode(entity); } - else { return new iD.controller.shape.SelectedWayNode(entity,ways[0]); } +// else { return new iD.controller.shape.SelectedWayNode(entity,ways[0]); } +// ** FIXME: ^^^ the above should start a new branching way, not select the node + return this; case 'way': // Click to select a way return new iD.controller.shape.SelectedWay(entityUI.entity); diff --git a/js/iD/controller/shape/SelectedPOINode.js b/js/iD/controller/shape/SelectedPOINode.js index 780c9afa9..85d100154 100644 --- a/js/iD/controller/shape/SelectedPOINode.js +++ b/js/iD/controller/shape/SelectedPOINode.js @@ -18,6 +18,8 @@ define(['dojo/_base/declare', declare("iD.controller.shape.SelectedPOINode", [iD.controller.ControllerState], { constructor:function() { + // summary: In 'Draw shape' mode and a POI node is selected, to be converted into a way. + // Not yet implemented. }, processMouseEvent:function(event,entityUI) { diff --git a/js/iD/controller/shape/SelectedWay.js b/js/iD/controller/shape/SelectedWay.js index dd2e71d75..64f597221 100644 --- a/js/iD/controller/shape/SelectedWay.js +++ b/js/iD/controller/shape/SelectedWay.js @@ -21,6 +21,7 @@ declare("iD.controller.shape.SelectedWay", [iD.controller.ControllerState], { wayUI: null, constructor:function(_way) { + // summary: In 'Draw shape' mode, and a way is selected as the starting point of the new way. this.way=_way; }, enterState:function() { diff --git a/js/iD/controller/shape/SelectedWayNode.js b/js/iD/controller/shape/SelectedWayNode.js deleted file mode 100644 index ca7c2d19f..000000000 --- a/js/iD/controller/shape/SelectedWayNode.js +++ /dev/null @@ -1,34 +0,0 @@ -// iD/controller/shape/SelectedWayNode.js - -/* - Add road or shape -> SelectedWayNode - - The user has clicked 'Add road or shape', then a way-node to start the way at. - -*/ - -define(['dojo/_base/declare', - 'iD/actions/UndoableAction', - 'iD/controller/ControllerState', - ], function(declare){ - -// ---------------------------------------------------------------------- -// SelectedWayNode class - -declare("iD.controller.shape.SelectedWayNode", [iD.controller.ControllerState], { - - constructor:function() { - }, - - processMouseEvent:function(event,entityUI) { - var entity=entityUI ? entityUI.entity : null; - var entityType=entity ? entity.entityType : null; - - return this; - }, - -}); - -// ---------------------------------------------------------------------- -// End of module -});