mirror of
https://bitbucket.org/wisemapping/wisemapping-open-source.git
synced 2024-11-22 22:27:55 +01:00
- Add support for copy and paste.
This commit is contained in:
parent
a5acdc7bb7
commit
8175eea928
@ -27,7 +27,7 @@ mindplot.ActionDispatcher = new Class({
|
|||||||
throw "method must be implemented.";
|
throw "method must be implemented.";
|
||||||
},
|
},
|
||||||
|
|
||||||
addTopic: function(nodeModel, parentTopicId, animated) {
|
addTopics: function(models, parentTopicId) {
|
||||||
throw "method must be implemented.";
|
throw "method must be implemented.";
|
||||||
},
|
},
|
||||||
|
|
||||||
|
@ -61,7 +61,7 @@ mindplot.BrixActionDispatcher = new Class({
|
|||||||
return mindplot.collaboration.CollaborationManager.getInstance().getCollaborativeFramework();
|
return mindplot.collaboration.CollaborationManager.getInstance().getCollaborativeFramework();
|
||||||
},
|
},
|
||||||
|
|
||||||
addTopic : function(nodeModel, parentTopicId, animated) {
|
addTopics : function(nodeModel, parentTopicId) {
|
||||||
var framework = this._getFramework();
|
var framework = this._getFramework();
|
||||||
var cmindmap = framework.getModel();
|
var cmindmap = framework.getModel();
|
||||||
|
|
||||||
|
@ -65,6 +65,7 @@ mindplot.Designer = new Class({
|
|||||||
this.setViewPort(options.viewPort);
|
this.setViewPort(options.viewPort);
|
||||||
|
|
||||||
mindplot.TopicEventDispatcher.configure(this.isReadOnly());
|
mindplot.TopicEventDispatcher.configure(this.isReadOnly());
|
||||||
|
this._clipboard = [];
|
||||||
},
|
},
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@ -131,7 +132,7 @@ mindplot.Designer = new Class({
|
|||||||
|
|
||||||
var centralTopic = this.getModel().getCentralTopic();
|
var centralTopic = this.getModel().getCentralTopic();
|
||||||
var model = this._createChildModel(centralTopic, mousePos);
|
var model = this._createChildModel(centralTopic, mousePos);
|
||||||
this._actionDispatcher.addTopic(model, centralTopic.getId());
|
this._actionDispatcher.addTopics([model], [centralTopic.getId()]);
|
||||||
}
|
}
|
||||||
}.bind(this));
|
}.bind(this));
|
||||||
|
|
||||||
@ -347,6 +348,41 @@ mindplot.Designer = new Class({
|
|||||||
}
|
}
|
||||||
},
|
},
|
||||||
|
|
||||||
|
copyToClipboard:function () {
|
||||||
|
var topics = this.getModel().filterSelectedTopics();
|
||||||
|
if (topics.length <= 0) {
|
||||||
|
// If there are more than one node selected,
|
||||||
|
$notify($msg('AT_LEAST_ONE_TOPIC_MUST_BE_SELECTED'));
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
|
// Exclude central topic ..
|
||||||
|
topics = topics.filter(function (topic) {
|
||||||
|
return topic.getTopicType() != mindplot.model.INodeModel.CENTRAL_TOPIC_TYPE
|
||||||
|
});
|
||||||
|
|
||||||
|
this._clipboard = topics.map(function (topic) {
|
||||||
|
var nodeModel = topic.getModel().deepCopy();
|
||||||
|
|
||||||
|
// Change position to make the new topic evident...
|
||||||
|
var pos = nodeModel.getPosition();
|
||||||
|
nodeModel.setPosition(pos.x + (60 * Math.sign(pos.x)), pos.y + 30);
|
||||||
|
|
||||||
|
return nodeModel;
|
||||||
|
});
|
||||||
|
|
||||||
|
$notify($msg('SELECTION_COPIED_TO_CLIPBOARD'));
|
||||||
|
},
|
||||||
|
|
||||||
|
pasteClipboard:function () {
|
||||||
|
if (this._clipboard.length == 0) {
|
||||||
|
$notify($msg('CLIPBOARD_IS_EMPTY'));
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
this._actionDispatcher.addTopics(this._clipboard);
|
||||||
|
this._clipboard = [];
|
||||||
|
},
|
||||||
|
|
||||||
getModel:function () {
|
getModel:function () {
|
||||||
return this._model;
|
return this._model;
|
||||||
},
|
},
|
||||||
@ -387,7 +423,7 @@ mindplot.Designer = new Class({
|
|||||||
var childModel = this._createChildModel(parentTopic);
|
var childModel = this._createChildModel(parentTopic);
|
||||||
|
|
||||||
// Execute event ...
|
// Execute event ...
|
||||||
this._actionDispatcher.addTopic(childModel, parentTopicId, true);
|
this._actionDispatcher.addTopics([childModel], [parentTopicId]);
|
||||||
|
|
||||||
},
|
},
|
||||||
|
|
||||||
@ -415,7 +451,7 @@ mindplot.Designer = new Class({
|
|||||||
// Position far from the visual area ...
|
// Position far from the visual area ...
|
||||||
model.setPosition(1000, 1000);
|
model.setPosition(1000, 1000);
|
||||||
|
|
||||||
this._actionDispatcher.addTopic(model, null, false);
|
this._actionDispatcher.addTopics([model]);
|
||||||
var topic = this.getModel().findTopicById(model.getId());
|
var topic = this.getModel().findTopicById(model.getId());
|
||||||
|
|
||||||
// Simulate a mouse down event to start the dragging ...
|
// Simulate a mouse down event to start the dragging ...
|
||||||
@ -452,7 +488,7 @@ mindplot.Designer = new Class({
|
|||||||
}
|
}
|
||||||
|
|
||||||
var parentTopicId = parentTopic.getId();
|
var parentTopicId = parentTopic.getId();
|
||||||
this._actionDispatcher.addTopic(siblingModel, parentTopicId, true);
|
this._actionDispatcher.addTopics([siblingModel], [parentTopicId]);
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
|
|
||||||
|
@ -93,6 +93,35 @@ mindplot.DesignerKeyboard = new Class({
|
|||||||
|
|
||||||
}.bind(this),
|
}.bind(this),
|
||||||
|
|
||||||
|
'ctrl+c':function () {
|
||||||
|
event.preventDefault(event);
|
||||||
|
event.stopPropagation();
|
||||||
|
designer.copyToClipboard();
|
||||||
|
}.bind(this),
|
||||||
|
|
||||||
|
'meta+c':function (event) {
|
||||||
|
event.preventDefault();
|
||||||
|
event.stopPropagation();
|
||||||
|
|
||||||
|
designer.copyToClipboard();
|
||||||
|
|
||||||
|
}.bind(this),
|
||||||
|
|
||||||
|
'ctrl+v':function () {
|
||||||
|
event.preventDefault(event);
|
||||||
|
event.stopPropagation();
|
||||||
|
|
||||||
|
designer.pasteClipboard();
|
||||||
|
}.bind(this),
|
||||||
|
|
||||||
|
'meta+v':function (event) {
|
||||||
|
event.preventDefault();
|
||||||
|
event.stopPropagation();
|
||||||
|
|
||||||
|
designer.pasteClipboard();
|
||||||
|
|
||||||
|
}.bind(this),
|
||||||
|
|
||||||
'ctrl+z+shift':function (event) {
|
'ctrl+z+shift':function (event) {
|
||||||
event.preventDefault();
|
event.preventDefault();
|
||||||
event.stopPropagation();
|
event.stopPropagation();
|
||||||
|
@ -86,8 +86,12 @@ mindplot.Messages.BUNDLES = {
|
|||||||
CENTRAL_TOPIC:'Central Topic',
|
CENTRAL_TOPIC:'Central Topic',
|
||||||
ONLY_ONE_TOPIC_MUST_BE_SELECTED_COLLAPSE:'Children can not be collapsed. One topic must be selected.',
|
ONLY_ONE_TOPIC_MUST_BE_SELECTED_COLLAPSE:'Children can not be collapsed. One topic must be selected.',
|
||||||
SHORTCUTS:'Keyboard Shortcuts',
|
SHORTCUTS:'Keyboard Shortcuts',
|
||||||
ENTITIES_COULD_NOT_BE_DELETED: 'Could not delete topic or relation. At least one map entity must be selected.',
|
|
||||||
CENTRAL_TOPIC_CAN_NOT_BE_DELETED: 'Central topic can not be deleted.'
|
// @Todo: pending ...
|
||||||
|
ENTITIES_COULD_NOT_BE_DELETED:'Could not delete topic or relation. At least one map entity must be selected.',
|
||||||
|
CENTRAL_TOPIC_CAN_NOT_BE_DELETED:'Central topic can not be deleted.',
|
||||||
|
SELECTION_COPIED_TO_CLIPBOARD:'Topics copied to the clipboard',
|
||||||
|
CLIPBOARD_IS_EMPTY:'Nothing to copy. Clipboard is empty'
|
||||||
},
|
},
|
||||||
'es':{
|
'es':{
|
||||||
DISCARD_CHANGES:'Descartar Cambios',
|
DISCARD_CHANGES:'Descartar Cambios',
|
||||||
|
@ -29,8 +29,8 @@ mindplot.StandaloneActionDispatcher = new Class({
|
|||||||
},
|
},
|
||||||
|
|
||||||
|
|
||||||
addTopic:function (nodeModel, parentTopicId, animated) {
|
addTopics:function (models, parentTopicsId) {
|
||||||
var command = new mindplot.commands.AddTopicCommand(nodeModel, parentTopicId, animated);
|
var command = new mindplot.commands.AddTopicCommand(models, parentTopicsId);
|
||||||
this.execute(command);
|
this.execute(command);
|
||||||
},
|
},
|
||||||
|
|
||||||
|
@ -19,7 +19,7 @@
|
|||||||
|
|
||||||
mindplot.Topic = new Class({
|
mindplot.Topic = new Class({
|
||||||
Extends:mindplot.NodeGraph,
|
Extends:mindplot.NodeGraph,
|
||||||
initialize : function(model, options) {
|
initialize:function (model, options) {
|
||||||
this.parent(model, options);
|
this.parent(model, options);
|
||||||
this._children = [];
|
this._children = [];
|
||||||
this._parent = null;
|
this._parent = null;
|
||||||
@ -39,12 +39,12 @@ mindplot.Topic = new Class({
|
|||||||
}
|
}
|
||||||
},
|
},
|
||||||
|
|
||||||
_registerEvents : function() {
|
_registerEvents:function () {
|
||||||
|
|
||||||
this.setMouseEventsEnabled(true);
|
this.setMouseEventsEnabled(true);
|
||||||
|
|
||||||
// Prevent click on the topics being propagated ...
|
// Prevent click on the topics being propagated ...
|
||||||
this.addEvent('click', function(event) {
|
this.addEvent('click', function (event) {
|
||||||
event.stopPropagation();
|
event.stopPropagation();
|
||||||
});
|
});
|
||||||
|
|
||||||
@ -54,15 +54,15 @@ mindplot.Topic = new Class({
|
|||||||
}.bind(this));
|
}.bind(this));
|
||||||
},
|
},
|
||||||
|
|
||||||
setShapeType : function(type) {
|
setShapeType:function (type) {
|
||||||
this._setShapeType(type, true);
|
this._setShapeType(type, true);
|
||||||
},
|
},
|
||||||
|
|
||||||
getParent : function() {
|
getParent:function () {
|
||||||
return this._parent;
|
return this._parent;
|
||||||
},
|
},
|
||||||
|
|
||||||
_setShapeType : function(type, updateModel) {
|
_setShapeType:function (type, updateModel) {
|
||||||
// Remove inner shape figure ...
|
// Remove inner shape figure ...
|
||||||
var model = this.getModel();
|
var model = this.getModel();
|
||||||
if ($defined(updateModel) && updateModel) {
|
if ($defined(updateModel) && updateModel) {
|
||||||
@ -103,7 +103,7 @@ mindplot.Topic = new Class({
|
|||||||
|
|
||||||
},
|
},
|
||||||
|
|
||||||
getShapeType : function() {
|
getShapeType:function () {
|
||||||
var model = this.getModel();
|
var model = this.getModel();
|
||||||
var result = model.getShapeType();
|
var result = model.getShapeType();
|
||||||
if (!$defined(result)) {
|
if (!$defined(result)) {
|
||||||
@ -112,7 +112,7 @@ mindplot.Topic = new Class({
|
|||||||
return result;
|
return result;
|
||||||
},
|
},
|
||||||
|
|
||||||
_removeInnerShape : function() {
|
_removeInnerShape:function () {
|
||||||
var group = this.get2DElement();
|
var group = this.get2DElement();
|
||||||
var innerShape = this.getInnerShape();
|
var innerShape = this.getInnerShape();
|
||||||
group.removeChild(innerShape);
|
group.removeChild(innerShape);
|
||||||
@ -120,7 +120,7 @@ mindplot.Topic = new Class({
|
|||||||
return innerShape;
|
return innerShape;
|
||||||
},
|
},
|
||||||
|
|
||||||
getInnerShape : function() {
|
getInnerShape:function () {
|
||||||
if (!$defined(this._innerShape)) {
|
if (!$defined(this._innerShape)) {
|
||||||
// Create inner box.
|
// Create inner box.
|
||||||
this._innerShape = this._buildShape(mindplot.Topic.INNER_RECT_ATTRIBUTES, this.getShapeType());
|
this._innerShape = this._buildShape(mindplot.Topic.INNER_RECT_ATTRIBUTES, this.getShapeType());
|
||||||
@ -144,7 +144,7 @@ mindplot.Topic = new Class({
|
|||||||
return this._innerShape;
|
return this._innerShape;
|
||||||
},
|
},
|
||||||
|
|
||||||
_buildShape : function(attributes, shapeType) {
|
_buildShape:function (attributes, shapeType) {
|
||||||
$assert(attributes, "attributes can not be null");
|
$assert(attributes, "attributes can not be null");
|
||||||
$assert(shapeType, "shapeType can not be null");
|
$assert(shapeType, "shapeType can not be null");
|
||||||
|
|
||||||
@ -160,11 +160,11 @@ mindplot.Topic = new Class({
|
|||||||
result.setHref(url);
|
result.setHref(url);
|
||||||
result.setSize(size.width, size.height);
|
result.setSize(size.width, size.height);
|
||||||
|
|
||||||
result.getSize = function() {
|
result.getSize = function () {
|
||||||
return model.getImageSize();
|
return model.getImageSize();
|
||||||
};
|
};
|
||||||
|
|
||||||
result.setPosition = function() {
|
result.setPosition = function () {
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
else if (shapeType == mindplot.model.TopicShape.ELLIPSE) {
|
else if (shapeType == mindplot.model.TopicShape.ELLIPSE) {
|
||||||
@ -174,8 +174,8 @@ mindplot.Topic = new Class({
|
|||||||
result = new web2d.Rect(0.3, attributes);
|
result = new web2d.Rect(0.3, attributes);
|
||||||
}
|
}
|
||||||
else if (shapeType == mindplot.model.TopicShape.LINE) {
|
else if (shapeType == mindplot.model.TopicShape.LINE) {
|
||||||
result = new web2d.Line({strokeColor:"#495879",strokeWidth:1});
|
result = new web2d.Line({strokeColor:"#495879", strokeWidth:1});
|
||||||
result.setSize = function(width, height) {
|
result.setSize = function (width, height) {
|
||||||
this.size = {width:width, height:height};
|
this.size = {width:width, height:height};
|
||||||
result.setFrom(0, height);
|
result.setFrom(0, height);
|
||||||
result.setTo(width, height);
|
result.setTo(width, height);
|
||||||
@ -185,18 +185,18 @@ mindplot.Topic = new Class({
|
|||||||
result.setStroke(1, 'solid', stokeColor);
|
result.setStroke(1, 'solid', stokeColor);
|
||||||
};
|
};
|
||||||
|
|
||||||
result.getSize = function() {
|
result.getSize = function () {
|
||||||
return this.size;
|
return this.size;
|
||||||
};
|
};
|
||||||
|
|
||||||
result.setPosition = function() {
|
result.setPosition = function () {
|
||||||
};
|
};
|
||||||
|
|
||||||
result.setFill = function() {
|
result.setFill = function () {
|
||||||
|
|
||||||
};
|
};
|
||||||
|
|
||||||
result.setStroke = function() {
|
result.setStroke = function () {
|
||||||
|
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
@ -208,7 +208,7 @@ mindplot.Topic = new Class({
|
|||||||
},
|
},
|
||||||
|
|
||||||
|
|
||||||
setCursor : function(type) {
|
setCursor:function (type) {
|
||||||
var innerShape = this.getInnerShape();
|
var innerShape = this.getInnerShape();
|
||||||
innerShape.setCursor(type);
|
innerShape.setCursor(type);
|
||||||
|
|
||||||
@ -219,7 +219,7 @@ mindplot.Topic = new Class({
|
|||||||
textShape.setCursor(type);
|
textShape.setCursor(type);
|
||||||
},
|
},
|
||||||
|
|
||||||
getOuterShape : function() {
|
getOuterShape:function () {
|
||||||
if (!$defined(this._outerShape)) {
|
if (!$defined(this._outerShape)) {
|
||||||
var rect = this._buildShape(mindplot.Topic.OUTER_SHAPE_ATTRIBUTES, mindplot.model.TopicShape.ROUNDED_RECT);
|
var rect = this._buildShape(mindplot.Topic.OUTER_SHAPE_ATTRIBUTES, mindplot.model.TopicShape.ROUNDED_RECT);
|
||||||
rect.setPosition(-2, -3);
|
rect.setPosition(-2, -3);
|
||||||
@ -230,7 +230,7 @@ mindplot.Topic = new Class({
|
|||||||
return this._outerShape;
|
return this._outerShape;
|
||||||
},
|
},
|
||||||
|
|
||||||
getTextShape : function() {
|
getTextShape:function () {
|
||||||
if (!$defined(this._text)) {
|
if (!$defined(this._text)) {
|
||||||
this._text = this._buildTextShape(false);
|
this._text = this._buildTextShape(false);
|
||||||
|
|
||||||
@ -242,7 +242,7 @@ mindplot.Topic = new Class({
|
|||||||
return this._text;
|
return this._text;
|
||||||
},
|
},
|
||||||
|
|
||||||
getOrBuildIconGroup : function() {
|
getOrBuildIconGroup:function () {
|
||||||
if (!$defined(this._iconsGroup)) {
|
if (!$defined(this._iconsGroup)) {
|
||||||
this._iconsGroup = this._buildIconGroup();
|
this._iconsGroup = this._buildIconGroup();
|
||||||
var group = this.get2DElement();
|
var group = this.get2DElement();
|
||||||
@ -252,11 +252,11 @@ mindplot.Topic = new Class({
|
|||||||
return this._iconsGroup;
|
return this._iconsGroup;
|
||||||
},
|
},
|
||||||
|
|
||||||
getIconGroup : function() {
|
getIconGroup:function () {
|
||||||
return this._iconsGroup;
|
return this._iconsGroup;
|
||||||
},
|
},
|
||||||
|
|
||||||
_buildIconGroup : function() {
|
_buildIconGroup:function () {
|
||||||
var textHeight = this.getTextShape().getFontHeight();
|
var textHeight = this.getTextShape().getFontHeight();
|
||||||
var result = new mindplot.IconGroup(this.getId(), textHeight);
|
var result = new mindplot.IconGroup(this.getId(), textHeight);
|
||||||
var padding = this._getInnerPadding();
|
var padding = this._getInnerPadding();
|
||||||
@ -274,7 +274,7 @@ mindplot.Topic = new Class({
|
|||||||
return result;
|
return result;
|
||||||
},
|
},
|
||||||
|
|
||||||
addFeature : function(type, attributes) {
|
addFeature:function (type, attributes) {
|
||||||
var iconGroup = this.getOrBuildIconGroup();
|
var iconGroup = this.getOrBuildIconGroup();
|
||||||
this.closeEditors();
|
this.closeEditors();
|
||||||
|
|
||||||
@ -291,12 +291,12 @@ mindplot.Topic = new Class({
|
|||||||
return result;
|
return result;
|
||||||
},
|
},
|
||||||
|
|
||||||
findFeatureById : function(id) {
|
findFeatureById:function (id) {
|
||||||
var model = this.getModel();
|
var model = this.getModel();
|
||||||
return model.findFeatureById(id);
|
return model.findFeatureById(id);
|
||||||
},
|
},
|
||||||
|
|
||||||
removeFeature : function(featureModel) {
|
removeFeature:function (featureModel) {
|
||||||
$assert(featureModel, "featureModel could not be null");
|
$assert(featureModel, "featureModel could not be null");
|
||||||
|
|
||||||
//Removing the icon from MODEL
|
//Removing the icon from MODEL
|
||||||
@ -311,19 +311,19 @@ mindplot.Topic = new Class({
|
|||||||
this._adjustShapes();
|
this._adjustShapes();
|
||||||
},
|
},
|
||||||
|
|
||||||
addRelationship : function(relationship) {
|
addRelationship:function (relationship) {
|
||||||
this._relationships.push(relationship);
|
this._relationships.push(relationship);
|
||||||
},
|
},
|
||||||
|
|
||||||
deleteRelationship : function(relationship) {
|
deleteRelationship:function (relationship) {
|
||||||
this._relationships.erase(relationship);
|
this._relationships.erase(relationship);
|
||||||
},
|
},
|
||||||
|
|
||||||
getRelationships : function() {
|
getRelationships:function () {
|
||||||
return this._relationships;
|
return this._relationships;
|
||||||
},
|
},
|
||||||
|
|
||||||
_buildTextShape : function(readOnly) {
|
_buildTextShape:function (readOnly) {
|
||||||
var result = new web2d.Text();
|
var result = new web2d.Text();
|
||||||
var family = this.getFontFamily();
|
var family = this.getFontFamily();
|
||||||
var size = this.getFontSize();
|
var size = this.getFontSize();
|
||||||
@ -346,11 +346,11 @@ mindplot.Topic = new Class({
|
|||||||
return result;
|
return result;
|
||||||
},
|
},
|
||||||
|
|
||||||
_getInnerPadding : function() {
|
_getInnerPadding:function () {
|
||||||
throw "this must be implemented";
|
throw "this must be implemented";
|
||||||
},
|
},
|
||||||
|
|
||||||
setFontFamily : function(value, updateModel) {
|
setFontFamily:function (value, updateModel) {
|
||||||
var textShape = this.getTextShape();
|
var textShape = this.getTextShape();
|
||||||
textShape.setFontFamily(value);
|
textShape.setFontFamily(value);
|
||||||
if ($defined(updateModel) && updateModel) {
|
if ($defined(updateModel) && updateModel) {
|
||||||
@ -360,7 +360,7 @@ mindplot.Topic = new Class({
|
|||||||
this._adjustShapes(updateModel);
|
this._adjustShapes(updateModel);
|
||||||
},
|
},
|
||||||
|
|
||||||
setFontSize : function(value, updateModel) {
|
setFontSize:function (value, updateModel) {
|
||||||
|
|
||||||
var textShape = this.getTextShape();
|
var textShape = this.getTextShape();
|
||||||
textShape.setSize(value);
|
textShape.setSize(value);
|
||||||
@ -373,7 +373,7 @@ mindplot.Topic = new Class({
|
|||||||
|
|
||||||
},
|
},
|
||||||
|
|
||||||
setFontStyle : function(value, updateModel) {
|
setFontStyle:function (value, updateModel) {
|
||||||
var textShape = this.getTextShape();
|
var textShape = this.getTextShape();
|
||||||
textShape.setStyle(value);
|
textShape.setStyle(value);
|
||||||
if ($defined(updateModel) && updateModel) {
|
if ($defined(updateModel) && updateModel) {
|
||||||
@ -383,7 +383,7 @@ mindplot.Topic = new Class({
|
|||||||
this._adjustShapes(updateModel);
|
this._adjustShapes(updateModel);
|
||||||
},
|
},
|
||||||
|
|
||||||
setFontWeight : function(value, updateModel) {
|
setFontWeight:function (value, updateModel) {
|
||||||
var textShape = this.getTextShape();
|
var textShape = this.getTextShape();
|
||||||
textShape.setWeight(value);
|
textShape.setWeight(value);
|
||||||
if ($defined(updateModel) && updateModel) {
|
if ($defined(updateModel) && updateModel) {
|
||||||
@ -393,7 +393,7 @@ mindplot.Topic = new Class({
|
|||||||
this._adjustShapes();
|
this._adjustShapes();
|
||||||
},
|
},
|
||||||
|
|
||||||
getFontWeight : function() {
|
getFontWeight:function () {
|
||||||
var model = this.getModel();
|
var model = this.getModel();
|
||||||
var result = model.getFontWeight();
|
var result = model.getFontWeight();
|
||||||
if (!$defined(result)) {
|
if (!$defined(result)) {
|
||||||
@ -403,7 +403,7 @@ mindplot.Topic = new Class({
|
|||||||
return result;
|
return result;
|
||||||
},
|
},
|
||||||
|
|
||||||
getFontFamily : function() {
|
getFontFamily:function () {
|
||||||
var model = this.getModel();
|
var model = this.getModel();
|
||||||
var result = model.getFontFamily();
|
var result = model.getFontFamily();
|
||||||
if (!$defined(result)) {
|
if (!$defined(result)) {
|
||||||
@ -413,7 +413,7 @@ mindplot.Topic = new Class({
|
|||||||
return result;
|
return result;
|
||||||
},
|
},
|
||||||
|
|
||||||
getFontColor : function() {
|
getFontColor:function () {
|
||||||
var model = this.getModel();
|
var model = this.getModel();
|
||||||
var result = model.getFontColor();
|
var result = model.getFontColor();
|
||||||
if (!$defined(result)) {
|
if (!$defined(result)) {
|
||||||
@ -423,7 +423,7 @@ mindplot.Topic = new Class({
|
|||||||
return result;
|
return result;
|
||||||
},
|
},
|
||||||
|
|
||||||
getFontStyle : function() {
|
getFontStyle:function () {
|
||||||
var model = this.getModel();
|
var model = this.getModel();
|
||||||
var result = model.getFontStyle();
|
var result = model.getFontStyle();
|
||||||
if (!$defined(result)) {
|
if (!$defined(result)) {
|
||||||
@ -433,7 +433,7 @@ mindplot.Topic = new Class({
|
|||||||
return result;
|
return result;
|
||||||
},
|
},
|
||||||
|
|
||||||
getFontSize : function() {
|
getFontSize:function () {
|
||||||
var model = this.getModel();
|
var model = this.getModel();
|
||||||
var result = model.getFontSize();
|
var result = model.getFontSize();
|
||||||
if (!$defined(result)) {
|
if (!$defined(result)) {
|
||||||
@ -443,7 +443,7 @@ mindplot.Topic = new Class({
|
|||||||
return result;
|
return result;
|
||||||
},
|
},
|
||||||
|
|
||||||
setFontColor : function(value, updateModel) {
|
setFontColor:function (value, updateModel) {
|
||||||
var textShape = this.getTextShape();
|
var textShape = this.getTextShape();
|
||||||
textShape.setColor(value);
|
textShape.setColor(value);
|
||||||
if ($defined(updateModel) && updateModel) {
|
if ($defined(updateModel) && updateModel) {
|
||||||
@ -452,7 +452,7 @@ mindplot.Topic = new Class({
|
|||||||
}
|
}
|
||||||
},
|
},
|
||||||
|
|
||||||
_setText : function(text, updateModel) {
|
_setText:function (text, updateModel) {
|
||||||
var textShape = this.getTextShape();
|
var textShape = this.getTextShape();
|
||||||
textShape.setText(text == null ? this._defaultText() : text);
|
textShape.setText(text == null ? this._defaultText() : text);
|
||||||
|
|
||||||
@ -462,7 +462,7 @@ mindplot.Topic = new Class({
|
|||||||
}
|
}
|
||||||
},
|
},
|
||||||
|
|
||||||
setText : function(text) {
|
setText:function (text) {
|
||||||
// Avoid empty nodes ...
|
// Avoid empty nodes ...
|
||||||
if (text.trim().length == 0) {
|
if (text.trim().length == 0) {
|
||||||
text = null;
|
text = null;
|
||||||
@ -472,7 +472,7 @@ mindplot.Topic = new Class({
|
|||||||
this._adjustShapes();
|
this._adjustShapes();
|
||||||
},
|
},
|
||||||
|
|
||||||
getText : function() {
|
getText:function () {
|
||||||
var model = this.getModel();
|
var model = this.getModel();
|
||||||
var result = model.getText();
|
var result = model.getText();
|
||||||
if (!$defined(result)) {
|
if (!$defined(result)) {
|
||||||
@ -481,11 +481,11 @@ mindplot.Topic = new Class({
|
|||||||
return result;
|
return result;
|
||||||
},
|
},
|
||||||
|
|
||||||
setBackgroundColor : function(color) {
|
setBackgroundColor:function (color) {
|
||||||
this._setBackgroundColor(color, true);
|
this._setBackgroundColor(color, true);
|
||||||
},
|
},
|
||||||
|
|
||||||
_setBackgroundColor : function(color, updateModel) {
|
_setBackgroundColor:function (color, updateModel) {
|
||||||
var innerShape = this.getInnerShape();
|
var innerShape = this.getInnerShape();
|
||||||
innerShape.setFill(color);
|
innerShape.setFill(color);
|
||||||
|
|
||||||
@ -500,7 +500,7 @@ mindplot.Topic = new Class({
|
|||||||
}
|
}
|
||||||
},
|
},
|
||||||
|
|
||||||
getBackgroundColor : function() {
|
getBackgroundColor:function () {
|
||||||
var model = this.getModel();
|
var model = this.getModel();
|
||||||
var result = model.getBackgroundColor();
|
var result = model.getBackgroundColor();
|
||||||
if (!$defined(result)) {
|
if (!$defined(result)) {
|
||||||
@ -509,11 +509,11 @@ mindplot.Topic = new Class({
|
|||||||
return result;
|
return result;
|
||||||
},
|
},
|
||||||
|
|
||||||
setBorderColor : function(color) {
|
setBorderColor:function (color) {
|
||||||
this._setBorderColor(color, true);
|
this._setBorderColor(color, true);
|
||||||
},
|
},
|
||||||
|
|
||||||
_setBorderColor : function(color, updateModel) {
|
_setBorderColor:function (color, updateModel) {
|
||||||
var innerShape = this.getInnerShape();
|
var innerShape = this.getInnerShape();
|
||||||
innerShape.setAttribute('strokeColor', color);
|
innerShape.setAttribute('strokeColor', color);
|
||||||
|
|
||||||
@ -528,7 +528,7 @@ mindplot.Topic = new Class({
|
|||||||
}
|
}
|
||||||
},
|
},
|
||||||
|
|
||||||
getBorderColor : function() {
|
getBorderColor:function () {
|
||||||
var model = this.getModel();
|
var model = this.getModel();
|
||||||
var result = model.getBorderColor();
|
var result = model.getBorderColor();
|
||||||
if (!$defined(result)) {
|
if (!$defined(result)) {
|
||||||
@ -537,8 +537,8 @@ mindplot.Topic = new Class({
|
|||||||
return result;
|
return result;
|
||||||
},
|
},
|
||||||
|
|
||||||
_buildTopicShape : function() {
|
_buildTopicShape:function () {
|
||||||
var groupAttributes = {width: 100, height:100,coordSizeWidth:100,coordSizeHeight:100};
|
var groupAttributes = {width:100, height:100, coordSizeWidth:100, coordSizeHeight:100};
|
||||||
var group = new web2d.Group(groupAttributes);
|
var group = new web2d.Group(groupAttributes);
|
||||||
this._set2DElement(group);
|
this._set2DElement(group);
|
||||||
|
|
||||||
@ -567,15 +567,15 @@ mindplot.Topic = new Class({
|
|||||||
this._registerDefaultListenersToElement(group, this);
|
this._registerDefaultListenersToElement(group, this);
|
||||||
},
|
},
|
||||||
|
|
||||||
_registerDefaultListenersToElement : function(elem, topic) {
|
_registerDefaultListenersToElement:function (elem, topic) {
|
||||||
var mouseOver = function(event) {
|
var mouseOver = function (event) {
|
||||||
if (topic.isMouseEventsEnabled()) {
|
if (topic.isMouseEventsEnabled()) {
|
||||||
topic.handleMouseOver(event);
|
topic.handleMouseOver(event);
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
elem.addEvent('mouseover', mouseOver);
|
elem.addEvent('mouseover', mouseOver);
|
||||||
|
|
||||||
var outout = function(event) {
|
var outout = function (event) {
|
||||||
if (topic.isMouseEventsEnabled()) {
|
if (topic.isMouseEventsEnabled()) {
|
||||||
topic.handleMouseOut(event);
|
topic.handleMouseOut(event);
|
||||||
}
|
}
|
||||||
@ -583,7 +583,7 @@ mindplot.Topic = new Class({
|
|||||||
elem.addEvent('mouseout', outout);
|
elem.addEvent('mouseout', outout);
|
||||||
|
|
||||||
// Focus events ...
|
// Focus events ...
|
||||||
elem.addEvent('mousedown', function(event) {
|
elem.addEvent('mousedown', function (event) {
|
||||||
if (!this.isReadOnly()) {
|
if (!this.isReadOnly()) {
|
||||||
// Disable topic selection of readOnly mode ...
|
// Disable topic selection of readOnly mode ...
|
||||||
var value = true;
|
var value = true;
|
||||||
@ -602,12 +602,12 @@ mindplot.Topic = new Class({
|
|||||||
}.bind(this));
|
}.bind(this));
|
||||||
},
|
},
|
||||||
|
|
||||||
areChildrenShrunken : function() {
|
areChildrenShrunken:function () {
|
||||||
var model = this.getModel();
|
var model = this.getModel();
|
||||||
return model.areChildrenShrunken();
|
return model.areChildrenShrunken();
|
||||||
},
|
},
|
||||||
|
|
||||||
isCollapsed : function() {
|
isCollapsed:function () {
|
||||||
var result = false;
|
var result = false;
|
||||||
|
|
||||||
var current = this.getParent();
|
var current = this.getParent();
|
||||||
@ -618,7 +618,7 @@ mindplot.Topic = new Class({
|
|||||||
return result;
|
return result;
|
||||||
},
|
},
|
||||||
|
|
||||||
setChildrenShrunken : function(value) {
|
setChildrenShrunken:function (value) {
|
||||||
// Update Model ...
|
// Update Model ...
|
||||||
var model = this.getModel();
|
var model = this.getModel();
|
||||||
model.setChildrenShrunken(value);
|
model.setChildrenShrunken(value);
|
||||||
@ -632,7 +632,7 @@ mindplot.Topic = new Class({
|
|||||||
// Do some fancy animation ....
|
// Do some fancy animation ....
|
||||||
var elements = this._flatten2DElements(this);
|
var elements = this._flatten2DElements(this);
|
||||||
var fade = new mindplot.util.FadeEffect(elements, !value);
|
var fade = new mindplot.util.FadeEffect(elements, !value);
|
||||||
fade.addEvent('complete', function() {
|
fade.addEvent('complete', function () {
|
||||||
|
|
||||||
});
|
});
|
||||||
fade.start();
|
fade.start();
|
||||||
@ -640,7 +640,7 @@ mindplot.Topic = new Class({
|
|||||||
|
|
||||||
},
|
},
|
||||||
|
|
||||||
getShrinkConnector : function() {
|
getShrinkConnector:function () {
|
||||||
var result = this._connector;
|
var result = this._connector;
|
||||||
if (this._connector == null) {
|
if (this._connector == null) {
|
||||||
this._connector = new mindplot.ShirinkConnector(this);
|
this._connector = new mindplot.ShirinkConnector(this);
|
||||||
@ -651,28 +651,28 @@ mindplot.Topic = new Class({
|
|||||||
return result;
|
return result;
|
||||||
},
|
},
|
||||||
|
|
||||||
handleMouseOver : function() {
|
handleMouseOver:function () {
|
||||||
var outerShape = this.getOuterShape();
|
var outerShape = this.getOuterShape();
|
||||||
outerShape.setOpacity(1);
|
outerShape.setOpacity(1);
|
||||||
},
|
},
|
||||||
|
|
||||||
handleMouseOut : function() {
|
handleMouseOut:function () {
|
||||||
var outerShape = this.getOuterShape();
|
var outerShape = this.getOuterShape();
|
||||||
if (!this.isOnFocus()) {
|
if (!this.isOnFocus()) {
|
||||||
outerShape.setOpacity(0);
|
outerShape.setOpacity(0);
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
|
|
||||||
showTextEditor : function(text) {
|
showTextEditor:function (text) {
|
||||||
this._getTopicEventDispatcher().show(this, {text:text});
|
this._getTopicEventDispatcher().show(this, {text:text});
|
||||||
},
|
},
|
||||||
|
|
||||||
showNoteEditor : function() {
|
showNoteEditor:function () {
|
||||||
|
|
||||||
var topicId = this.getId();
|
var topicId = this.getId();
|
||||||
var model = this.getModel();
|
var model = this.getModel();
|
||||||
var editorModel = {
|
var editorModel = {
|
||||||
getValue : function() {
|
getValue:function () {
|
||||||
var notes = model.findFeatureByType(mindplot.TopicFeature.Note.id);
|
var notes = model.findFeatureByType(mindplot.TopicFeature.Note.id);
|
||||||
var result;
|
var result;
|
||||||
if (notes.length > 0)
|
if (notes.length > 0)
|
||||||
@ -681,7 +681,7 @@ mindplot.Topic = new Class({
|
|||||||
return result;
|
return result;
|
||||||
},
|
},
|
||||||
|
|
||||||
setValue : function(value) {
|
setValue:function (value) {
|
||||||
var dispatcher = mindplot.ActionDispatcher.getInstance();
|
var dispatcher = mindplot.ActionDispatcher.getInstance();
|
||||||
var notes = model.findFeatureByType(mindplot.TopicFeature.Note.id);
|
var notes = model.findFeatureByType(mindplot.TopicFeature.Note.id);
|
||||||
if (!$defined(value)) {
|
if (!$defined(value)) {
|
||||||
@ -703,12 +703,12 @@ mindplot.Topic = new Class({
|
|||||||
editor.show();
|
editor.show();
|
||||||
},
|
},
|
||||||
|
|
||||||
showLinkEditor : function() {
|
showLinkEditor:function () {
|
||||||
|
|
||||||
var topicId = this.getId();
|
var topicId = this.getId();
|
||||||
var model = this.getModel();
|
var model = this.getModel();
|
||||||
var editorModel = {
|
var editorModel = {
|
||||||
getValue : function() {
|
getValue:function () {
|
||||||
var links = model.findFeatureByType(mindplot.TopicFeature.Link.id);
|
var links = model.findFeatureByType(mindplot.TopicFeature.Link.id);
|
||||||
var result;
|
var result;
|
||||||
if (links.length > 0)
|
if (links.length > 0)
|
||||||
@ -717,7 +717,7 @@ mindplot.Topic = new Class({
|
|||||||
return result;
|
return result;
|
||||||
},
|
},
|
||||||
|
|
||||||
setValue : function(value) {
|
setValue:function (value) {
|
||||||
var dispatcher = mindplot.ActionDispatcher.getInstance();
|
var dispatcher = mindplot.ActionDispatcher.getInstance();
|
||||||
var links = model.findFeatureByType(mindplot.TopicFeature.Link.id);
|
var links = model.findFeatureByType(mindplot.TopicFeature.Link.id);
|
||||||
if (!$defined(value)) {
|
if (!$defined(value)) {
|
||||||
@ -740,18 +740,18 @@ mindplot.Topic = new Class({
|
|||||||
editor.show();
|
editor.show();
|
||||||
},
|
},
|
||||||
|
|
||||||
closeEditors : function() {
|
closeEditors:function () {
|
||||||
this._getTopicEventDispatcher().close(true);
|
this._getTopicEventDispatcher().close(true);
|
||||||
},
|
},
|
||||||
|
|
||||||
_getTopicEventDispatcher : function() {
|
_getTopicEventDispatcher:function () {
|
||||||
return mindplot.TopicEventDispatcher.getInstance();
|
return mindplot.TopicEventDispatcher.getInstance();
|
||||||
},
|
},
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Point: references the center of the rect shape.!!!
|
* Point: references the center of the rect shape.!!!
|
||||||
*/
|
*/
|
||||||
setPosition : function(point) {
|
setPosition:function (point) {
|
||||||
$assert(point, "position can not be null");
|
$assert(point, "position can not be null");
|
||||||
point.x = Math.ceil(point.x);
|
point.x = Math.ceil(point.x);
|
||||||
point.y = Math.ceil(point.y);
|
point.y = Math.ceil(point.y);
|
||||||
@ -777,11 +777,11 @@ mindplot.Topic = new Class({
|
|||||||
this.invariant();
|
this.invariant();
|
||||||
},
|
},
|
||||||
|
|
||||||
getOutgoingLine : function() {
|
getOutgoingLine:function () {
|
||||||
return this._outgoingLine;
|
return this._outgoingLine;
|
||||||
},
|
},
|
||||||
|
|
||||||
getIncomingLines : function() {
|
getIncomingLines:function () {
|
||||||
var result = [];
|
var result = [];
|
||||||
var children = this.getChildren();
|
var children = this.getChildren();
|
||||||
for (var i = 0; i < children.length; i++) {
|
for (var i = 0; i < children.length; i++) {
|
||||||
@ -794,7 +794,7 @@ mindplot.Topic = new Class({
|
|||||||
return result;
|
return result;
|
||||||
},
|
},
|
||||||
|
|
||||||
getOutgoingConnectedTopic : function() {
|
getOutgoingConnectedTopic:function () {
|
||||||
var result = null;
|
var result = null;
|
||||||
var line = this.getOutgoingLine();
|
var line = this.getOutgoingLine();
|
||||||
if ($defined(line)) {
|
if ($defined(line)) {
|
||||||
@ -803,7 +803,7 @@ mindplot.Topic = new Class({
|
|||||||
return result;
|
return result;
|
||||||
},
|
},
|
||||||
|
|
||||||
_updateConnectionLines : function() {
|
_updateConnectionLines:function () {
|
||||||
// Update this to parent line ...
|
// Update this to parent line ...
|
||||||
var outgoingLine = this.getOutgoingLine();
|
var outgoingLine = this.getOutgoingLine();
|
||||||
if ($defined(outgoingLine)) {
|
if ($defined(outgoingLine)) {
|
||||||
@ -822,7 +822,7 @@ mindplot.Topic = new Class({
|
|||||||
}
|
}
|
||||||
},
|
},
|
||||||
|
|
||||||
setBranchVisibility : function(value) {
|
setBranchVisibility:function (value) {
|
||||||
var current = this;
|
var current = this;
|
||||||
var parent = this;
|
var parent = this;
|
||||||
while (parent != null && parent.getType() != mindplot.model.INodeModel.CENTRAL_TOPIC_TYPE) {
|
while (parent != null && parent.getType() != mindplot.model.INodeModel.CENTRAL_TOPIC_TYPE) {
|
||||||
@ -833,7 +833,7 @@ mindplot.Topic = new Class({
|
|||||||
},
|
},
|
||||||
|
|
||||||
|
|
||||||
setVisibility : function(value) {
|
setVisibility:function (value) {
|
||||||
this._setTopicVisibility(value);
|
this._setTopicVisibility(value);
|
||||||
|
|
||||||
// Hide all children...
|
// Hide all children...
|
||||||
@ -842,7 +842,7 @@ mindplot.Topic = new Class({
|
|||||||
this._setRelationshipLinesVisibility(value);
|
this._setRelationshipLinesVisibility(value);
|
||||||
},
|
},
|
||||||
|
|
||||||
moveToBack : function() {
|
moveToBack:function () {
|
||||||
|
|
||||||
// Update relationship lines
|
// Update relationship lines
|
||||||
for (var j = 0; j < this._relationships.length; j++) {
|
for (var j = 0; j < this._relationships.length; j++) {
|
||||||
@ -856,7 +856,7 @@ mindplot.Topic = new Class({
|
|||||||
this.get2DElement().moveToBack();
|
this.get2DElement().moveToBack();
|
||||||
},
|
},
|
||||||
|
|
||||||
moveToFront : function() {
|
moveToFront:function () {
|
||||||
|
|
||||||
this.get2DElement().moveToFront();
|
this.get2DElement().moveToFront();
|
||||||
var connector = this.getShrinkConnector();
|
var connector = this.getShrinkConnector();
|
||||||
@ -869,18 +869,18 @@ mindplot.Topic = new Class({
|
|||||||
}
|
}
|
||||||
},
|
},
|
||||||
|
|
||||||
isVisible : function() {
|
isVisible:function () {
|
||||||
var elem = this.get2DElement();
|
var elem = this.get2DElement();
|
||||||
return elem.isVisible();
|
return elem.isVisible();
|
||||||
},
|
},
|
||||||
|
|
||||||
_setRelationshipLinesVisibility : function(value) {
|
_setRelationshipLinesVisibility:function (value) {
|
||||||
this._relationships.forEach(function(relationship) {
|
this._relationships.forEach(function (relationship) {
|
||||||
relationship.setVisibility(value);
|
relationship.setVisibility(value);
|
||||||
});
|
});
|
||||||
},
|
},
|
||||||
|
|
||||||
_setTopicVisibility : function(value) {
|
_setTopicVisibility:function (value) {
|
||||||
var elem = this.get2DElement();
|
var elem = this.get2DElement();
|
||||||
elem.setVisibility(value);
|
elem.setVisibility(value);
|
||||||
|
|
||||||
@ -895,7 +895,7 @@ mindplot.Topic = new Class({
|
|||||||
textShape.setVisibility(this.getShapeType() != mindplot.model.TopicShape.IMAGE ? value : false);
|
textShape.setVisibility(this.getShapeType() != mindplot.model.TopicShape.IMAGE ? value : false);
|
||||||
},
|
},
|
||||||
|
|
||||||
setOpacity : function(opacity) {
|
setOpacity:function (opacity) {
|
||||||
var elem = this.get2DElement();
|
var elem = this.get2DElement();
|
||||||
elem.setOpacity(opacity);
|
elem.setOpacity(opacity);
|
||||||
|
|
||||||
@ -907,7 +907,7 @@ mindplot.Topic = new Class({
|
|||||||
textShape.setOpacity(opacity);
|
textShape.setOpacity(opacity);
|
||||||
},
|
},
|
||||||
|
|
||||||
_setChildrenVisibility : function(isVisible) {
|
_setChildrenVisibility:function (isVisible) {
|
||||||
|
|
||||||
// Hide all children.
|
// Hide all children.
|
||||||
var children = this.getChildren();
|
var children = this.getChildren();
|
||||||
@ -924,7 +924,7 @@ mindplot.Topic = new Class({
|
|||||||
|
|
||||||
},
|
},
|
||||||
|
|
||||||
invariant : function() {
|
invariant:function () {
|
||||||
var line = this._outgoingLine;
|
var line = this._outgoingLine;
|
||||||
var model = this.getModel();
|
var model = this.getModel();
|
||||||
var isConnected = model.isConnected();
|
var isConnected = model.isConnected();
|
||||||
@ -936,10 +936,10 @@ mindplot.Topic = new Class({
|
|||||||
},
|
},
|
||||||
|
|
||||||
|
|
||||||
setSize : function(size, force) {
|
setSize:function (size, force) {
|
||||||
$assert(size, "size can not be null");
|
$assert(size, "size can not be null");
|
||||||
$assert($defined(size.width), "size seem not to be a valid element");
|
$assert($defined(size.width), "size seem not to be a valid element");
|
||||||
size = {width:Math.ceil(size.width),height: Math.ceil(size.height)};
|
size = {width:Math.ceil(size.width), height:Math.ceil(size.height)};
|
||||||
|
|
||||||
var oldSize = this.getSize();
|
var oldSize = this.getSize();
|
||||||
var hasSizeChanged = oldSize.width != size.width || oldSize.height != size.height;
|
var hasSizeChanged = oldSize.width != size.width || oldSize.height != size.height;
|
||||||
@ -956,16 +956,16 @@ mindplot.Topic = new Class({
|
|||||||
this._updatePositionOnChangeSize(oldSize, size);
|
this._updatePositionOnChangeSize(oldSize, size);
|
||||||
|
|
||||||
if (hasSizeChanged) {
|
if (hasSizeChanged) {
|
||||||
mindplot.EventBus.instance.fireEvent(mindplot.EventBus.events.NodeResizeEvent, {node:this.getModel(),size:size});
|
mindplot.EventBus.instance.fireEvent(mindplot.EventBus.events.NodeResizeEvent, {node:this.getModel(), size:size});
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
|
|
||||||
_updatePositionOnChangeSize : function() {
|
_updatePositionOnChangeSize:function () {
|
||||||
$assert(false, "this method must be overwrited.");
|
$assert(false, "this method must be overwrited.");
|
||||||
},
|
},
|
||||||
|
|
||||||
disconnect : function(workspace) {
|
disconnect:function (workspace) {
|
||||||
var outgoingLine = this.getOutgoingLine();
|
var outgoingLine = this.getOutgoingLine();
|
||||||
if ($defined(outgoingLine)) {
|
if ($defined(outgoingLine)) {
|
||||||
$assert(workspace, 'workspace can not be null');
|
$assert(workspace, 'workspace can not be null');
|
||||||
@ -1009,17 +1009,17 @@ mindplot.Topic = new Class({
|
|||||||
}
|
}
|
||||||
},
|
},
|
||||||
|
|
||||||
getOrder : function() {
|
getOrder:function () {
|
||||||
var model = this.getModel();
|
var model = this.getModel();
|
||||||
return model.getOrder();
|
return model.getOrder();
|
||||||
},
|
},
|
||||||
|
|
||||||
setOrder : function(value) {
|
setOrder:function (value) {
|
||||||
var model = this.getModel();
|
var model = this.getModel();
|
||||||
model.setOrder(value);
|
model.setOrder(value);
|
||||||
},
|
},
|
||||||
|
|
||||||
connectTo : function(targetTopic, workspace, isVisible) {
|
connectTo:function (targetTopic, workspace, isVisible) {
|
||||||
$assert(!this._outgoingLine, 'Could not connect an already connected node');
|
$assert(!this._outgoingLine, 'Could not connect an already connected node');
|
||||||
$assert(targetTopic != this, 'Cilcular connection are not allowed');
|
$assert(targetTopic != this, 'Cilcular connection are not allowed');
|
||||||
$assert(targetTopic, 'Parent Graph can not be null');
|
$assert(targetTopic, 'Parent Graph can not be null');
|
||||||
@ -1068,22 +1068,22 @@ mindplot.Topic = new Class({
|
|||||||
|
|
||||||
// Fire connection event ...
|
// Fire connection event ...
|
||||||
if (this.isInWorkspace()) {
|
if (this.isInWorkspace()) {
|
||||||
mindplot.EventBus.instance.fireEvent(mindplot.EventBus.events.NodeConnectEvent, {parentNode:targetTopic.getModel(), childNode: this.getModel()});
|
mindplot.EventBus.instance.fireEvent(mindplot.EventBus.events.NodeConnectEvent, {parentNode:targetTopic.getModel(), childNode:this.getModel()});
|
||||||
}
|
}
|
||||||
|
|
||||||
},
|
},
|
||||||
|
|
||||||
appendChild : function(child) {
|
appendChild:function (child) {
|
||||||
var children = this.getChildren();
|
var children = this.getChildren();
|
||||||
children.push(child);
|
children.push(child);
|
||||||
},
|
},
|
||||||
|
|
||||||
removeChild : function(child) {
|
removeChild:function (child) {
|
||||||
var children = this.getChildren();
|
var children = this.getChildren();
|
||||||
children.erase(child);
|
children.erase(child);
|
||||||
},
|
},
|
||||||
|
|
||||||
getChildren : function() {
|
getChildren:function () {
|
||||||
var result = this._children;
|
var result = this._children;
|
||||||
if (!$defined(result)) {
|
if (!$defined(result)) {
|
||||||
this._children = [];
|
this._children = [];
|
||||||
@ -1092,7 +1092,7 @@ mindplot.Topic = new Class({
|
|||||||
return result;
|
return result;
|
||||||
},
|
},
|
||||||
|
|
||||||
removeFromWorkspace : function(workspace) {
|
removeFromWorkspace:function (workspace) {
|
||||||
var elem2d = this.get2DElement();
|
var elem2d = this.get2DElement();
|
||||||
workspace.removeChild(elem2d);
|
workspace.removeChild(elem2d);
|
||||||
var line = this.getOutgoingLine();
|
var line = this.getOutgoingLine();
|
||||||
@ -1103,7 +1103,7 @@ mindplot.Topic = new Class({
|
|||||||
mindplot.EventBus.instance.fireEvent(mindplot.EventBus.events.NodeRemoved, this.getModel());
|
mindplot.EventBus.instance.fireEvent(mindplot.EventBus.events.NodeRemoved, this.getModel());
|
||||||
},
|
},
|
||||||
|
|
||||||
addToWorkspace : function(workspace) {
|
addToWorkspace:function (workspace) {
|
||||||
var elem = this.get2DElement();
|
var elem = this.get2DElement();
|
||||||
workspace.appendChild(elem);
|
workspace.appendChild(elem);
|
||||||
if (!this.isInWorkspace()) {
|
if (!this.isInWorkspace()) {
|
||||||
@ -1112,18 +1112,18 @@ mindplot.Topic = new Class({
|
|||||||
}
|
}
|
||||||
|
|
||||||
if (this.getModel().isConnected())
|
if (this.getModel().isConnected())
|
||||||
mindplot.EventBus.instance.fireEvent(mindplot.EventBus.events.NodeConnectEvent, {parentNode:this.getOutgoingConnectedTopic().getModel(), childNode: this.getModel()});
|
mindplot.EventBus.instance.fireEvent(mindplot.EventBus.events.NodeConnectEvent, {parentNode:this.getOutgoingConnectedTopic().getModel(), childNode:this.getModel()});
|
||||||
|
|
||||||
}
|
}
|
||||||
this._isInWorkspace = true;
|
this._isInWorkspace = true;
|
||||||
this._adjustShapes();
|
this._adjustShapes();
|
||||||
},
|
},
|
||||||
|
|
||||||
isInWorkspace : function() {
|
isInWorkspace:function () {
|
||||||
return this._isInWorkspace;
|
return this._isInWorkspace;
|
||||||
},
|
},
|
||||||
|
|
||||||
createDragNode : function(layoutManager) {
|
createDragNode:function (layoutManager) {
|
||||||
var result = this.parent(layoutManager);
|
var result = this.parent(layoutManager);
|
||||||
|
|
||||||
// Is the node already connected ?
|
// Is the node already connected ?
|
||||||
@ -1139,7 +1139,7 @@ mindplot.Topic = new Class({
|
|||||||
return result;
|
return result;
|
||||||
},
|
},
|
||||||
|
|
||||||
_adjustShapes : function() {
|
_adjustShapes:function () {
|
||||||
if (this._isInWorkspace) {
|
if (this._isInWorkspace) {
|
||||||
|
|
||||||
var textShape = this.getTextShape();
|
var textShape = this.getTextShape();
|
||||||
@ -1168,7 +1168,7 @@ mindplot.Topic = new Class({
|
|||||||
var height = textHeight + (topicPadding * 2);
|
var height = textHeight + (topicPadding * 2);
|
||||||
var width = textWidth + iconsWidth + (topicPadding * 2);
|
var width = textWidth + iconsWidth + (topicPadding * 2);
|
||||||
|
|
||||||
this.setSize({width:width,height:height});
|
this.setSize({width:width, height:height});
|
||||||
|
|
||||||
// Position node ...
|
// Position node ...
|
||||||
textShape.setPosition(topicPadding + iconsWidth, topicPadding);
|
textShape.setPosition(topicPadding + iconsWidth, topicPadding);
|
||||||
@ -1180,7 +1180,7 @@ mindplot.Topic = new Class({
|
|||||||
}
|
}
|
||||||
},
|
},
|
||||||
|
|
||||||
_flatten2DElements : function(topic) {
|
_flatten2DElements:function (topic) {
|
||||||
var result = [];
|
var result = [];
|
||||||
|
|
||||||
var children = topic.getChildren();
|
var children = topic.getChildren();
|
||||||
@ -1203,8 +1203,8 @@ mindplot.Topic = new Class({
|
|||||||
|
|
||||||
|
|
||||||
mindplot.Topic.CONNECTOR_WIDTH = 6;
|
mindplot.Topic.CONNECTOR_WIDTH = 6;
|
||||||
mindplot.Topic.OUTER_SHAPE_ATTRIBUTES = {fillColor:'rgb(252,235,192)',stroke:'1 dot rgb(241,163,39)',x:0,y:0};
|
mindplot.Topic.OUTER_SHAPE_ATTRIBUTES = {fillColor:'rgb(252,235,192)', stroke:'1 dot rgb(241,163,39)', x:0, y:0};
|
||||||
mindplot.Topic.OUTER_SHAPE_ATTRIBUTES_FOCUS = {fillColor:'rgb(244,184,45)',x:0,y:0};
|
mindplot.Topic.OUTER_SHAPE_ATTRIBUTES_FOCUS = {fillColor:'rgb(244,184,45)', x:0, y:0};
|
||||||
mindplot.Topic.INNER_RECT_ATTRIBUTES = {stroke:'2 solid'};
|
mindplot.Topic.INNER_RECT_ATTRIBUTES = {stroke:'2 solid'};
|
||||||
|
|
||||||
|
|
||||||
|
@ -41,15 +41,14 @@ mindplot.TopicFeature = {
|
|||||||
});
|
});
|
||||||
},
|
},
|
||||||
|
|
||||||
createModel : function(id, topic, attributes) {
|
createModel : function(id, attributes) {
|
||||||
$assert(id, 'type can not be null');
|
$assert(id, 'type can not be null');
|
||||||
$assert(topic, 'topic can not be null');
|
|
||||||
$assert(attributes, 'attributes can not be null');
|
$assert(attributes, 'attributes can not be null');
|
||||||
|
|
||||||
var model = mindplot.TopicFeature._featuresMetadataById.filter(function(elem) {
|
var model = mindplot.TopicFeature._featuresMetadataById.filter(function(elem) {
|
||||||
return elem.id == id;
|
return elem.id == id;
|
||||||
})[0].model;
|
})[0].model;
|
||||||
return new model(topic, attributes);
|
return new model(attributes);
|
||||||
},
|
},
|
||||||
|
|
||||||
createIcon : function(topic, model) {
|
createIcon : function(topic, model) {
|
||||||
|
@ -62,7 +62,7 @@ mindplot.collaboration.framework.brix.model.NodeModel = new Class({
|
|||||||
var model = new mindplot.model.NodeModel(cmodel.getType(), designer.getMindmap(), this.getId());
|
var model = new mindplot.model.NodeModel(cmodel.getType(), designer.getMindmap(), this.getId());
|
||||||
cmodel.copyTo(model);
|
cmodel.copyTo(model);
|
||||||
|
|
||||||
actionDispatcher.addTopic(model, this.getId(), true);
|
actionDispatcher.addTopics([model], [this.getId()]);
|
||||||
}
|
}
|
||||||
} catch(e) {
|
} catch(e) {
|
||||||
console.trace();
|
console.trace();
|
||||||
|
@ -18,39 +18,49 @@
|
|||||||
|
|
||||||
mindplot.commands.AddTopicCommand = new Class({
|
mindplot.commands.AddTopicCommand = new Class({
|
||||||
Extends:mindplot.Command,
|
Extends:mindplot.Command,
|
||||||
initialize: function(model, parentTopicId) {
|
initialize:function (models, parentTopicsId) {
|
||||||
$assert(model, 'Model can not be null');
|
$assert(models, 'models can not be null');
|
||||||
|
$assert(parentTopicsId == null || parentTopicsId.length == models.length, 'parents and models must have the same size');
|
||||||
|
|
||||||
this.parent();
|
this.parent();
|
||||||
this._model = model;
|
this._models = models;
|
||||||
this._parentId = parentTopicId;
|
this._parentsIds = parentTopicsId;
|
||||||
},
|
},
|
||||||
|
|
||||||
execute: function(commandContext) {
|
execute:function (commandContext) {
|
||||||
|
|
||||||
// Add a new topic ...
|
this._models.forEach(function (model, index) {
|
||||||
var topic = commandContext.createTopic(this._model, false);
|
|
||||||
|
|
||||||
// Connect to topic ...
|
// Add a new topic ...
|
||||||
if ($defined(this._parentId)) {
|
var topic = commandContext.createTopic(model, false);
|
||||||
var parentTopic = commandContext.findTopics(this._parentId)[0];
|
|
||||||
commandContext.connect(topic, parentTopic);
|
|
||||||
}
|
|
||||||
|
|
||||||
// Finally, focus ...
|
// Connect to topic ...
|
||||||
var designer = commandContext._designer;
|
if (this._parentsIds) {
|
||||||
var fade = new mindplot.util.FadeEffect([topic,topic.getOutgoingLine()], true);
|
var parentId = this._parentsIds[index];
|
||||||
fade.addEvent('complete', function() {
|
if ($defined(parentId)) {
|
||||||
designer.onObjectFocusEvent(topic);
|
var parentTopic = commandContext.findTopics(parentId)[0];
|
||||||
topic.setOnFocus(true);
|
commandContext.connect(topic, parentTopic);
|
||||||
});
|
}
|
||||||
fade.start();
|
}
|
||||||
|
|
||||||
|
// Finally, focus ...
|
||||||
|
var designer = commandContext._designer;
|
||||||
|
var fade = new mindplot.util.FadeEffect([topic, topic.getOutgoingLine()], true);
|
||||||
|
fade.addEvent('complete', function () {
|
||||||
|
designer.onObjectFocusEvent(topic);
|
||||||
|
topic.setOnFocus(true);
|
||||||
|
});
|
||||||
|
fade.start();
|
||||||
|
}.bind(this));
|
||||||
},
|
},
|
||||||
|
|
||||||
undoExecute: function(commandContext) {
|
undoExecute:function (commandContext) {
|
||||||
// Finally, delete the topic from the workspace ...
|
// Finally, delete the topic from the workspace ...
|
||||||
var topicId = this._model.getId();
|
this._models.forEach(function (model) {
|
||||||
var topic = commandContext.findTopics(topicId)[0];
|
|
||||||
commandContext.deleteTopic(topic);
|
var topicId = model.getId();
|
||||||
|
var topic = commandContext.findTopics(topicId)[0];
|
||||||
|
commandContext.deleteTopic(topic);
|
||||||
|
}.bind(this));
|
||||||
}
|
}
|
||||||
});
|
});
|
@ -17,13 +17,11 @@
|
|||||||
*/
|
*/
|
||||||
|
|
||||||
mindplot.model.FeatureModel = new Class({
|
mindplot.model.FeatureModel = new Class({
|
||||||
initialize:function(type, topic) {
|
initialize:function(type) {
|
||||||
$assert(type, 'type can not be null');
|
$assert(type, 'type can not be null');
|
||||||
$assert(topic, 'topic can not be null');
|
|
||||||
|
|
||||||
this._id = mindplot.model.FeatureModel._nextUUID();
|
this._id = mindplot.model.FeatureModel._nextUUID();
|
||||||
this._type = type;
|
this._type = type;
|
||||||
this._topic = topic;
|
|
||||||
this._attributes = {};
|
this._attributes = {};
|
||||||
|
|
||||||
// Create type method ...
|
// Create type method ...
|
||||||
@ -53,10 +51,6 @@ mindplot.model.FeatureModel = new Class({
|
|||||||
return this._attributes[key];
|
return this._attributes[key];
|
||||||
},
|
},
|
||||||
|
|
||||||
getTopic : function() {
|
|
||||||
return this._topic;
|
|
||||||
},
|
|
||||||
|
|
||||||
getId : function() {
|
getId : function() {
|
||||||
return this._id;
|
return this._id;
|
||||||
},
|
},
|
||||||
|
@ -56,7 +56,7 @@ mindplot.model.INodeModel = new Class({
|
|||||||
|
|
||||||
setPosition : function(x, y) {
|
setPosition : function(x, y) {
|
||||||
$assert(!isNaN(parseInt(x)), "x position is not valid:" + x);
|
$assert(!isNaN(parseInt(x)), "x position is not valid:" + x);
|
||||||
$assert(!isNaN(parseInt(y)), "x position is not valid:" + y);
|
$assert(!isNaN(parseInt(y)), "y position is not valid:" + y);
|
||||||
this.putProperty('position', '{x:' + parseInt(x) + ',y:' + parseInt(y) + '}');
|
this.putProperty('position', '{x:' + parseInt(x) + ',y:' + parseInt(y) + '}');
|
||||||
},
|
},
|
||||||
|
|
||||||
|
@ -18,8 +18,8 @@
|
|||||||
|
|
||||||
mindplot.model.IconModel = new Class({
|
mindplot.model.IconModel = new Class({
|
||||||
Extends: mindplot.model.FeatureModel,
|
Extends: mindplot.model.FeatureModel,
|
||||||
initialize:function(topic, attributes) {
|
initialize:function(attributes) {
|
||||||
this.parent(mindplot.model.IconModel.FEATURE_TYPE, topic);
|
this.parent(mindplot.model.IconModel.FEATURE_TYPE);
|
||||||
this.setIconType(attributes.id);
|
this.setIconType(attributes.id);
|
||||||
},
|
},
|
||||||
|
|
||||||
|
@ -18,8 +18,8 @@
|
|||||||
|
|
||||||
mindplot.model.LinkModel = new Class({
|
mindplot.model.LinkModel = new Class({
|
||||||
Extends: mindplot.model.FeatureModel,
|
Extends: mindplot.model.FeatureModel,
|
||||||
initialize : function(topic, attributes) {
|
initialize : function(attributes) {
|
||||||
this.parent(mindplot.model.LinkModel.FEATURE_TYPE, topic);
|
this.parent(mindplot.model.LinkModel.FEATURE_TYPE);
|
||||||
this.setUrl(attributes.url);
|
this.setUrl(attributes.url);
|
||||||
},
|
},
|
||||||
|
|
||||||
|
@ -17,8 +17,8 @@
|
|||||||
*/
|
*/
|
||||||
|
|
||||||
mindplot.model.NodeModel = new Class({
|
mindplot.model.NodeModel = new Class({
|
||||||
Extends: mindplot.model.INodeModel,
|
Extends:mindplot.model.INodeModel,
|
||||||
initialize:function(type, mindmap, id) {
|
initialize:function (type, mindmap, id) {
|
||||||
$assert(type, 'Node type can not be null');
|
$assert(type, 'Node type can not be null');
|
||||||
$assert(mindmap, 'mindmap can not be null');
|
$assert(mindmap, 'mindmap can not be null');
|
||||||
this._properties = {};
|
this._properties = {};
|
||||||
@ -32,61 +32,61 @@ mindplot.model.NodeModel = new Class({
|
|||||||
this._feature = [];
|
this._feature = [];
|
||||||
},
|
},
|
||||||
|
|
||||||
createFeature: function(type, attributes) {
|
createFeature:function (type, attributes) {
|
||||||
return mindplot.TopicFeature.createModel(type, this, attributes);
|
return mindplot.TopicFeature.createModel(type, attributes);
|
||||||
},
|
},
|
||||||
|
|
||||||
addFeature: function(feature) {
|
addFeature:function (feature) {
|
||||||
$assert(feature, 'feature can not be null');
|
$assert(feature, 'feature can not be null');
|
||||||
this._feature.push(feature);
|
this._feature.push(feature);
|
||||||
},
|
},
|
||||||
|
|
||||||
getFeatures: function() {
|
getFeatures:function () {
|
||||||
return this._feature;
|
return this._feature;
|
||||||
},
|
},
|
||||||
|
|
||||||
removeFeature: function(feature) {
|
removeFeature:function (feature) {
|
||||||
$assert(feature, 'feature can not be null');
|
$assert(feature, 'feature can not be null');
|
||||||
this._feature.erase(feature);
|
this._feature.erase(feature);
|
||||||
},
|
},
|
||||||
|
|
||||||
findFeatureByType : function(type) {
|
findFeatureByType:function (type) {
|
||||||
$assert(type, 'type can not be null');
|
$assert(type, 'type can not be null');
|
||||||
return this._feature.filter(function(feature) {
|
return this._feature.filter(function (feature) {
|
||||||
return feature.getType() == type;
|
return feature.getType() == type;
|
||||||
});
|
});
|
||||||
},
|
},
|
||||||
|
|
||||||
findFeatureById : function(id) {
|
findFeatureById:function (id) {
|
||||||
$assert($defined(id), 'id can not be null');
|
$assert($defined(id), 'id can not be null');
|
||||||
return this._feature.filter(function(feature) {
|
return this._feature.filter(function (feature) {
|
||||||
return feature.getId() == id;
|
return feature.getId() == id;
|
||||||
})[0];
|
})[0];
|
||||||
},
|
},
|
||||||
|
|
||||||
getPropertiesKeys : function() {
|
getPropertiesKeys:function () {
|
||||||
return Object.keys(this._properties);
|
return Object.keys(this._properties);
|
||||||
},
|
},
|
||||||
|
|
||||||
putProperty : function(key, value) {
|
putProperty:function (key, value) {
|
||||||
$defined(key, 'key can not be null');
|
$defined(key, 'key can not be null');
|
||||||
this._properties[key] = value;
|
this._properties[key] = value;
|
||||||
},
|
},
|
||||||
|
|
||||||
|
|
||||||
getProperties: function() {
|
getProperties:function () {
|
||||||
return this._properties;
|
return this._properties;
|
||||||
},
|
},
|
||||||
|
|
||||||
getProperty : function(key) {
|
getProperty:function (key) {
|
||||||
$defined(key, 'key can not be null');
|
$defined(key, 'key can not be null');
|
||||||
var result = this._properties[key];
|
var result = this._properties[key];
|
||||||
return !$defined(result) ? null : result;
|
return !$defined(result) ? null : result;
|
||||||
},
|
},
|
||||||
|
|
||||||
clone : function() {
|
clone:function () {
|
||||||
var result = new mindplot.model.NodeModel(this.getType(), this._mindmap);
|
var result = new mindplot.model.NodeModel(this.getType(), this._mindmap);
|
||||||
result._children = this._children.map(function(node) {
|
result._children = this._children.map(function (node) {
|
||||||
var cnode = node.clone();
|
var cnode = node.clone();
|
||||||
cnode._parent = result;
|
cnode._parent = result;
|
||||||
return cnode;
|
return cnode;
|
||||||
@ -97,32 +97,52 @@ mindplot.model.NodeModel = new Class({
|
|||||||
return result;
|
return result;
|
||||||
},
|
},
|
||||||
|
|
||||||
appendChild : function(child) {
|
/**
|
||||||
|
* Similar to clone, assign new id to the elements ...
|
||||||
|
* @return {mindplot.model.NodeModel}
|
||||||
|
*/
|
||||||
|
deepCopy:function () {
|
||||||
|
var result = new mindplot.model.NodeModel(this.getType(), this._mindmap);
|
||||||
|
result._children = this._children.map(function (node) {
|
||||||
|
var cnode = node.deepCopy();
|
||||||
|
cnode._parent = result;
|
||||||
|
return cnode;
|
||||||
|
});
|
||||||
|
|
||||||
|
var id = result.getId();
|
||||||
|
result._properties = Object.clone(this._properties);
|
||||||
|
result.setId(id);
|
||||||
|
|
||||||
|
result._feature = this._feature.clone();
|
||||||
|
return result;
|
||||||
|
},
|
||||||
|
|
||||||
|
appendChild:function (child) {
|
||||||
$assert(child && child.isNodeModel(), 'Only NodeModel can be appended to Mindmap object');
|
$assert(child && child.isNodeModel(), 'Only NodeModel can be appended to Mindmap object');
|
||||||
this._children.push(child);
|
this._children.push(child);
|
||||||
child._parent = this;
|
child._parent = this;
|
||||||
},
|
},
|
||||||
|
|
||||||
removeChild : function(child) {
|
removeChild:function (child) {
|
||||||
$assert(child && child.isNodeModel(), 'Only NodeModel can be appended to Mindmap object.');
|
$assert(child && child.isNodeModel(), 'Only NodeModel can be appended to Mindmap object.');
|
||||||
this._children.erase(child);
|
this._children.erase(child);
|
||||||
child._parent = null;
|
child._parent = null;
|
||||||
},
|
},
|
||||||
|
|
||||||
getChildren : function() {
|
getChildren:function () {
|
||||||
return this._children;
|
return this._children;
|
||||||
},
|
},
|
||||||
|
|
||||||
getParent : function() {
|
getParent:function () {
|
||||||
return this._parent;
|
return this._parent;
|
||||||
},
|
},
|
||||||
|
|
||||||
setParent : function(parent) {
|
setParent:function (parent) {
|
||||||
$assert(parent != this, 'The same node can not be parent and child if itself.');
|
$assert(parent != this, 'The same node can not be parent and child if itself.');
|
||||||
this._parent = parent;
|
this._parent = parent;
|
||||||
},
|
},
|
||||||
|
|
||||||
canBeConnected : function(sourceModel, sourcePosition, targetTopicHeight,targetTopicSize) {
|
canBeConnected:function (sourceModel, sourcePosition, targetTopicHeight, targetTopicSize) {
|
||||||
$assert(sourceModel != this, 'The same node can not be parent and child if itself.');
|
$assert(sourceModel != this, 'The same node can not be parent and child if itself.');
|
||||||
$assert(sourcePosition, 'childPosition can not be null.');
|
$assert(sourcePosition, 'childPosition can not be null.');
|
||||||
$assert(targetTopicHeight, 'childrenWidth can not be null.');
|
$assert(targetTopicHeight, 'childrenWidth can not be null.');
|
||||||
@ -169,7 +189,7 @@ mindplot.model.NodeModel = new Class({
|
|||||||
return result;
|
return result;
|
||||||
},
|
},
|
||||||
|
|
||||||
_isChildNode : function(node) {
|
_isChildNode:function (node) {
|
||||||
var result = false;
|
var result = false;
|
||||||
if (node == this) {
|
if (node == this) {
|
||||||
result = true;
|
result = true;
|
||||||
@ -186,7 +206,7 @@ mindplot.model.NodeModel = new Class({
|
|||||||
return result;
|
return result;
|
||||||
},
|
},
|
||||||
|
|
||||||
findNodeById : function(id) {
|
findNodeById:function (id) {
|
||||||
var result = null;
|
var result = null;
|
||||||
if (this.getId() == id) {
|
if (this.getId() == id) {
|
||||||
result = this;
|
result = this;
|
||||||
|
@ -18,8 +18,8 @@
|
|||||||
|
|
||||||
mindplot.model.NoteModel = new Class({
|
mindplot.model.NoteModel = new Class({
|
||||||
Extends: mindplot.model.FeatureModel,
|
Extends: mindplot.model.FeatureModel,
|
||||||
initialize : function(topic, attributes) {
|
initialize : function(attributes) {
|
||||||
this.parent(mindplot.model.NoteModel.FEATURE_TYPE, topic);
|
this.parent(mindplot.model.NoteModel.FEATURE_TYPE);
|
||||||
this.setText(attributes.text);
|
this.setText(attributes.text);
|
||||||
},
|
},
|
||||||
|
|
||||||
|
@ -351,7 +351,7 @@ mindplot.persistence.XMLSerializer_Pela = new Class({
|
|||||||
|
|
||||||
// Create a new element ....
|
// Create a new element ....
|
||||||
var featureType = child.tagName;
|
var featureType = child.tagName;
|
||||||
var feature = mindplot.TopicFeature.createModel(featureType, topic, attributes);
|
var feature = mindplot.TopicFeature.createModel(featureType, attributes);
|
||||||
topic.addFeature(feature);
|
topic.addFeature(feature);
|
||||||
|
|
||||||
} else if (child.tagName == "text") {
|
} else if (child.tagName == "text") {
|
||||||
@ -411,7 +411,7 @@ mindplot.persistence.XMLSerializer_Pela = new Class({
|
|||||||
return null;
|
return null;
|
||||||
}
|
}
|
||||||
// Is the connections points valid ?. If it's not, do not load the relationship ...
|
// Is the connections points valid ?. If it's not, do not load the relationship ...
|
||||||
if (mindmap.findNodeById(srcId) == null || mindmap.findNodeById(destId)==null) {
|
if (mindmap.findNodeById(srcId) == null || mindmap.findNodeById(destId) == null) {
|
||||||
return null;
|
return null;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -17,20 +17,20 @@
|
|||||||
*/
|
*/
|
||||||
|
|
||||||
mindplot.widget.IconPanel = new Class({
|
mindplot.widget.IconPanel = new Class({
|
||||||
Extends: mindplot.widget.ToolbarPaneItem,
|
Extends:mindplot.widget.ToolbarPaneItem,
|
||||||
initialize : function(buttonId, model) {
|
initialize:function (buttonId, model) {
|
||||||
this.parent(buttonId, model);
|
this.parent(buttonId, model);
|
||||||
},
|
},
|
||||||
|
|
||||||
_updateSelectedItem : function() {
|
_updateSelectedItem:function () {
|
||||||
return this.getPanelElem();
|
return this.getPanelElem();
|
||||||
|
|
||||||
},
|
},
|
||||||
|
|
||||||
buildPanel: function() {
|
buildPanel:function () {
|
||||||
var content = new Element('div', {'class':'toolbarPanel','id':'IconsPanel'});
|
var content = new Element('div', {'class':'toolbarPanel', 'id':'IconsPanel'});
|
||||||
content.setStyles({width:253,height:210,padding:5});
|
content.setStyles({width:253, height:210, padding:5});
|
||||||
content.addEvent("click", function(event) {
|
content.addEvent("click", function (event) {
|
||||||
event.stopPropagation()
|
event.stopPropagation()
|
||||||
});
|
});
|
||||||
|
|
||||||
@ -52,12 +52,12 @@ mindplot.widget.IconPanel = new Class({
|
|||||||
img.setStyles({width:16,
|
img.setStyles({width:16,
|
||||||
height:16,
|
height:16,
|
||||||
padding:"0px 2px",
|
padding:"0px 2px",
|
||||||
cursor: 'pointer'
|
cursor:'pointer'
|
||||||
}).inject(familyContent);
|
}).inject(familyContent);
|
||||||
|
|
||||||
var panel = this;
|
var panel = this;
|
||||||
var model = this.getModel();
|
var model = this.getModel();
|
||||||
img.addEvent('click', function(event) {
|
img.addEvent('click', function (event) {
|
||||||
model.setValue(this.id);
|
model.setValue(this.id);
|
||||||
panel.hide();
|
panel.hide();
|
||||||
}.bind(img));
|
}.bind(img));
|
||||||
|
@ -251,10 +251,10 @@ mindplot.widget.Menu = new Class({
|
|||||||
this._registerTooltip('redoEdition', $msg('REDO'), "meta+shift+Z");
|
this._registerTooltip('redoEdition', $msg('REDO'), "meta+shift+Z");
|
||||||
|
|
||||||
|
|
||||||
this._addButton('addTopic', true, false, function () {
|
this._addButton('addTopics', true, false, function () {
|
||||||
designer.createChildForSelectedNode();
|
designer.createChildForSelectedNode();
|
||||||
});
|
});
|
||||||
this._registerTooltip('addTopic', $msg('ADD_TOPIC'), "Enter");
|
this._registerTooltip('addTopics', $msg('ADD_TOPIC'), "Enter");
|
||||||
|
|
||||||
|
|
||||||
this._addButton('deleteTopic', true, true, function () {
|
this._addButton('deleteTopic', true, true, function () {
|
||||||
|
@ -43,5 +43,10 @@ SUB_TOPIC=Sub Topic
|
|||||||
ISOLATED_TOPIC=Isolated Topic
|
ISOLATED_TOPIC=Isolated Topic
|
||||||
CENTRAL_TOPIC=Central Topic
|
CENTRAL_TOPIC=Central Topic
|
||||||
SHORTCUTS=Keyboard Shortcuts
|
SHORTCUTS=Keyboard Shortcuts
|
||||||
|
|
||||||
ENTITIES_COULD_NOT_BE_DELETED=Could not delete topic or relation. At least one map entity must be selected.
|
ENTITIES_COULD_NOT_BE_DELETED=Could not delete topic or relation. At least one map entity must be selected.
|
||||||
|
AT_LEAST_ONE_TOPIC_MUST_BE_SELECTED=At least one topic must be selected.
|
||||||
|
CLIPBOARD_IS_EMPTY=Nothing to copy. Clipboard is empty.
|
||||||
CENTRAL_TOPIC_CAN_NOT_BE_DELETED=Central topic can not be deleted.
|
CENTRAL_TOPIC_CAN_NOT_BE_DELETED=Central topic can not be deleted.
|
||||||
|
MULTIPLE_LINES=Add multiple text lines.
|
||||||
|
COPY_AND_PASTE_TOPICS=Copy and Paste Topics
|
@ -44,3 +44,5 @@ ISOLATED_TOPIC=Tópico Aislado
|
|||||||
CENTRAL_TOPIC=Tópico Central
|
CENTRAL_TOPIC=Tópico Central
|
||||||
ONLY_ONE_TOPIC_MUST_BE_SELECTED_COLLAPSE=Tópicos hijos no pueden ser colapsados. Solo un topic debe ser seleccionado.
|
ONLY_ONE_TOPIC_MUST_BE_SELECTED_COLLAPSE=Tópicos hijos no pueden ser colapsados. Solo un topic debe ser seleccionado.
|
||||||
SHORTCUTS=Accesos directos
|
SHORTCUTS=Accesos directos
|
||||||
|
MULTIPLE_LINES=Add multilines text node
|
||||||
|
COPY_AND_PASTE_TOPICS=Copy Topics
|
||||||
|
@ -43,3 +43,5 @@ SUB_TOPIC=子节点
|
|||||||
ISOLATED_TOPIC=独立节点
|
ISOLATED_TOPIC=独立节点
|
||||||
CENTRAL_TOPIC=中心节点
|
CENTRAL_TOPIC=中心节点
|
||||||
SHORTCUTS=快捷键
|
SHORTCUTS=快捷键
|
||||||
|
MULTIPLE_LINES=Add multilines text node
|
||||||
|
COPY_AND_PASTE_TOPICS=Copy Topics
|
||||||
|
@ -43,3 +43,5 @@ SUB_TOPIC=子節點
|
|||||||
ISOLATED_TOPIC=獨立節點
|
ISOLATED_TOPIC=獨立節點
|
||||||
CENTRAL_TOPIC=中心節點
|
CENTRAL_TOPIC=中心節點
|
||||||
SHORTCUTS=快捷鍵
|
SHORTCUTS=快捷鍵
|
||||||
|
MULTIPLE_LINES=Add multilines text node
|
||||||
|
COPY_AND_PASTE_TOPICS=Copy Topics
|
||||||
|
@ -1,46 +1,52 @@
|
|||||||
<map name="3" version="pela">
|
<map name="welcome" version="tango">
|
||||||
<topic central="true" text="Welcome To WiseMapping" id="1" fontStyle=";;#dfcfe6;;;" bgColor="#0a0a08">
|
<topic central="true" text="Welcome To WiseMapping" id="1" fontStyle=";;#dfcfe6;;;" bgColor="#0a0a08">
|
||||||
<topic position="-326,50" order="2" text="Productivity" id="2" fontStyle=";;#104f11;;;" bgColor="#d9b518">
|
<topic position="178,-130" order="0" text="Try it Now!" id="11" fontStyle=";;#ffffff;;;" bgColor="#250be3"
|
||||||
|
brColor="#080559">
|
||||||
|
<topic position="272,-156" order="0" text="Double Click" id="12" fontStyle=";;#001be6;;italic;"/>
|
||||||
|
<topic position="274,-130" order="1" text=" INS to insert" id="13" fontStyle=";;#001be6;;italic;"/>
|
||||||
|
<topic position="285,-104" order="2" text="Drag map to move" id="14" fontStyle=";;#001be6;;italic;"/>
|
||||||
|
</topic>
|
||||||
|
<topic position="-189,-52" order="1" text="Productivity" id="2" fontStyle=";;#104f11;;;" bgColor="#d9b518">
|
||||||
<icon id="chart_bar"/>
|
<icon id="chart_bar"/>
|
||||||
<topic position="-443,17" order="0" text="Share your ideas" id="3">
|
<topic position="-310,-78" order="0" text="Share your ideas" id="3">
|
||||||
<icon id="bulb_light_on"/>
|
<icon id="bulb_light_on"/>
|
||||||
</topic>
|
</topic>
|
||||||
<topic position="-429,41" order="1" text="Brainstorming" id="4"/>
|
<topic position="-299,-52" order="1" text="Brainstorming" id="4"/>
|
||||||
<topic position="-413,65" order="2" text="Visual " id="5"/>
|
<topic position="-283,-26" order="2" text="Visual " id="5"/>
|
||||||
</topic>
|
</topic>
|
||||||
<topic position="257,150" order="6" text="Features" id="15">
|
<topic position="185,-39" order="2" text="Mind Mapping" id="6" fontStyle=";;#602378;;;" bgColor="#edabff">
|
||||||
<topic position="350,81" order="0" text="Links to Sites" id="16" fontStyle=";6;;;;">
|
<topic position="303,-78" order="0" text="Share with Collegues" id="7"/>
|
||||||
<link url="www.digg.com"/>
|
<topic position="275,-52" order="1" text="Online" id="8"/>
|
||||||
|
<topic position="299,-26" order="2" text="Anyplace, Anytime" id="9"/>
|
||||||
|
<topic position="277,0" order="3" text="Free!!!" id="10"/>
|
||||||
|
</topic>
|
||||||
|
<topic position="-183,39" order="3" text="Web 2.0 Tool" id="22" fontStyle=";;#0c1d6b;;;" bgColor="#add1f7">
|
||||||
|
<topic position="-281,0" order="0" text="Collaborate" id="23"/>
|
||||||
|
<topic position="-302,26" order="1" text="No plugin required" id="24">
|
||||||
|
<icon id="conn_disconnect"/>
|
||||||
</topic>
|
</topic>
|
||||||
<topic position="328,105" order="1" text="Fonts" id="17"/>
|
<topic position="-271,52" order="2" text="Share" id="25"/>
|
||||||
<topic position="339,129" order="2" text="Topic Color" id="18"/>
|
<topic position="-282,78" order="3" text="Easy to use" id="26"/>
|
||||||
<topic position="343,153" order="3" text="Topic Shapes" shape="line" id="19"/>
|
</topic>
|
||||||
<topic position="334,177" order="4" text="Icons" id="20">
|
<topic position="171,91" order="4" text="Features" id="15">
|
||||||
|
<topic position="266,26" order="0" text="Links to Sites" id="16" fontStyle=";6;;;;">
|
||||||
|
<link url="http://www.digg.com" type="url"/>
|
||||||
|
</topic>
|
||||||
|
<topic position="245,52" order="1" text="Fonts" id="17"/>
|
||||||
|
<topic position="255,78" order="2" text="Topic Color" id="18"/>
|
||||||
|
<topic position="260,104" order="3" text="Topic Shapes" shape="line" id="19"/>
|
||||||
|
<topic position="252,130" order="4" text="Icons" id="20">
|
||||||
<icon id="object_rainbow"/>
|
<icon id="object_rainbow"/>
|
||||||
</topic>
|
</topic>
|
||||||
<topic position="357,201" order="5" text="History Changes" id="21">
|
<topic position="272,156" order="5" text="History Changes" id="21">
|
||||||
<icon id="arrowc_turn_left"/>
|
<icon id="arrowc_turn_left"/>
|
||||||
</topic>
|
</topic>
|
||||||
</topic>
|
</topic>
|
||||||
<topic position="-336,-100" order="3" text="Web 2.0 Tool" id="22" fontStyle=";;#0c1d6b;;;" bgColor="#add1f7">
|
|
||||||
<topic position="-433,-145" order="0" text="Collaborate" id="23"/>
|
|
||||||
<topic position="-453,-121" order="1" text="No plugin required" id="24">
|
|
||||||
<icon id="conn_disconnect"/>
|
|
||||||
</topic>
|
|
||||||
<topic position="-420,-97" order="2" text="Share" id="25"/>
|
|
||||||
<topic position="-432,-73" order="3" text="Easy to use" id="26"/>
|
|
||||||
</topic>
|
|
||||||
<topic position="266,0" order="0" text="Try it Now!" id="11" fontStyle=";;#ffffff;;;" bgColor="#250be3"
|
|
||||||
brColor="#080559">
|
|
||||||
<topic position="358,-33" order="0" text="Double Click" id="12" fontStyle=";;#001be6;;italic;"/>
|
|
||||||
<topic position="362,-9" order="1" text=" INS to insert" id="13" fontStyle=";;#001be6;;italic;"/>
|
|
||||||
<topic position="371,15" order="2" text="Drag map to move" id="14" fontStyle=";;#001be6;;italic;"/>
|
|
||||||
</topic>
|
|
||||||
<topic position="299,-100" order="3" text="Mind Mapping" id="6" fontStyle=";;#602378;;;" bgColor="#edabff">
|
|
||||||
<topic position="415,-145" order="0" text="Share with Collegues" id="7"/>
|
|
||||||
<topic position="385,-121" order="1" text="Online" id="8"/>
|
|
||||||
<topic position="410,-97" order="2" text="Anyplace, Anytime" id="9"/>
|
|
||||||
<topic position="386,-73" order="3" text="Free!!!" id="10"/>
|
|
||||||
</topic>
|
|
||||||
</topic>
|
</topic>
|
||||||
|
<relationship srcTopicId="1" destTopicId="3" lineType="3" endArrow="true" startArrow="false"/>
|
||||||
|
<relationship srcTopicId="3" destTopicId="1" lineType="3" srcCtrlPoint="-10,-37" destCtrlPoint="-212,-107"
|
||||||
|
endArrow="true" startArrow="false"/>
|
||||||
|
<relationship srcTopicId="6" destTopicId="14" lineType="3" endArrow="true" startArrow="false"/>
|
||||||
|
<relationship srcTopicId="12" destTopicId="18" lineType="3" srcCtrlPoint="184,86" destCtrlPoint="166,2"
|
||||||
|
endArrow="true" startArrow="false"/>
|
||||||
</map>
|
</map>
|
@ -66,6 +66,17 @@
|
|||||||
<td><spring:message code="JUST_START_TYPING"/> | F2</td>
|
<td><spring:message code="JUST_START_TYPING"/> | F2</td>
|
||||||
<td><spring:message code="JUST_START_TYPING"/> | F2</td>
|
<td><spring:message code="JUST_START_TYPING"/> | F2</td>
|
||||||
</tr>
|
</tr>
|
||||||
|
<tr>
|
||||||
|
<td><spring:message code="MULTIPLE_LINES"/></td>
|
||||||
|
<td>Ctrl + Enter</td>
|
||||||
|
<td>⌘ + Enter</td>
|
||||||
|
</tr>
|
||||||
|
<tr>
|
||||||
|
<td><spring:message code="COPY_AND_PASTE_TOPICS"/></td>
|
||||||
|
<td>Ctrl + c/Ctrl + v</td>
|
||||||
|
<td>⌘ + c/⌘ + c</td>
|
||||||
|
</tr>
|
||||||
|
|
||||||
<tr>
|
<tr>
|
||||||
<td><spring:message code="COLLAPSE_CHILDREN"/></td>
|
<td><spring:message code="COLLAPSE_CHILDREN"/></td>
|
||||||
<td>Space bar</td>
|
<td>Space bar</td>
|
||||||
|
Loading…
Reference in New Issue
Block a user