mirror of
https://bitbucket.org/wisemapping/wisemapping-open-source.git
synced 2024-11-25 15:37:56 +01:00
Merged in christinaKorger/wisemapping-open-source (pull request #3)
clean-up
This commit is contained in:
commit
89772a9e6e
@ -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
|
||||
@ -694,7 +679,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);
|
||||
@ -737,12 +722,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) {
|
||||
@ -756,7 +739,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;
|
||||
@ -786,12 +769,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);
|
||||
@ -799,11 +780,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);
|
||||
|
||||
@ -864,19 +843,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);
|
||||
|
@ -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);
|
||||
},
|
||||
|
||||
/** */
|
||||
|
Loading…
Reference in New Issue
Block a user