Add IMindmap and INode.

This commit is contained in:
Paulo Veiga
2011-09-08 10:03:42 -03:00
parent 21f848e3df
commit 0c216778e5
21 changed files with 248 additions and 149 deletions

View File

@@ -44,11 +44,11 @@ mindplot.XMLMindmapSerializer_Beta = new Class({
var parentTopic = document.createElement("topic");
// Set topic attributes...
if (topic.getType() == mindplot.model.NodeModel.CENTRAL_TOPIC_TYPE) {
if (topic.getType() == mindplot.model.INodeModel.CENTRAL_TOPIC_TYPE) {
parentTopic.setAttribute("central", true);
} else {
var parent = topic.getParent();
if (parent == null || parent.getType() == mindplot.model.NodeModel.CENTRAL_TOPIC_TYPE) {
if (parent == null || parent.getType() == mindplot.model.INodeModel.CENTRAL_TOPIC_TYPE) {
var pos = topic.getPosition();
parentTopic.setAttribute("position", pos.x + ',' + pos.y);
} else {
@@ -179,7 +179,7 @@ mindplot.XMLMindmapSerializer_Beta = new Class({
},
_deserializeNode : function(domElem, mindmap) {
var type = (domElem.getAttribute('central') != null) ? mindplot.model.NodeModel.CENTRAL_TOPIC_TYPE : mindplot.model.NodeModel.MAIN_TOPIC_TYPE;
var type = (domElem.getAttribute('central') != null) ? mindplot.model.INodeModel.CENTRAL_TOPIC_TYPE : mindplot.model.INodeModel.MAIN_TOPIC_TYPE;
var topic = mindmap.createNode(type);
// Load attributes...