Integrate predict ...

This commit is contained in:
Paulo Veiga
2012-01-14 09:58:06 -03:00
parent b9e5469907
commit 89060af08b
6 changed files with 48 additions and 48 deletions

View File

@@ -1242,30 +1242,8 @@ mindplot.Topic = new Class({
// Position node ...
textShape.setPosition(topicPadding + iconsWidth, topicPadding);
}
},
// @Todo: this don't seems to be a nice way... Order should be infered automatically ...
createChildModel : function() {
// Create a new node ...
var model = this.getModel();
var mindmap = model.getMindmap();
var childModel = mindmap.createNode(mindplot.model.INodeModel.MAIN_TOPIC_TYPE);
// Get the hights model order position ...
var children = this._getChildren();
var order = -1;
for (var i = 0; i < children.length; i++) {
var child = children[i];
if (child.getOrder() > order) {
order = child.getOrder();
}
}
// Create a new node ...
childModel.setOrder(order + 1);
childModel.setPosition(10, 10);
return childModel;
}
});