mirror of
https://github.com/FoggedLens/iD.git
synced 2026-02-13 01:02:58 +00:00
shape.* ControllerState documentation
This commit is contained in:
@@ -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);
|
||||
|
||||
@@ -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) {
|
||||
|
||||
@@ -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() {
|
||||
|
||||
@@ -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
|
||||
});
|
||||
Reference in New Issue
Block a user