mirror of
https://bitbucket.org/wisemapping/wisemapping-open-source.git
synced 2024-11-22 06:07:57 +01:00
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
This commit is contained in:
parent
78f1805fd0
commit
f6a80bb8bf
@ -660,7 +660,7 @@ mindplot.Designer = new Class(/** @lends Designer */{
|
|||||||
for (var i = 0; i < branches.length; i++) {
|
for (var i = 0; i < branches.length; i++) {
|
||||||
// NodeModel -> NodeGraph ...
|
// NodeModel -> NodeGraph ...
|
||||||
var nodeModel = branches[i];
|
var nodeModel = branches[i];
|
||||||
var nodeGraph = this._nodeModelToNodeGraph(nodeModel);
|
var nodeGraph = this.nodeModelToNodeGraph(nodeModel);
|
||||||
|
|
||||||
// Update shrink render state...
|
// Update shrink render state...
|
||||||
nodeGraph.setBranchVisibility(true);
|
nodeGraph.setBranchVisibility(true);
|
||||||
@ -703,12 +703,10 @@ mindplot.Designer = new Class(/** @lends Designer */{
|
|||||||
},
|
},
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @private
|
|
||||||
* @param {mindplot.model.NodeModel} nodeModel
|
* @param {mindplot.model.NodeModel} nodeModel
|
||||||
* @return {mindplot.Topic} the topic (extends mindplot.NodeGraph) created to the model
|
* @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");
|
$assert(nodeModel, "Node model can not be null");
|
||||||
var children = nodeModel.getChildren().slice();
|
var children = nodeModel.getChildren().slice();
|
||||||
children = children.sort(function (a, b) {
|
children = children.sort(function (a, b) {
|
||||||
@ -722,7 +720,7 @@ mindplot.Designer = new Class(/** @lends Designer */{
|
|||||||
for (var i = 0; i < children.length; i++) {
|
for (var i = 0; i < children.length; i++) {
|
||||||
var child = children[i];
|
var child = children[i];
|
||||||
if ($defined(child))
|
if ($defined(child))
|
||||||
this._nodeModelToNodeGraph(child);
|
this.nodeModelToNodeGraph(child);
|
||||||
}
|
}
|
||||||
|
|
||||||
return nodeGraph;
|
return nodeGraph;
|
||||||
@ -752,12 +750,10 @@ mindplot.Designer = new Class(/** @lends Designer */{
|
|||||||
},
|
},
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @private
|
|
||||||
* @param {mindplot.model.RelationshipModel} model
|
* @param {mindplot.model.RelationshipModel} model
|
||||||
* @return {mindplot.Relationship} the relationship added to the mindmap
|
* @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();
|
var mindmap = this.getMindmap();
|
||||||
mindmap.addRelationship(model);
|
mindmap.addRelationship(model);
|
||||||
return this._relationshipModelToRelationship(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
|
* deletes the relationship from the linked topics, DesignerModel, Workspace and Mindmap
|
||||||
* @private
|
|
||||||
* @param {mindplot.Relationship} rel the relationship to delete
|
* @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();
|
var sourceTopic = rel.getSourceTopic();
|
||||||
sourceTopic.deleteRelationship(rel);
|
sourceTopic.deleteRelationship(rel);
|
||||||
|
|
||||||
@ -830,19 +824,17 @@ mindplot.Designer = new Class(/** @lends Designer */{
|
|||||||
},
|
},
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @private
|
|
||||||
* @param {mindplot.model.Topic} node the topic to remove
|
* @param {mindplot.model.Topic} node the topic to remove
|
||||||
* removes the given topic and its children from Workspace, DesignerModel and NodeModel
|
* 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()) {
|
if (!node.isCentralTopic()) {
|
||||||
var parent = node._parent;
|
var parent = node._parent;
|
||||||
node.disconnect(this._workspace);
|
node.disconnect(this._workspace);
|
||||||
|
|
||||||
//remove children
|
//remove children
|
||||||
while (node.getChildren().length > 0) {
|
while (node.getChildren().length > 0) {
|
||||||
this._removeTopic(node.getChildren()[0]);
|
this.removeTopic(node.getChildren()[0]);
|
||||||
}
|
}
|
||||||
|
|
||||||
this._workspace.removeChild(node);
|
this._workspace.removeChild(node);
|
||||||
|
@ -288,13 +288,13 @@ mindplot.CommandContext = new Class(/** @lends CommandContext */{
|
|||||||
|
|
||||||
/** */
|
/** */
|
||||||
deleteTopic:function (topic) {
|
deleteTopic:function (topic) {
|
||||||
this._designer._removeTopic(topic);
|
this._designer.removeTopic(topic);
|
||||||
},
|
},
|
||||||
|
|
||||||
/** */
|
/** */
|
||||||
createTopic:function (model) {
|
createTopic:function (model) {
|
||||||
$assert(model, "model can not be null");
|
$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) {
|
addRelationship:function (model) {
|
||||||
$assert(model, "model cannot be null");
|
$assert(model, "model cannot be null");
|
||||||
return this._designer._addRelationship(model);
|
return this._designer.addRelationship(model);
|
||||||
},
|
},
|
||||||
|
|
||||||
/** */
|
/** */
|
||||||
deleteRelationship:function (relationship) {
|
deleteRelationship:function (relationship) {
|
||||||
this._designer._deleteRelationship(relationship);
|
this._designer.deleteRelationship(relationship);
|
||||||
},
|
},
|
||||||
|
|
||||||
/** */
|
/** */
|
||||||
|
Loading…
Reference in New Issue
Block a user