diff --git a/mindplot/src/main/javascript/Designer.js b/mindplot/src/main/javascript/Designer.js index 5dba0316..60b74cee 100644 --- a/mindplot/src/main/javascript/Designer.js +++ b/mindplot/src/main/javascript/Designer.js @@ -590,6 +590,7 @@ mindplot.Designer = new Class({ var validateFunc = function(topic) { return !(topic.getType() == mindplot.model.INodeModel.CENTRAL_TOPIC_TYPE && shape == mindplot.model.INodeModel.SHAPE_TYPE_LINE) }; + var validateError = 'Central Topic shape can not be changed to line figure.'; var topicsIds = this.getModel().filterTopicsIds(validateFunc, validateError); if (topicsIds.length > 0) { diff --git a/mindplot/src/main/javascript/commands/AddIconToTopicCommand.js b/mindplot/src/main/javascript/commands/AddIconToTopicCommand.js index af86414f..2b3a556d 100644 --- a/mindplot/src/main/javascript/commands/AddIconToTopicCommand.js +++ b/mindplot/src/main/javascript/commands/AddIconToTopicCommand.js @@ -19,7 +19,7 @@ mindplot.commands.AddIconToTopicCommand = new Class({ Extends:mindplot.Command, initialize: function(topicId, iconType) { - $assert(topicId, 'topicId can not be null'); + $assert($defined(topicId), 'topicId can not be null'); $assert(iconType, 'iconType can not be null'); this._objectsIds = topicId; this._iconType = iconType; diff --git a/mindplot/src/main/javascript/model/Mindmap.js b/mindplot/src/main/javascript/model/Mindmap.js index 4af2df40..60f200d1 100644 --- a/mindplot/src/main/javascript/model/Mindmap.js +++ b/mindplot/src/main/javascript/model/Mindmap.js @@ -95,11 +95,11 @@ mindplot.model.Mindmap = new Class({ return new mindplot.model.NodeModel(type, this, id); }, - createRelationship : function(fromNode, toNode) { - $assert(fromNode, 'from node cannot be null'); - $assert(toNode, 'to node cannot be null'); + createRelationship : function(sourceNodeId, targetNodeId) { + $assert($defined(sourceNodeId), 'from node cannot be null'); + $assert($defined(targetNodeId), 'to node cannot be null'); - return new mindplot.model.RelationshipModel(fromNode, toNode); + return new mindplot.model.RelationshipModel(sourceNodeId, targetNodeId); }, addRelationship : function(relationship) { diff --git a/mindplot/src/main/javascript/model/RelationshipModel.js b/mindplot/src/main/javascript/model/RelationshipModel.js index 13b14f01..f0e6b85a 100644 --- a/mindplot/src/main/javascript/model/RelationshipModel.js +++ b/mindplot/src/main/javascript/model/RelationshipModel.js @@ -16,13 +16,13 @@ * limitations under the License. */ mindplot.model.RelationshipModel = new Class({ - initialize:function(fromNode, toNode) { - $assert(fromNode, 'from node type can not be null'); - $assert(toNode, 'to node type can not be null'); + initialize:function(sourceTopicId, targetTopicId) { + $assert($defined(sourceTopicId), 'from node type can not be null'); + $assert($defined(targetTopicId), 'to node type can not be null'); this._id = mindplot.model.RelationshipModel._nextUUID(); - this._fromNode = fromNode; - this._toNode = toNode; + this._sourceTargetId = sourceTopicId; + this._targetTopicId = targetTopicId; this._lineType = mindplot.ConnectionLine.SIMPLE_CURVED; this._srcCtrlPoint = null; this._destCtrlPoint = null; @@ -31,11 +31,11 @@ mindplot.model.RelationshipModel = new Class({ }, getFromNode : function() { - return this._fromNode; + return this._sourceTargetId; }, getToNode : function() { - return this._toNode; + return this._targetTopicId; }, getId : function() { @@ -83,7 +83,7 @@ mindplot.model.RelationshipModel = new Class({ }, clone : function(model) { - var result = new mindplot.model.RelationshipModel(this._fromNode, this._toNode); + var result = new mindplot.model.RelationshipModel(this._sourceTargetId, this._targetTopicId); result._id = this._id; result._lineType = this._lineType; result._srcCtrlPoint = this._srcCtrlPoint;