From feead16974eced5e5ece14d50a44efde69c68812 Mon Sep 17 00:00:00 2001 From: Christina Korger Date: Mon, 30 Mar 2015 11:29:58 +0200 Subject: [PATCH 1/4] Bug/Task WISE-428 fixed: clean-up Designer - remove unused functions de-/activateKeyboard with calls to non-existing methods --HG-- branch : clean-up --- mindplot/src/main/javascript/Designer.js | 15 --------------- 1 file changed, 15 deletions(-) diff --git a/mindplot/src/main/javascript/Designer.js b/mindplot/src/main/javascript/Designer.js index 8b20fa85..6c15d3fe 100644 --- a/mindplot/src/main/javascript/Designer.js +++ b/mindplot/src/main/javascript/Designer.js @@ -78,14 +78,6 @@ mindplot.Designer = new Class(/** @lends Designer */{ this._clipboard = []; }, - /** - * Deactivates the keyboard events so you can enter text into forms - */ - deactivateKeyboard:function () { - mindplot.DesignerKeyboard.getInstance().deactivate(); - this.deselectAll(); - }, - /** * @private */ @@ -121,13 +113,6 @@ mindplot.Designer = new Class(/** @lends Designer */{ }); }, - /** - * Activates the keyboard events so you can enter text into forms - */ - activateKeyboard:function () { - mindplot.DesignerKeyboard.getInstance().activate(); - }, - /** * @param {String} type the event type * @param {Function} listener From 78f1805fd04da7d1428be9eca26c01286238b921 Mon Sep 17 00:00:00 2001 From: Christina Korger Date: Mon, 30 Mar 2015 11:41:08 +0200 Subject: [PATCH 2/4] Bug/Task WISE-430 fixed: clean-up Designer - remove unused function addDraggedNode --HG-- branch : clean-up --- mindplot/src/main/javascript/Designer.js | 19 ------------------- 1 file changed, 19 deletions(-) diff --git a/mindplot/src/main/javascript/Designer.js b/mindplot/src/main/javascript/Designer.js index 6c15d3fe..de9d42e8 100644 --- a/mindplot/src/main/javascript/Designer.js +++ b/mindplot/src/main/javascript/Designer.js @@ -545,25 +545,6 @@ mindplot.Designer = new Class(/** @lends Designer */{ return childModel; }, - /** - * @param {Events} event - * @param {mindplot.model.NodeModel} model - * @todo not used - */ - addDraggedNode:function (event, model) { - $assert(event, "event can not be null"); - $assert(model, "model can not be null"); - - // Position far from the visual area ... - model.setPosition(1000, 1000); - - this._actionDispatcher.addTopics([model]); - var topic = this.getModel().findTopicById(model.getId()); - - // Simulate a mouse down event to start the dragging ... - topic.fireEvent("mousedown", event); - }, - /** * creates a sibling or child node of the selected node, if the selected node is the * central topic From f6a80bb8bf9b7a3190cf84ccef91260d847cb2eb Mon Sep 17 00:00:00 2001 From: Christina Korger Date: Mon, 30 Mar 2015 14:10:26 +0200 Subject: [PATCH 3/4] Bug/Task WISE-429 fixed: mark publicly used Designer functions as public by removing '_' for function definition and calls: _nodeModelToNodeGraph -> nodeModelToNodeGraph _addRelationship -> addRelationship _deleteRelationship -> deleteRelationship _removeTopic -> removeTopic --HG-- branch : clean-up --- mindplot/src/main/javascript/Designer.js | 22 ++++++------------- .../javascript/StandaloneActionDispatcher.js | 8 +++---- 2 files changed, 11 insertions(+), 19 deletions(-) diff --git a/mindplot/src/main/javascript/Designer.js b/mindplot/src/main/javascript/Designer.js index de9d42e8..7b2c117b 100644 --- a/mindplot/src/main/javascript/Designer.js +++ b/mindplot/src/main/javascript/Designer.js @@ -660,7 +660,7 @@ mindplot.Designer = new Class(/** @lends Designer */{ for (var i = 0; i < branches.length; i++) { // NodeModel -> NodeGraph ... var nodeModel = branches[i]; - var nodeGraph = this._nodeModelToNodeGraph(nodeModel); + var nodeGraph = this.nodeModelToNodeGraph(nodeModel); // Update shrink render state... nodeGraph.setBranchVisibility(true); @@ -703,12 +703,10 @@ mindplot.Designer = new Class(/** @lends Designer */{ }, /** - * @private * @param {mindplot.model.NodeModel} nodeModel * @return {mindplot.Topic} the topic (extends mindplot.NodeGraph) created to the model - * @todo marked private but called from mindplot.StandaloneActionDispatcher */ - _nodeModelToNodeGraph:function (nodeModel) { + nodeModelToNodeGraph:function (nodeModel) { $assert(nodeModel, "Node model can not be null"); var children = nodeModel.getChildren().slice(); children = children.sort(function (a, b) { @@ -722,7 +720,7 @@ mindplot.Designer = new Class(/** @lends Designer */{ for (var i = 0; i < children.length; i++) { var child = children[i]; if ($defined(child)) - this._nodeModelToNodeGraph(child); + this.nodeModelToNodeGraph(child); } return nodeGraph; @@ -752,12 +750,10 @@ mindplot.Designer = new Class(/** @lends Designer */{ }, /** - * @private * @param {mindplot.model.RelationshipModel} model * @return {mindplot.Relationship} the relationship added to the mindmap - * @todo marked private but called from mindplot.StandaloneActionDispatcher */ - _addRelationship:function (model) { + addRelationship:function (model) { var mindmap = this.getMindmap(); mindmap.addRelationship(model); return this._relationshipModelToRelationship(model); @@ -765,11 +761,9 @@ mindplot.Designer = new Class(/** @lends Designer */{ /** * deletes the relationship from the linked topics, DesignerModel, Workspace and Mindmap - * @private * @param {mindplot.Relationship} rel the relationship to delete - * @todo marked private but called from mindplot.StandaloneActionDispatcher */ - _deleteRelationship:function (rel) { + deleteRelationship:function (rel) { var sourceTopic = rel.getSourceTopic(); sourceTopic.deleteRelationship(rel); @@ -830,19 +824,17 @@ mindplot.Designer = new Class(/** @lends Designer */{ }, /** - * @private * @param {mindplot.model.Topic} node the topic to remove * removes the given topic and its children from Workspace, DesignerModel and NodeModel - * @todo marked private but called from mindplot.StandaloneActionDispatcher */ - _removeTopic:function (node) { + removeTopic:function (node) { if (!node.isCentralTopic()) { var parent = node._parent; node.disconnect(this._workspace); //remove children while (node.getChildren().length > 0) { - this._removeTopic(node.getChildren()[0]); + this.removeTopic(node.getChildren()[0]); } this._workspace.removeChild(node); diff --git a/mindplot/src/main/javascript/StandaloneActionDispatcher.js b/mindplot/src/main/javascript/StandaloneActionDispatcher.js index 3fc2d8ca..ebd2d84d 100644 --- a/mindplot/src/main/javascript/StandaloneActionDispatcher.js +++ b/mindplot/src/main/javascript/StandaloneActionDispatcher.js @@ -288,13 +288,13 @@ mindplot.CommandContext = new Class(/** @lends CommandContext */{ /** */ deleteTopic:function (topic) { - this._designer._removeTopic(topic); + this._designer.removeTopic(topic); }, /** */ createTopic:function (model) { $assert(model, "model can not be null"); - return this._designer._nodeModelToNodeGraph(model); + return this._designer.nodeModelToNodeGraph(model); }, /** */ @@ -322,12 +322,12 @@ mindplot.CommandContext = new Class(/** @lends CommandContext */{ /** */ addRelationship:function (model) { $assert(model, "model cannot be null"); - return this._designer._addRelationship(model); + return this._designer.addRelationship(model); }, /** */ deleteRelationship:function (relationship) { - this._designer._deleteRelationship(relationship); + this._designer.deleteRelationship(relationship); }, /** */ From 9d136df1fea544de38424481d500db6b696ffd70 Mon Sep 17 00:00:00 2001 From: Christina Korger Date: Sat, 4 Apr 2015 20:45:36 +0200 Subject: [PATCH 4/4] revert commit b4b1c6d Backed out changeset: f1dbc1a70afc (probable future relevance to image dragging support) --HG-- branch : clean-up --- mindplot/src/main/javascript/Designer.js | 19 +++++++++++++++++++ 1 file changed, 19 insertions(+) diff --git a/mindplot/src/main/javascript/Designer.js b/mindplot/src/main/javascript/Designer.js index 7b2c117b..dc2d5ca4 100644 --- a/mindplot/src/main/javascript/Designer.js +++ b/mindplot/src/main/javascript/Designer.js @@ -545,6 +545,25 @@ mindplot.Designer = new Class(/** @lends Designer */{ return childModel; }, + /** + * @param {Events} event + * @param {mindplot.model.NodeModel} model + * @todo not used + */ + addDraggedNode:function (event, model) { + $assert(event, "event can not be null"); + $assert(model, "model can not be null"); + + // Position far from the visual area ... + model.setPosition(1000, 1000); + + this._actionDispatcher.addTopics([model]); + var topic = this.getModel().findTopicById(model.getId()); + + // Simulate a mouse down event to start the dragging ... + topic.fireEvent("mousedown", event); + }, + /** * creates a sibling or child node of the selected node, if the selected node is the * central topic