From e2da27ebc8936f0fc4db039ca57c68f15cc682ec Mon Sep 17 00:00:00 2001 From: Paulo Veiga Date: Tue, 6 Sep 2011 01:03:27 -0300 Subject: [PATCH] Basic topic propeties integrated with brix. --- .../src/main/javascript/ActionDispatcher.js | 12 +- .../main/javascript/BrixActionDispatcher.js | 100 +++++- .../src/main/javascript/ConnectionLine.js | 2 - .../main/javascript/LocalActionDispatcher.js | 12 +- .../src/main/javascript/MindmapDesigner.js | 23 +- .../main/javascript/MultilineTextEditor.js | 2 +- mindplot/src/main/javascript/Note.js | 2 +- .../src/main/javascript/RichTextEditor.js | 8 +- mindplot/src/main/javascript/TextEditor.js | 2 +- mindplot/src/main/javascript/Topic.js | 10 +- .../collaboration/CollaborationManager.js | 4 +- .../AbstractCollaborativeFramework.js | 64 ++-- .../frameworks/brix/BrixFramework.js | 1 + .../frameworks/brix/model/NodeModel.js | 285 ++++++++---------- .../commands/AddIconToTopicCommand.js | 6 +- .../commands/AddLinkToTopicCommand.js | 6 +- .../commands/AddNoteToTopicCommand.js | 10 +- .../main/javascript/commands/DeleteCommand.js | 12 +- .../javascript/commands/DragTopicCommand.js | 4 +- .../commands/GenericFunctionCommand.js | 6 +- .../commands/RemoveIconFromTopicCommand.js | 6 +- .../commands/RemoveLinkFromTopicCommand.js | 6 +- .../commands/RemoveNoteFromTopicCommand.js | 10 +- .../src/main/javascript/model/NodeModel.js | 12 +- .../src/main/javascript/model/NoteModel.js | 10 +- wise-doc/src/main/webapp/html/editor.html | 2 +- 26 files changed, 346 insertions(+), 271 deletions(-) diff --git a/mindplot/src/main/javascript/ActionDispatcher.js b/mindplot/src/main/javascript/ActionDispatcher.js index ecf15e99..117f5170 100644 --- a/mindplot/src/main/javascript/ActionDispatcher.js +++ b/mindplot/src/main/javascript/ActionDispatcher.js @@ -43,7 +43,7 @@ mindplot.ActionDispatcher = new Class({ throw "method must be implemented."; }, - deleteTopics: function(topicsIds) { + deleteTopics: function(topicsIds, relIds) { throw "method must be implemented."; }, @@ -79,6 +79,10 @@ mindplot.ActionDispatcher = new Class({ throw "method must be implemented."; }, + changeFontSizeToTopic : function(topicsIds, size) { + throw "method must be implemented."; + }, + changeBackgroundColorToTopic: function(topicsIds, color) { throw "method must be implemented."; }, @@ -95,15 +99,15 @@ mindplot.ActionDispatcher = new Class({ throw "method must be implemented."; }, - changeTextOnTopic : function(topicsIds, text) { + changeTextToTopic : function(topicsIds, text) { throw "method must be implemented."; }, - shrinkBranch : function(topicsIds, collapse) - { + shrinkBranch : function(topicsIds, collapse) { throw "method must be implemented."; } + }); mindplot.ActionDispatcher.setInstance = function(dispatcher) { diff --git a/mindplot/src/main/javascript/BrixActionDispatcher.js b/mindplot/src/main/javascript/BrixActionDispatcher.js index fa21fbf1..775038a8 100644 --- a/mindplot/src/main/javascript/BrixActionDispatcher.js +++ b/mindplot/src/main/javascript/BrixActionDispatcher.js @@ -21,26 +21,112 @@ mindplot.BrixActionDispatcher = new Class({ initialize: function(commandContext, fireOnChange) { this.parent(commandContext, fireOnChange); this._commandContext = commandContext; - this._actionDispatcher = new mindplot.LocalActionDispatcher(commandContext); }, - changeTextOnTopic : function(topicsIds, text) { - var framework = mindplot.collaboration.CollaborationManager.getInstance().getCollaborativeFramework(); + changeTextToTopic : function(topicsIds, text) { + var framework = this._getFramework(); + var topicId; if (!(topicsIds instanceof Array)) { - topicsIds = [topicsIds]; + topicId = topicsIds; + } else { + topicId = topicsIds[0]; } - var topic = framework.getTopic(topicsIds[0]); + var topic = framework.getTopic(topicId); topic.setText(text, true); }, - addTopic:function(model, parentTopicId, animated) { - var framework = mindplot.collaboration.CollaborationManager.getInstance().getCollaborativeFramework(); + _getFramework:function () { + return mindplot.collaboration.CollaborationManager.getInstance().getCollaborativeFramework(); + }, + + addTopic : function(model, parentTopicId, animated) { + var framework = this._getFramework(); var mindmap = framework.getModel(); var centralTopic = mindmap.getCentralTopic(); + var newNode = mindmap.createNode(model.getType(), model.getId()); var position = model.getPosition(); newNode.setPosition(position.x, position.y); newNode.connectTo(centralTopic); + }, + + changeFontSizeToTopic : function(topicsIds, size) { + topicsIds.forEach(function(topicId) { + var framework = this._getFramework(); + var topic = framework.getTopic(topicId); + topic.setFontSize(size, true); + }.bind(this)); + }, + + changeFontColorToTopic : function(topicsIds, color) { + topicsIds.forEach(function(topicId) { + var framework = this._getFramework(); + var topic = framework.getTopic(topicId); + topic.setFontColor(color, true); + }.bind(this)); + }, + + changeFontFamilyToTopic : function(topicsIds, family) { + topicsIds.forEach(function(topicId) { + var framework = this._getFramework(); + var topic = framework.getTopic(topicId); + topic.setFontFamily(family, true); + }.bind(this)); + }, + + changeFontStyleToTopic : function(topicsIds) { + topicsIds.forEach(function(topicId) { + var framework = this._getFramework(); + var topic = framework.getTopic(topicId); + var style = ( topic.getFontStyle() == "italic") ? "normal" : "italic"; + topic.setFontStyle(style, true); + }.bind(this)); + }, + + changeShapeToTopic : function(topicsIds, shapeType) { + topicsIds.forEach(function(topicId) { + var framework = this._getFramework(); + var topic = framework.getTopic(topicId); + topic.setShapeType(shapeType); + }.bind(this)) + }, + + changeFontWeightToTopic : function(topicsIds) { + topicsIds.forEach(function(topicId) { + var framework = this._getFramework(); + var topic = framework.getTopic(topicId); + var weight = (topic.getFontWeight() == "bold") ? "normal" : "bold"; + topic.setFontWeight(weight, true); + }.bind(this)); + }, + + changeBackgroundColorToTopic : function(topicsIds, color) { + topicsIds.forEach(function(topicId) { + var framework = this._getFramework(); + var topic = framework.getTopic(topicId); + topic.setBackgroundColor(color, true); + }.bind(this)); + + }, + + changeBorderColorToTopic : function(topicsIds, color) { + topicsIds.forEach(function(topicId) { + var framework = this._getFramework(); + var topic = framework.getTopic(topicId); + topic.setBorderColor(color); + }.bind(this)); + }, + + deleteTopics : function(topicsIds, relIds) { + $assert(topicsIds, "topicsIds can not be null"); + var framework = this._getFramework(); + var mindmap = framework.getModel(); + + var topicId = topicsIds[0]; + var topic = framework.getTopic(topicId); + $assert(topic, "Could not find topic with id:" + topicId); + mindmap.disconnect(topic); + } }); diff --git a/mindplot/src/main/javascript/ConnectionLine.js b/mindplot/src/main/javascript/ConnectionLine.js index 1393a3b2..55b8feff 100644 --- a/mindplot/src/main/javascript/ConnectionLine.js +++ b/mindplot/src/main/javascript/ConnectionLine.js @@ -29,7 +29,6 @@ mindplot.ConnectionLine = new Class({ var line; if (targetNode.getType() == mindplot.model.NodeModel.CENTRAL_TOPIC_TYPE) { line = this._createLine(lineType, mindplot.ConnectionLine.CURVED); - // line = new web2d.Line(); if (line.getType() == "CurvedLine") { var ctrlPoints = this._getCtrlPoints(sourceNode, targetNode); line.setSrcControlPoint(ctrlPoints[0]); @@ -114,7 +113,6 @@ mindplot.ConnectionLine = new Class({ line2d.setSrcControlPoint(ctrlPoints[0]); line2d.setDestControlPoint(ctrlPoints[1]); } -// line2d.moveToBack(); // Add connector ... this._positionateConnector(targetTopic); diff --git a/mindplot/src/main/javascript/LocalActionDispatcher.js b/mindplot/src/main/javascript/LocalActionDispatcher.js index e1746ccd..6c5d4725 100644 --- a/mindplot/src/main/javascript/LocalActionDispatcher.js +++ b/mindplot/src/main/javascript/LocalActionDispatcher.js @@ -53,8 +53,8 @@ mindplot.LocalActionDispatcher = new Class({ this.execute(command); }, - deleteTopics: function(topicsIds) { - var command = new mindplot.commands.DeleteCommand(topicsIds); + deleteTopics: function(topicsIds,relIds) { + var command = new mindplot.commands.DeleteCommand(topicsIds,relIds); this.execute(command); }, @@ -95,7 +95,7 @@ mindplot.LocalActionDispatcher = new Class({ }, - changeTextOnTopic : function(topicsIds, text) { + changeTextToTopic : function(topicsIds, text) { $assert(topicsIds, "topicsIds can not be null"); var commandFunc = function(topic, value) { @@ -118,7 +118,7 @@ mindplot.LocalActionDispatcher = new Class({ var result = topic.getFontFamily(); topic.setFontFamily(fontFamily, true); - topic._adjustShapes.delay(0, topic); + topic._adjustShapes(); return result; }; @@ -179,7 +179,7 @@ mindplot.LocalActionDispatcher = new Class({ var result = topic.getFontSize(); topic.setFontSize(size, true); - topic._adjustShapes.delay(0, topic); + topic._adjustShapes(); return result; }; @@ -209,7 +209,7 @@ mindplot.LocalActionDispatcher = new Class({ var weight = (result == "bold") ? "normal" : "bold"; topic.setFontWeight(weight, true); - topic._adjustShapes.delay(0, topic); + topic._adjustShapes(); return result; }; diff --git a/mindplot/src/main/javascript/MindmapDesigner.js b/mindplot/src/main/javascript/MindmapDesigner.js index 42db9db6..ce17e6ba 100644 --- a/mindplot/src/main/javascript/MindmapDesigner.js +++ b/mindplot/src/main/javascript/MindmapDesigner.js @@ -24,8 +24,8 @@ mindplot.MindmapDesigner = new Class({ // Dispatcher manager ... var commandContext = new mindplot.CommandContext(this); -// this._actionDispatcher = new mindplot.BrixActionDispatcher(commandContext); - this._actionDispatcher = new mindplot.LocalActionDispatcher(commandContext); + this._actionDispatcher = new mindplot.BrixActionDispatcher(commandContext); +// this._actionDispatcher = new mindplot.LocalActionDispatcher(commandContext); this._actionDispatcher.addEvent("modelUpdate", function(event) { this._fireEvent("modelUpdate", event); }.bind(this)); @@ -164,7 +164,7 @@ mindplot.MindmapDesigner = new Class({ var targetTopicModel = model.getParent(); var targetTopic = null; - var topics = this.getModel.getTopics(); + var topics = this.getModel().getTopics(); for (var i = 0; i < topics.length; i++) { var t = topics[i]; if (t.getModel() == targetTopicModel) { @@ -593,7 +593,8 @@ mindplot.MindmapDesigner = new Class({ }, _removeNode : function(node) { - if (node.getTopicType() != mindplot.model.NodeModel.CENTRAL_TOPIC_TYPE) { + if (node.getTopicType() != mindplot.model.NodeModel.CENTRAL_TOPIC_TYPE) + { var parent = node._parent; node.disconnect(this._workspace); @@ -621,12 +622,13 @@ mindplot.MindmapDesigner = new Class({ return object.getType() == mindplot.RelationshipLine.type || object.getTopicType() != mindplot.model.NodeModel.CENTRAL_TOPIC_TYPE }; var validateError = 'Central topic can not be deleted.'; - var model = this.getModel(); - var topics = model.filterTopicsIds(validateFunc, validateError); - var rel = model.filterRelationIds(validateFunc, validateError); - if (topics.length > 0 || rel.length > 0) { - this._actionDispatcher.deleteTopics({'nodes':topics,'relationship':rel}); + var model = this.getModel(); + var topicsIds = model.filterTopicsIds(validateFunc, validateError); + var relIds = model.filterRelationIds(validateFunc, validateError); + + if (topicsIds.length > 0 || relIds.length > 0) { + this._actionDispatcher.deleteTopics(topicsIds,relIds); } }, @@ -684,8 +686,7 @@ mindplot.MindmapDesigner = new Class({ if (topicsIds.length > 0) { this._actionDispatcher.changeFontSizeToTopic(topicsIds, size); } - } - , + }, changeTopicShape : function(shape) { var validateFunc = function(topic) { diff --git a/mindplot/src/main/javascript/MultilineTextEditor.js b/mindplot/src/main/javascript/MultilineTextEditor.js index 69d2ef48..fc6f69a2 100644 --- a/mindplot/src/main/javascript/MultilineTextEditor.js +++ b/mindplot/src/main/javascript/MultilineTextEditor.js @@ -129,7 +129,7 @@ mindplot.MultilineTextEditor = new Class({ var topicId = this._topic.getId(); var actionDispatcher = mindplot.ActionDispatcher.getInstance(); - actionDispatcher.changeTextOnTopic([topicId], text); + actionDispatcher.changeTextToTopic([topicId], text); } }, diff --git a/mindplot/src/main/javascript/Note.js b/mindplot/src/main/javascript/Note.js index cbe17f48..43b0a017 100644 --- a/mindplot/src/main/javascript/Note.js +++ b/mindplot/src/main/javascript/Note.js @@ -39,7 +39,7 @@ mindplot.Note = new Class({ }, getText: function() { - return this._textShape; + return this._text; }, getModel : function() { diff --git a/mindplot/src/main/javascript/RichTextEditor.js b/mindplot/src/main/javascript/RichTextEditor.js index e8543aec..9b177dda 100644 --- a/mindplot/src/main/javascript/RichTextEditor.js +++ b/mindplot/src/main/javascript/RichTextEditor.js @@ -101,9 +101,9 @@ mindplot.RichTextEditor = mindplot.TextEditor.extend({ //becarefull this._editor is not mootools!! this._editor.addEvent('blur',function(event){ this._myOverlay.setStyle('display','none'); - var text = this._textShape; - this._textShape = this._editor.instanceById("inputText2").getContent(); - if(text!=this._textShape){ + var text = this._text; + this._text = this._editor.instanceById("inputText2").getContent(); + if(text!=this._text){ this._applyChanges = true; } console.log('bye'); @@ -118,7 +118,7 @@ mindplot.RichTextEditor = mindplot.TextEditor.extend({ $(this.inputText).focus(); }, getText:function(){ - return this._textShape; + return this._text; }, lostFocusListener:function(){ this._hideNode(); diff --git a/mindplot/src/main/javascript/TextEditor.js b/mindplot/src/main/javascript/TextEditor.js index fb3caf33..2b07b420 100644 --- a/mindplot/src/main/javascript/TextEditor.js +++ b/mindplot/src/main/javascript/TextEditor.js @@ -112,7 +112,7 @@ mindplot.TextEditor = new Class({ var topicId = this._topic.getId(); var actionDispatcher = mindplot.ActionDispatcher.getInstance(); - actionDispatcher.changeTextOnTopic([topicId], text); + actionDispatcher.changeTextToTopic([topicId], text); } }, diff --git a/mindplot/src/main/javascript/Topic.js b/mindplot/src/main/javascript/Topic.js index cf21e489..81f7e70b 100644 --- a/mindplot/src/main/javascript/Topic.js +++ b/mindplot/src/main/javascript/Topic.js @@ -59,7 +59,7 @@ mindplot.Topic = new Class({ // var oldText = textShape.getText(); // this._setText(text, false); - // @Todo: I must resize, no change the position ... + // @Todo: I must resize, no change the position ... // textShape.setText(oldText); }.bind(this)); @@ -236,14 +236,14 @@ mindplot.Topic = new Class({ }, getTextShape : function() { - if (!$defined(this._textShape)) { - this._textShape = this._buildTextShape(false); + if (!$defined(this._text)) { + this._text = this._buildTextShape(false); // Set Text ... var text = this.getText(); this._setText(text, false); } - return this._textShape; + return this._text; }, getOrBuildIconGroup : function() { @@ -1175,8 +1175,6 @@ mindplot.Topic = new Class({ // Position node ... textShape.setPosition(topicPadding + iconsWidth, topicPadding); - - console.log(textShape.getText() + ":works ?"); }).delay(0, this); }, diff --git a/mindplot/src/main/javascript/collaboration/CollaborationManager.js b/mindplot/src/main/javascript/collaboration/CollaborationManager.js index c3e4193e..732d16fd 100644 --- a/mindplot/src/main/javascript/collaboration/CollaborationManager.js +++ b/mindplot/src/main/javascript/collaboration/CollaborationManager.js @@ -6,11 +6,11 @@ mindplot.collaboration.CollaborationManager = new Class({ this.wiseReady = false; }, - isCollaborationFrameworkAvailable:function() { + isCollaborationFrameworkAvailable : function() { return (typeof goog != "undefined") && (typeof goog.collab != "undefined"); }, - setCollaborativeFramework:function(framework) { + setCollaborativeFramework : function(framework) { this._collaborativeFramework = framework; this.collaborativeModelReady = true; if (this.wiseReady) { diff --git a/mindplot/src/main/javascript/collaboration/frameworks/AbstractCollaborativeFramework.js b/mindplot/src/main/javascript/collaboration/frameworks/AbstractCollaborativeFramework.js index 1bd5a85b..7fd0254e 100644 --- a/mindplot/src/main/javascript/collaboration/frameworks/AbstractCollaborativeFramework.js +++ b/mindplot/src/main/javascript/collaboration/frameworks/AbstractCollaborativeFramework.js @@ -1,31 +1,33 @@ mindplot.collaboration.frameworks = {}; mindplot.collaboration.frameworks.AbstractCollaborativeFramework = new Class({ - initialize: function(model, collaborativeModelFactory){ + initialize: function(model, collaborativeModelFactory) { this._collaborativeModelFactory = collaborativeModelFactory; - if(!$defined(model)){ + if (!$defined(model)) { model = this._buildInitialCollaborativeModel(); } this._model = model; this._actionDispatcher = null; }, - getModel: function(){ + + getModel : function() { return this._model; }, - buildWiseModel: function(){ + + buildWiseModel : function() { var cmindMap = this.getModel(); var mindmap = new mindplot.model.Mindmap(); var branches = cmindMap.getBranches(); - branches.forEach(function(branch){ + branches.forEach(function(branch) { var type = branch.getType(); var id = branch.getId(); - var node = mindmap.createNode(type,id); + var node = mindmap.createNode(type, id); node.setText(branch.getText()); var position = branch.getPosition(); node.setPosition(position.x, position.y); var children = branch.getChildren(); - children.forEach(function(child){ - var node2 = new mindplot.model.NodeModel(child.getType(),mindmap, child.getId()); + children.forEach(function(child) { + var node2 = new mindplot.model.NodeModel(child.getType(), mindmap, child.getId()); node2.setText(child.getText()); var pos = child.getPosition(); node2.setPosition(pos.x, pos.y); @@ -35,35 +37,45 @@ mindplot.collaboration.frameworks.AbstractCollaborativeFramework = new Class({ }.bind(this)); return mindmap; }, - _buildInitialCollaborativeModel: function(){ + + _buildInitialCollaborativeModel: function() { var mindmap = this._collaborativeModelFactory.buildMindMap(); var centralTopic = mindmap.createNode(mindplot.model.NodeModel.CENTRAL_TOPIC_TYPE); mindmap.addBranch(centralTopic, true); this.addMindmap(mindmap); return mindmap; }, - addMindmap:function(model){}, - getTopic:function(id){ - var branches = this.getModel().getBranches(); - for(var i = 0; i 0) { topics.forEach( function(topic, index) { @@ -58,7 +58,7 @@ mindplot.commands.DeleteCommand = new Class({ }.bind(this) ); } - var lines = commandContext.findRelationships(this._topicsIds.relationship); + var lines = commandContext.findRelationships(this._relIds); if (lines.length > 0) { lines.forEach(function(line, index) { if (line.isInWorkspace()) { @@ -70,7 +70,7 @@ mindplot.commands.DeleteCommand = new Class({ }, undoExecute: function(commandContext) { - var topics = commandContext.findTopics(this._topicsIds); + var topics = commandContext.findTopics(this._topicIds); var parent = commandContext.findTopics(this._parentTopicIds); this._deletedTopicModels.forEach( diff --git a/mindplot/src/main/javascript/commands/DragTopicCommand.js b/mindplot/src/main/javascript/commands/DragTopicCommand.js index 0f3c25c2..38f2d7de 100644 --- a/mindplot/src/main/javascript/commands/DragTopicCommand.js +++ b/mindplot/src/main/javascript/commands/DragTopicCommand.js @@ -21,7 +21,7 @@ mindplot.commands.DragTopicCommand = new Class({ initialize: function(topicIds, position, order, parentTopic) { $assert(topicIds, "topicIds must be defined"); - this._topicsIds = topicIds; + this._objectsIds = topicIds; if ($defined(parentTopic)) this._parentId = parentTopic.getId(); @@ -31,7 +31,7 @@ mindplot.commands.DragTopicCommand = new Class({ }, execute: function(commandContext) { - var topic = commandContext.findTopics([this._topicsIds])[0]; + var topic = commandContext.findTopics([this._objectsIds])[0]; // Save old position ... var origParentTopic = topic.getOutgoingConnectedTopic(); diff --git a/mindplot/src/main/javascript/commands/GenericFunctionCommand.js b/mindplot/src/main/javascript/commands/GenericFunctionCommand.js index b2552103..0dc6f896 100644 --- a/mindplot/src/main/javascript/commands/GenericFunctionCommand.js +++ b/mindplot/src/main/javascript/commands/GenericFunctionCommand.js @@ -23,14 +23,14 @@ mindplot.commands.GenericFunctionCommand = new Class({ $assert(topicsIds, "topicsIds must be defined"); this._value = value; - this._topicsIds = topicsIds; + this._objectsIds = topicsIds; this._commandFunc = commandFunc; this._oldValues = []; this._id = mindplot.Command._nextUUID(); }, execute: function(commandContext) { if (!this.applied) { - var topics = commandContext.findTopics(this._topicsIds); + var topics = commandContext.findTopics(this._objectsIds); topics.forEach(function(topic) { var oldValue = this._commandFunc(topic, this._value); this._oldValues.push(oldValue); @@ -43,7 +43,7 @@ mindplot.commands.GenericFunctionCommand = new Class({ }, undoExecute: function(commandContext) { if (this.applied) { - var topics = commandContext.findTopics(this._topicsIds); + var topics = commandContext.findTopics(this._objectsIds); topics.forEach(function(topic, index) { this._commandFunc(topic, this._oldValues[index]); diff --git a/mindplot/src/main/javascript/commands/RemoveIconFromTopicCommand.js b/mindplot/src/main/javascript/commands/RemoveIconFromTopicCommand.js index bd0585fa..b14d6f9e 100644 --- a/mindplot/src/main/javascript/commands/RemoveIconFromTopicCommand.js +++ b/mindplot/src/main/javascript/commands/RemoveIconFromTopicCommand.js @@ -22,12 +22,12 @@ mindplot.commands.RemoveIconFromTopicCommand = new Class({ { $assert(topicIds, 'topicIds can not be null'); $assert(iconModel, 'iconModel can not be null'); - this._topicsIds = topicIds; + this._objectsIds = topicIds; this._iconModel = iconModel; }, execute: function(commandContext) { - var topic = commandContext.findTopics(this._topicsIds)[0]; + var topic = commandContext.findTopics(this._objectsIds)[0]; var updated = function() { topic.removeIcon(this._iconModel); topic._adjustShapes(); @@ -36,7 +36,7 @@ mindplot.commands.RemoveIconFromTopicCommand = new Class({ }, undoExecute: function(commandContext) { - var topic = commandContext.findTopics(this._topicsIds)[0]; + var topic = commandContext.findTopics(this._objectsIds)[0]; var updated = function() { var iconType = this._iconModel.getIconType(); var iconImg = topic.addIcon(iconType, commandContext._designer); diff --git a/mindplot/src/main/javascript/commands/RemoveLinkFromTopicCommand.js b/mindplot/src/main/javascript/commands/RemoveLinkFromTopicCommand.js index 045e6cb8..3665bc47 100644 --- a/mindplot/src/main/javascript/commands/RemoveLinkFromTopicCommand.js +++ b/mindplot/src/main/javascript/commands/RemoveLinkFromTopicCommand.js @@ -20,10 +20,10 @@ mindplot.commands.RemoveLinkFromTopicCommand = new Class({ Extends:mindplot.Command, initialize: function(topicId) { $assert(topicId, 'topicId can not be null'); - this._topicsIds = topicId; + this._objectsIds = topicId; }, execute: function(commandContext) { - var topic = commandContext.findTopics(this._topicsIds)[0]; + var topic = commandContext.findTopics(this._objectsIds)[0]; this._url = topic._link.getUrl(); var updated = function() { topic.removeLink(); @@ -31,7 +31,7 @@ mindplot.commands.RemoveLinkFromTopicCommand = new Class({ updated.delay(0); }, undoExecute: function(commandContext) { - var topic = commandContext.findTopics(this._topicsIds)[0]; + var topic = commandContext.findTopics(this._objectsIds)[0]; var updated = function() { topic.addLink(this._url, commandContext._designer); topic._adjustShapes(); diff --git a/mindplot/src/main/javascript/commands/RemoveNoteFromTopicCommand.js b/mindplot/src/main/javascript/commands/RemoveNoteFromTopicCommand.js index 57201f2e..3d01d6d8 100644 --- a/mindplot/src/main/javascript/commands/RemoveNoteFromTopicCommand.js +++ b/mindplot/src/main/javascript/commands/RemoveNoteFromTopicCommand.js @@ -21,12 +21,12 @@ mindplot.commands.RemoveNoteFromTopicCommand = new Class({ initialize: function(topicId) { $assert(topicId, 'topicId can not be null'); - this._topicsIds = topicId; + this._objectsIds = topicId; }, execute: function(commandContext) { - var topic = commandContext.findTopics(this._topicsIds)[0]; - this._textShape = topic._note.getText(); + var topic = commandContext.findTopics(this._objectsIds)[0]; + this._text = topic._note.getText(); var updated = function() { topic.removeNote(); }.bind(this); @@ -34,9 +34,9 @@ mindplot.commands.RemoveNoteFromTopicCommand = new Class({ }, undoExecute: function(commandContext) { - var topic = commandContext.findTopics(this._topicsIds)[0]; + var topic = commandContext.findTopics(this._objectsIds)[0]; var updated = function() { - topic.addNote(this._textShape,commandContext._designer); + topic.addNote(this._text,commandContext._designer); topic._adjustShapes(); }.bind(this); updated.delay(0); diff --git a/mindplot/src/main/javascript/model/NodeModel.js b/mindplot/src/main/javascript/model/NodeModel.js index 7180c427..6c7eb0f2 100644 --- a/mindplot/src/main/javascript/model/NodeModel.js +++ b/mindplot/src/main/javascript/model/NodeModel.js @@ -38,7 +38,7 @@ mindplot.model.NodeModel = new Class({ this._id = mindplot.model.NodeModel._nextUUID(); } this._mindmap = mindmap; - this._textShape = null; + this._text = null; this._shapeType = null; this._fontFamily = null; this._fontSize = null; @@ -68,7 +68,7 @@ mindplot.model.NodeModel = new Class({ result._position = this._position; result._id = this._id; result._mindmap = this._mindmap; - result._textShape = this._textShape; + result._text = this._text; result._shapeType = this._shapeType; result._fontFamily = this._fontFamily; result._fontSize = this._fontSize; @@ -106,11 +106,11 @@ mindplot.model.NodeModel = new Class({ }, setText : function(text) { - this._textShape = text; + this._text = text; }, getText : function() { - return this._textShape; + return this._text; }, isNodeModel : function() { @@ -322,10 +322,6 @@ mindplot.model.NodeModel = new Class({ mindmap.disconnect(this); }, - getOrder : function() { - return this._order; - }, - getShapeType : function() { return this._shapeType; }, diff --git a/mindplot/src/main/javascript/model/NoteModel.js b/mindplot/src/main/javascript/model/NoteModel.js index 87bbaeb1..b41e43ea 100644 --- a/mindplot/src/main/javascript/model/NoteModel.js +++ b/mindplot/src/main/javascript/model/NoteModel.js @@ -18,18 +18,18 @@ mindplot.model.NoteModel = new Class({ initialize : function(text, topic) { - $assert(text != null, 'note text can not be null'); - $assert(topic, 'mindmap can not be null'); - this._textShape = text; + $assert(text, 'text text can not be null'); + $assert(topic, 'topic can not be null'); + this._text = text; this._topic = topic; }, getText:function() { - return this._textShape; + return this._text; }, setText : function(text) { - this._textShape = text; + this._text = text; }, getTopic : function() { diff --git a/wise-doc/src/main/webapp/html/editor.html b/wise-doc/src/main/webapp/html/editor.html index 5215db97..e89ca572 100644 --- a/wise-doc/src/main/webapp/html/editor.html +++ b/wise-doc/src/main/webapp/html/editor.html @@ -5,7 +5,7 @@ - + WiseMapping - Editor