shape.* ControllerState documentation

This commit is contained in:
Richard Fairhurst
2012-07-12 17:08:42 +01:00
parent 372d13bf62
commit 39ed103137
4 changed files with 7 additions and 35 deletions

View File

@@ -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);

View File

@@ -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) {

View File

@@ -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() {

View File

@@ -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
});