diff --git a/mindplot/src/main/javascript/ActionDispatcher.js b/mindplot/src/main/javascript/ActionDispatcher.js index 07396c6e..74aeb29c 100644 --- a/mindplot/src/main/javascript/ActionDispatcher.js +++ b/mindplot/src/main/javascript/ActionDispatcher.js @@ -27,7 +27,7 @@ mindplot.ActionDispatcher = new Class({ throw "method must be implemented."; }, - addTopic: function(nodeModel, parentTopicId, animated) { + addTopics: function(models, parentTopicId) { throw "method must be implemented."; }, diff --git a/mindplot/src/main/javascript/CollabActionDispatcher.js b/mindplot/src/main/javascript/CollabActionDispatcher.js index a8999f23..9509cd9e 100644 --- a/mindplot/src/main/javascript/CollabActionDispatcher.js +++ b/mindplot/src/main/javascript/CollabActionDispatcher.js @@ -61,7 +61,7 @@ mindplot.BrixActionDispatcher = new Class({ return mindplot.collaboration.CollaborationManager.getInstance().getCollaborativeFramework(); }, - addTopic : function(nodeModel, parentTopicId, animated) { + addTopics : function(nodeModel, parentTopicId) { var framework = this._getFramework(); var cmindmap = framework.getModel(); diff --git a/mindplot/src/main/javascript/Designer.js b/mindplot/src/main/javascript/Designer.js index fd012327..419718c3 100644 --- a/mindplot/src/main/javascript/Designer.js +++ b/mindplot/src/main/javascript/Designer.js @@ -65,6 +65,7 @@ mindplot.Designer = new Class({ this.setViewPort(options.viewPort); mindplot.TopicEventDispatcher.configure(this.isReadOnly()); + this._clipboard = []; }, /** @@ -131,7 +132,7 @@ mindplot.Designer = new Class({ var centralTopic = this.getModel().getCentralTopic(); var model = this._createChildModel(centralTopic, mousePos); - this._actionDispatcher.addTopic(model, centralTopic.getId()); + this._actionDispatcher.addTopics([model], [centralTopic.getId()]); } }.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 () { return this._model; }, @@ -387,7 +423,7 @@ mindplot.Designer = new Class({ var childModel = this._createChildModel(parentTopic); // 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 ... model.setPosition(1000, 1000); - this._actionDispatcher.addTopic(model, null, false); + this._actionDispatcher.addTopics([model]); var topic = this.getModel().findTopicById(model.getId()); // Simulate a mouse down event to start the dragging ... @@ -452,7 +488,7 @@ mindplot.Designer = new Class({ } var parentTopicId = parentTopic.getId(); - this._actionDispatcher.addTopic(siblingModel, parentTopicId, true); + this._actionDispatcher.addTopics([siblingModel], [parentTopicId]); } }, diff --git a/mindplot/src/main/javascript/DesignerKeyboard.js b/mindplot/src/main/javascript/DesignerKeyboard.js index 01a616ec..e914799b 100644 --- a/mindplot/src/main/javascript/DesignerKeyboard.js +++ b/mindplot/src/main/javascript/DesignerKeyboard.js @@ -93,6 +93,35 @@ mindplot.DesignerKeyboard = new Class({ }.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) { event.preventDefault(); event.stopPropagation(); diff --git a/mindplot/src/main/javascript/Messages.js b/mindplot/src/main/javascript/Messages.js index 0d120a7f..a5a2b05b 100644 --- a/mindplot/src/main/javascript/Messages.js +++ b/mindplot/src/main/javascript/Messages.js @@ -86,8 +86,12 @@ mindplot.Messages.BUNDLES = { CENTRAL_TOPIC:'Central Topic', ONLY_ONE_TOPIC_MUST_BE_SELECTED_COLLAPSE:'Children can not be collapsed. One topic must be selected.', 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':{ DISCARD_CHANGES:'Descartar Cambios', diff --git a/mindplot/src/main/javascript/StandaloneActionDispatcher.js b/mindplot/src/main/javascript/StandaloneActionDispatcher.js index 712c89e7..a88aa9f3 100644 --- a/mindplot/src/main/javascript/StandaloneActionDispatcher.js +++ b/mindplot/src/main/javascript/StandaloneActionDispatcher.js @@ -29,8 +29,8 @@ mindplot.StandaloneActionDispatcher = new Class({ }, - addTopic:function (nodeModel, parentTopicId, animated) { - var command = new mindplot.commands.AddTopicCommand(nodeModel, parentTopicId, animated); + addTopics:function (models, parentTopicsId) { + var command = new mindplot.commands.AddTopicCommand(models, parentTopicsId); this.execute(command); }, diff --git a/mindplot/src/main/javascript/Topic.js b/mindplot/src/main/javascript/Topic.js index 066a19cc..79d7b7e3 100644 --- a/mindplot/src/main/javascript/Topic.js +++ b/mindplot/src/main/javascript/Topic.js @@ -19,7 +19,7 @@ mindplot.Topic = new Class({ Extends:mindplot.NodeGraph, - initialize : function(model, options) { + initialize:function (model, options) { this.parent(model, options); this._children = []; this._parent = null; @@ -39,12 +39,12 @@ mindplot.Topic = new Class({ } }, - _registerEvents : function() { + _registerEvents:function () { this.setMouseEventsEnabled(true); // Prevent click on the topics being propagated ... - this.addEvent('click', function(event) { + this.addEvent('click', function (event) { event.stopPropagation(); }); @@ -54,15 +54,15 @@ mindplot.Topic = new Class({ }.bind(this)); }, - setShapeType : function(type) { + setShapeType:function (type) { this._setShapeType(type, true); }, - getParent : function() { + getParent:function () { return this._parent; }, - _setShapeType : function(type, updateModel) { + _setShapeType:function (type, updateModel) { // Remove inner shape figure ... var model = this.getModel(); if ($defined(updateModel) && updateModel) { @@ -103,7 +103,7 @@ mindplot.Topic = new Class({ }, - getShapeType : function() { + getShapeType:function () { var model = this.getModel(); var result = model.getShapeType(); if (!$defined(result)) { @@ -112,7 +112,7 @@ mindplot.Topic = new Class({ return result; }, - _removeInnerShape : function() { + _removeInnerShape:function () { var group = this.get2DElement(); var innerShape = this.getInnerShape(); group.removeChild(innerShape); @@ -120,7 +120,7 @@ mindplot.Topic = new Class({ return innerShape; }, - getInnerShape : function() { + getInnerShape:function () { if (!$defined(this._innerShape)) { // Create inner box. this._innerShape = this._buildShape(mindplot.Topic.INNER_RECT_ATTRIBUTES, this.getShapeType()); @@ -144,7 +144,7 @@ mindplot.Topic = new Class({ return this._innerShape; }, - _buildShape : function(attributes, shapeType) { + _buildShape:function (attributes, shapeType) { $assert(attributes, "attributes can not be null"); $assert(shapeType, "shapeType can not be null"); @@ -160,11 +160,11 @@ mindplot.Topic = new Class({ result.setHref(url); result.setSize(size.width, size.height); - result.getSize = function() { + result.getSize = function () { return model.getImageSize(); }; - result.setPosition = function() { + result.setPosition = function () { }; } else if (shapeType == mindplot.model.TopicShape.ELLIPSE) { @@ -174,8 +174,8 @@ mindplot.Topic = new Class({ result = new web2d.Rect(0.3, attributes); } else if (shapeType == mindplot.model.TopicShape.LINE) { - result = new web2d.Line({strokeColor:"#495879",strokeWidth:1}); - result.setSize = function(width, height) { + result = new web2d.Line({strokeColor:"#495879", strokeWidth:1}); + result.setSize = function (width, height) { this.size = {width:width, height:height}; result.setFrom(0, height); result.setTo(width, height); @@ -185,18 +185,18 @@ mindplot.Topic = new Class({ result.setStroke(1, 'solid', stokeColor); }; - result.getSize = function() { + result.getSize = function () { 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(); innerShape.setCursor(type); @@ -219,7 +219,7 @@ mindplot.Topic = new Class({ textShape.setCursor(type); }, - getOuterShape : function() { + getOuterShape:function () { if (!$defined(this._outerShape)) { var rect = this._buildShape(mindplot.Topic.OUTER_SHAPE_ATTRIBUTES, mindplot.model.TopicShape.ROUNDED_RECT); rect.setPosition(-2, -3); @@ -230,7 +230,7 @@ mindplot.Topic = new Class({ return this._outerShape; }, - getTextShape : function() { + getTextShape:function () { if (!$defined(this._text)) { this._text = this._buildTextShape(false); @@ -242,7 +242,7 @@ mindplot.Topic = new Class({ return this._text; }, - getOrBuildIconGroup : function() { + getOrBuildIconGroup:function () { if (!$defined(this._iconsGroup)) { this._iconsGroup = this._buildIconGroup(); var group = this.get2DElement(); @@ -252,11 +252,11 @@ mindplot.Topic = new Class({ return this._iconsGroup; }, - getIconGroup : function() { + getIconGroup:function () { return this._iconsGroup; }, - _buildIconGroup : function() { + _buildIconGroup:function () { var textHeight = this.getTextShape().getFontHeight(); var result = new mindplot.IconGroup(this.getId(), textHeight); var padding = this._getInnerPadding(); @@ -274,7 +274,7 @@ mindplot.Topic = new Class({ return result; }, - addFeature : function(type, attributes) { + addFeature:function (type, attributes) { var iconGroup = this.getOrBuildIconGroup(); this.closeEditors(); @@ -291,12 +291,12 @@ mindplot.Topic = new Class({ return result; }, - findFeatureById : function(id) { + findFeatureById:function (id) { var model = this.getModel(); return model.findFeatureById(id); }, - removeFeature : function(featureModel) { + removeFeature:function (featureModel) { $assert(featureModel, "featureModel could not be null"); //Removing the icon from MODEL @@ -311,19 +311,19 @@ mindplot.Topic = new Class({ this._adjustShapes(); }, - addRelationship : function(relationship) { + addRelationship:function (relationship) { this._relationships.push(relationship); }, - deleteRelationship : function(relationship) { + deleteRelationship:function (relationship) { this._relationships.erase(relationship); }, - getRelationships : function() { + getRelationships:function () { return this._relationships; }, - _buildTextShape : function(readOnly) { + _buildTextShape:function (readOnly) { var result = new web2d.Text(); var family = this.getFontFamily(); var size = this.getFontSize(); @@ -346,11 +346,11 @@ mindplot.Topic = new Class({ return result; }, - _getInnerPadding : function() { + _getInnerPadding:function () { throw "this must be implemented"; }, - setFontFamily : function(value, updateModel) { + setFontFamily:function (value, updateModel) { var textShape = this.getTextShape(); textShape.setFontFamily(value); if ($defined(updateModel) && updateModel) { @@ -360,7 +360,7 @@ mindplot.Topic = new Class({ this._adjustShapes(updateModel); }, - setFontSize : function(value, updateModel) { + setFontSize:function (value, updateModel) { var textShape = this.getTextShape(); textShape.setSize(value); @@ -373,7 +373,7 @@ mindplot.Topic = new Class({ }, - setFontStyle : function(value, updateModel) { + setFontStyle:function (value, updateModel) { var textShape = this.getTextShape(); textShape.setStyle(value); if ($defined(updateModel) && updateModel) { @@ -383,7 +383,7 @@ mindplot.Topic = new Class({ this._adjustShapes(updateModel); }, - setFontWeight : function(value, updateModel) { + setFontWeight:function (value, updateModel) { var textShape = this.getTextShape(); textShape.setWeight(value); if ($defined(updateModel) && updateModel) { @@ -393,7 +393,7 @@ mindplot.Topic = new Class({ this._adjustShapes(); }, - getFontWeight : function() { + getFontWeight:function () { var model = this.getModel(); var result = model.getFontWeight(); if (!$defined(result)) { @@ -403,7 +403,7 @@ mindplot.Topic = new Class({ return result; }, - getFontFamily : function() { + getFontFamily:function () { var model = this.getModel(); var result = model.getFontFamily(); if (!$defined(result)) { @@ -413,7 +413,7 @@ mindplot.Topic = new Class({ return result; }, - getFontColor : function() { + getFontColor:function () { var model = this.getModel(); var result = model.getFontColor(); if (!$defined(result)) { @@ -423,7 +423,7 @@ mindplot.Topic = new Class({ return result; }, - getFontStyle : function() { + getFontStyle:function () { var model = this.getModel(); var result = model.getFontStyle(); if (!$defined(result)) { @@ -433,7 +433,7 @@ mindplot.Topic = new Class({ return result; }, - getFontSize : function() { + getFontSize:function () { var model = this.getModel(); var result = model.getFontSize(); if (!$defined(result)) { @@ -443,7 +443,7 @@ mindplot.Topic = new Class({ return result; }, - setFontColor : function(value, updateModel) { + setFontColor:function (value, updateModel) { var textShape = this.getTextShape(); textShape.setColor(value); if ($defined(updateModel) && updateModel) { @@ -452,7 +452,7 @@ mindplot.Topic = new Class({ } }, - _setText : function(text, updateModel) { + _setText:function (text, updateModel) { var textShape = this.getTextShape(); textShape.setText(text == null ? this._defaultText() : text); @@ -462,7 +462,7 @@ mindplot.Topic = new Class({ } }, - setText : function(text) { + setText:function (text) { // Avoid empty nodes ... if (text.trim().length == 0) { text = null; @@ -472,7 +472,7 @@ mindplot.Topic = new Class({ this._adjustShapes(); }, - getText : function() { + getText:function () { var model = this.getModel(); var result = model.getText(); if (!$defined(result)) { @@ -481,11 +481,11 @@ mindplot.Topic = new Class({ return result; }, - setBackgroundColor : function(color) { + setBackgroundColor:function (color) { this._setBackgroundColor(color, true); }, - _setBackgroundColor : function(color, updateModel) { + _setBackgroundColor:function (color, updateModel) { var innerShape = this.getInnerShape(); innerShape.setFill(color); @@ -500,7 +500,7 @@ mindplot.Topic = new Class({ } }, - getBackgroundColor : function() { + getBackgroundColor:function () { var model = this.getModel(); var result = model.getBackgroundColor(); if (!$defined(result)) { @@ -509,11 +509,11 @@ mindplot.Topic = new Class({ return result; }, - setBorderColor : function(color) { + setBorderColor:function (color) { this._setBorderColor(color, true); }, - _setBorderColor : function(color, updateModel) { + _setBorderColor:function (color, updateModel) { var innerShape = this.getInnerShape(); innerShape.setAttribute('strokeColor', color); @@ -528,7 +528,7 @@ mindplot.Topic = new Class({ } }, - getBorderColor : function() { + getBorderColor:function () { var model = this.getModel(); var result = model.getBorderColor(); if (!$defined(result)) { @@ -537,8 +537,8 @@ mindplot.Topic = new Class({ return result; }, - _buildTopicShape : function() { - var groupAttributes = {width: 100, height:100,coordSizeWidth:100,coordSizeHeight:100}; + _buildTopicShape:function () { + var groupAttributes = {width:100, height:100, coordSizeWidth:100, coordSizeHeight:100}; var group = new web2d.Group(groupAttributes); this._set2DElement(group); @@ -567,15 +567,15 @@ mindplot.Topic = new Class({ this._registerDefaultListenersToElement(group, this); }, - _registerDefaultListenersToElement : function(elem, topic) { - var mouseOver = function(event) { + _registerDefaultListenersToElement:function (elem, topic) { + var mouseOver = function (event) { if (topic.isMouseEventsEnabled()) { topic.handleMouseOver(event); } }; elem.addEvent('mouseover', mouseOver); - var outout = function(event) { + var outout = function (event) { if (topic.isMouseEventsEnabled()) { topic.handleMouseOut(event); } @@ -583,7 +583,7 @@ mindplot.Topic = new Class({ elem.addEvent('mouseout', outout); // Focus events ... - elem.addEvent('mousedown', function(event) { + elem.addEvent('mousedown', function (event) { if (!this.isReadOnly()) { // Disable topic selection of readOnly mode ... var value = true; @@ -602,12 +602,12 @@ mindplot.Topic = new Class({ }.bind(this)); }, - areChildrenShrunken : function() { + areChildrenShrunken:function () { var model = this.getModel(); return model.areChildrenShrunken(); }, - isCollapsed : function() { + isCollapsed:function () { var result = false; var current = this.getParent(); @@ -618,7 +618,7 @@ mindplot.Topic = new Class({ return result; }, - setChildrenShrunken : function(value) { + setChildrenShrunken:function (value) { // Update Model ... var model = this.getModel(); model.setChildrenShrunken(value); @@ -632,7 +632,7 @@ mindplot.Topic = new Class({ // Do some fancy animation .... var elements = this._flatten2DElements(this); var fade = new mindplot.util.FadeEffect(elements, !value); - fade.addEvent('complete', function() { + fade.addEvent('complete', function () { }); fade.start(); @@ -640,7 +640,7 @@ mindplot.Topic = new Class({ }, - getShrinkConnector : function() { + getShrinkConnector:function () { var result = this._connector; if (this._connector == null) { this._connector = new mindplot.ShirinkConnector(this); @@ -651,28 +651,28 @@ mindplot.Topic = new Class({ return result; }, - handleMouseOver : function() { + handleMouseOver:function () { var outerShape = this.getOuterShape(); outerShape.setOpacity(1); }, - handleMouseOut : function() { + handleMouseOut:function () { var outerShape = this.getOuterShape(); if (!this.isOnFocus()) { outerShape.setOpacity(0); } }, - showTextEditor : function(text) { + showTextEditor:function (text) { this._getTopicEventDispatcher().show(this, {text:text}); }, - showNoteEditor : function() { + showNoteEditor:function () { var topicId = this.getId(); var model = this.getModel(); var editorModel = { - getValue : function() { + getValue:function () { var notes = model.findFeatureByType(mindplot.TopicFeature.Note.id); var result; if (notes.length > 0) @@ -681,7 +681,7 @@ mindplot.Topic = new Class({ return result; }, - setValue : function(value) { + setValue:function (value) { var dispatcher = mindplot.ActionDispatcher.getInstance(); var notes = model.findFeatureByType(mindplot.TopicFeature.Note.id); if (!$defined(value)) { @@ -703,12 +703,12 @@ mindplot.Topic = new Class({ editor.show(); }, - showLinkEditor : function() { + showLinkEditor:function () { var topicId = this.getId(); var model = this.getModel(); var editorModel = { - getValue : function() { + getValue:function () { var links = model.findFeatureByType(mindplot.TopicFeature.Link.id); var result; if (links.length > 0) @@ -717,7 +717,7 @@ mindplot.Topic = new Class({ return result; }, - setValue : function(value) { + setValue:function (value) { var dispatcher = mindplot.ActionDispatcher.getInstance(); var links = model.findFeatureByType(mindplot.TopicFeature.Link.id); if (!$defined(value)) { @@ -740,18 +740,18 @@ mindplot.Topic = new Class({ editor.show(); }, - closeEditors : function() { + closeEditors:function () { this._getTopicEventDispatcher().close(true); }, - _getTopicEventDispatcher : function() { + _getTopicEventDispatcher:function () { return mindplot.TopicEventDispatcher.getInstance(); }, /** * Point: references the center of the rect shape.!!! */ - setPosition : function(point) { + setPosition:function (point) { $assert(point, "position can not be null"); point.x = Math.ceil(point.x); point.y = Math.ceil(point.y); @@ -777,11 +777,11 @@ mindplot.Topic = new Class({ this.invariant(); }, - getOutgoingLine : function() { + getOutgoingLine:function () { return this._outgoingLine; }, - getIncomingLines : function() { + getIncomingLines:function () { var result = []; var children = this.getChildren(); for (var i = 0; i < children.length; i++) { @@ -794,7 +794,7 @@ mindplot.Topic = new Class({ return result; }, - getOutgoingConnectedTopic : function() { + getOutgoingConnectedTopic:function () { var result = null; var line = this.getOutgoingLine(); if ($defined(line)) { @@ -803,7 +803,7 @@ mindplot.Topic = new Class({ return result; }, - _updateConnectionLines : function() { + _updateConnectionLines:function () { // Update this to parent line ... var outgoingLine = this.getOutgoingLine(); if ($defined(outgoingLine)) { @@ -822,7 +822,7 @@ mindplot.Topic = new Class({ } }, - setBranchVisibility : function(value) { + setBranchVisibility:function (value) { var current = this; var parent = this; 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); // Hide all children... @@ -842,7 +842,7 @@ mindplot.Topic = new Class({ this._setRelationshipLinesVisibility(value); }, - moveToBack : function() { + moveToBack:function () { // Update relationship lines for (var j = 0; j < this._relationships.length; j++) { @@ -856,7 +856,7 @@ mindplot.Topic = new Class({ this.get2DElement().moveToBack(); }, - moveToFront : function() { + moveToFront:function () { this.get2DElement().moveToFront(); var connector = this.getShrinkConnector(); @@ -869,18 +869,18 @@ mindplot.Topic = new Class({ } }, - isVisible : function() { + isVisible:function () { var elem = this.get2DElement(); return elem.isVisible(); }, - _setRelationshipLinesVisibility : function(value) { - this._relationships.forEach(function(relationship) { + _setRelationshipLinesVisibility:function (value) { + this._relationships.forEach(function (relationship) { relationship.setVisibility(value); }); }, - _setTopicVisibility : function(value) { + _setTopicVisibility:function (value) { var elem = this.get2DElement(); elem.setVisibility(value); @@ -895,7 +895,7 @@ mindplot.Topic = new Class({ textShape.setVisibility(this.getShapeType() != mindplot.model.TopicShape.IMAGE ? value : false); }, - setOpacity : function(opacity) { + setOpacity:function (opacity) { var elem = this.get2DElement(); elem.setOpacity(opacity); @@ -907,7 +907,7 @@ mindplot.Topic = new Class({ textShape.setOpacity(opacity); }, - _setChildrenVisibility : function(isVisible) { + _setChildrenVisibility:function (isVisible) { // Hide all children. var children = this.getChildren(); @@ -924,7 +924,7 @@ mindplot.Topic = new Class({ }, - invariant : function() { + invariant:function () { var line = this._outgoingLine; var model = this.getModel(); 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($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 hasSizeChanged = oldSize.width != size.width || oldSize.height != size.height; @@ -956,16 +956,16 @@ mindplot.Topic = new Class({ this._updatePositionOnChangeSize(oldSize, size); 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."); }, - disconnect : function(workspace) { + disconnect:function (workspace) { var outgoingLine = this.getOutgoingLine(); if ($defined(outgoingLine)) { $assert(workspace, 'workspace can not be null'); @@ -1009,17 +1009,17 @@ mindplot.Topic = new Class({ } }, - getOrder : function() { + getOrder:function () { var model = this.getModel(); return model.getOrder(); }, - setOrder : function(value) { + setOrder:function (value) { var model = this.getModel(); model.setOrder(value); }, - connectTo : function(targetTopic, workspace, isVisible) { + connectTo:function (targetTopic, workspace, isVisible) { $assert(!this._outgoingLine, 'Could not connect an already connected node'); $assert(targetTopic != this, 'Cilcular connection are not allowed'); $assert(targetTopic, 'Parent Graph can not be null'); @@ -1068,22 +1068,22 @@ mindplot.Topic = new Class({ // Fire connection event ... 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(); children.push(child); }, - removeChild : function(child) { + removeChild:function (child) { var children = this.getChildren(); children.erase(child); }, - getChildren : function() { + getChildren:function () { var result = this._children; if (!$defined(result)) { this._children = []; @@ -1092,7 +1092,7 @@ mindplot.Topic = new Class({ return result; }, - removeFromWorkspace : function(workspace) { + removeFromWorkspace:function (workspace) { var elem2d = this.get2DElement(); workspace.removeChild(elem2d); var line = this.getOutgoingLine(); @@ -1103,7 +1103,7 @@ mindplot.Topic = new Class({ mindplot.EventBus.instance.fireEvent(mindplot.EventBus.events.NodeRemoved, this.getModel()); }, - addToWorkspace : function(workspace) { + addToWorkspace:function (workspace) { var elem = this.get2DElement(); workspace.appendChild(elem); if (!this.isInWorkspace()) { @@ -1112,18 +1112,18 @@ mindplot.Topic = new Class({ } 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._adjustShapes(); }, - isInWorkspace : function() { + isInWorkspace:function () { return this._isInWorkspace; }, - createDragNode : function(layoutManager) { + createDragNode:function (layoutManager) { var result = this.parent(layoutManager); // Is the node already connected ? @@ -1139,7 +1139,7 @@ mindplot.Topic = new Class({ return result; }, - _adjustShapes : function() { + _adjustShapes:function () { if (this._isInWorkspace) { var textShape = this.getTextShape(); @@ -1168,7 +1168,7 @@ mindplot.Topic = new Class({ var height = textHeight + (topicPadding * 2); var width = textWidth + iconsWidth + (topicPadding * 2); - this.setSize({width:width,height:height}); + this.setSize({width:width, height:height}); // Position node ... textShape.setPosition(topicPadding + iconsWidth, topicPadding); @@ -1180,7 +1180,7 @@ mindplot.Topic = new Class({ } }, - _flatten2DElements : function(topic) { + _flatten2DElements:function (topic) { var result = []; var children = topic.getChildren(); @@ -1203,8 +1203,8 @@ mindplot.Topic = new Class({ 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_FOCUS = {fillColor:'rgb(244,184,45)',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.INNER_RECT_ATTRIBUTES = {stroke:'2 solid'}; diff --git a/mindplot/src/main/javascript/TopicFeature.js b/mindplot/src/main/javascript/TopicFeature.js index 5e10c37e..f1dda874 100644 --- a/mindplot/src/main/javascript/TopicFeature.js +++ b/mindplot/src/main/javascript/TopicFeature.js @@ -41,15 +41,14 @@ mindplot.TopicFeature = { }); }, - createModel : function(id, topic, attributes) { + createModel : function(id, attributes) { $assert(id, 'type can not be null'); - $assert(topic, 'topic can not be null'); $assert(attributes, 'attributes can not be null'); var model = mindplot.TopicFeature._featuresMetadataById.filter(function(elem) { return elem.id == id; })[0].model; - return new model(topic, attributes); + return new model(attributes); }, createIcon : function(topic, model) { diff --git a/mindplot/src/main/javascript/collaboration/framework/collab/model/NodeModel.js b/mindplot/src/main/javascript/collaboration/framework/collab/model/NodeModel.js index e880d6be..98522c54 100644 --- a/mindplot/src/main/javascript/collaboration/framework/collab/model/NodeModel.js +++ b/mindplot/src/main/javascript/collaboration/framework/collab/model/NodeModel.js @@ -62,7 +62,7 @@ mindplot.collaboration.framework.brix.model.NodeModel = new Class({ var model = new mindplot.model.NodeModel(cmodel.getType(), designer.getMindmap(), this.getId()); cmodel.copyTo(model); - actionDispatcher.addTopic(model, this.getId(), true); + actionDispatcher.addTopics([model], [this.getId()]); } } catch(e) { console.trace(); diff --git a/mindplot/src/main/javascript/commands/AddTopicCommand.js b/mindplot/src/main/javascript/commands/AddTopicCommand.js index a0cf5d95..62e01ac9 100644 --- a/mindplot/src/main/javascript/commands/AddTopicCommand.js +++ b/mindplot/src/main/javascript/commands/AddTopicCommand.js @@ -18,39 +18,49 @@ mindplot.commands.AddTopicCommand = new Class({ Extends:mindplot.Command, - initialize: function(model, parentTopicId) { - $assert(model, 'Model can not be null'); + initialize:function (models, parentTopicsId) { + $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._model = model; - this._parentId = parentTopicId; + this._models = models; + this._parentsIds = parentTopicsId; }, - execute: function(commandContext) { + execute:function (commandContext) { - // Add a new topic ... - var topic = commandContext.createTopic(this._model, false); + this._models.forEach(function (model, index) { - // Connect to topic ... - if ($defined(this._parentId)) { - var parentTopic = commandContext.findTopics(this._parentId)[0]; - commandContext.connect(topic, parentTopic); - } + // Add a new topic ... + var topic = commandContext.createTopic(model, false); - // 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(); + // Connect to topic ... + if (this._parentsIds) { + var parentId = this._parentsIds[index]; + if ($defined(parentId)) { + var parentTopic = commandContext.findTopics(parentId)[0]; + commandContext.connect(topic, parentTopic); + } + } + + // 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 ... - var topicId = this._model.getId(); - var topic = commandContext.findTopics(topicId)[0]; - commandContext.deleteTopic(topic); + this._models.forEach(function (model) { + + var topicId = model.getId(); + var topic = commandContext.findTopics(topicId)[0]; + commandContext.deleteTopic(topic); + }.bind(this)); } }); \ No newline at end of file diff --git a/mindplot/src/main/javascript/model/FeatureModel.js b/mindplot/src/main/javascript/model/FeatureModel.js index 03d58e95..c133f980 100644 --- a/mindplot/src/main/javascript/model/FeatureModel.js +++ b/mindplot/src/main/javascript/model/FeatureModel.js @@ -17,13 +17,11 @@ */ mindplot.model.FeatureModel = new Class({ - initialize:function(type, topic) { + initialize:function(type) { $assert(type, 'type can not be null'); - $assert(topic, 'topic can not be null'); this._id = mindplot.model.FeatureModel._nextUUID(); this._type = type; - this._topic = topic; this._attributes = {}; // Create type method ... @@ -53,10 +51,6 @@ mindplot.model.FeatureModel = new Class({ return this._attributes[key]; }, - getTopic : function() { - return this._topic; - }, - getId : function() { return this._id; }, diff --git a/mindplot/src/main/javascript/model/INodeModel.js b/mindplot/src/main/javascript/model/INodeModel.js index 3dbf5ebe..9151c118 100644 --- a/mindplot/src/main/javascript/model/INodeModel.js +++ b/mindplot/src/main/javascript/model/INodeModel.js @@ -56,7 +56,7 @@ mindplot.model.INodeModel = new Class({ setPosition : function(x, y) { $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) + '}'); }, diff --git a/mindplot/src/main/javascript/model/IconModel.js b/mindplot/src/main/javascript/model/IconModel.js index 55f238d5..40dcc9f4 100644 --- a/mindplot/src/main/javascript/model/IconModel.js +++ b/mindplot/src/main/javascript/model/IconModel.js @@ -18,8 +18,8 @@ mindplot.model.IconModel = new Class({ Extends: mindplot.model.FeatureModel, - initialize:function(topic, attributes) { - this.parent(mindplot.model.IconModel.FEATURE_TYPE, topic); + initialize:function(attributes) { + this.parent(mindplot.model.IconModel.FEATURE_TYPE); this.setIconType(attributes.id); }, diff --git a/mindplot/src/main/javascript/model/LinkModel.js b/mindplot/src/main/javascript/model/LinkModel.js index b218804a..b30d93cf 100644 --- a/mindplot/src/main/javascript/model/LinkModel.js +++ b/mindplot/src/main/javascript/model/LinkModel.js @@ -18,8 +18,8 @@ mindplot.model.LinkModel = new Class({ Extends: mindplot.model.FeatureModel, - initialize : function(topic, attributes) { - this.parent(mindplot.model.LinkModel.FEATURE_TYPE, topic); + initialize : function(attributes) { + this.parent(mindplot.model.LinkModel.FEATURE_TYPE); this.setUrl(attributes.url); }, diff --git a/mindplot/src/main/javascript/model/NodeModel.js b/mindplot/src/main/javascript/model/NodeModel.js index 04273543..531aadde 100644 --- a/mindplot/src/main/javascript/model/NodeModel.js +++ b/mindplot/src/main/javascript/model/NodeModel.js @@ -17,8 +17,8 @@ */ mindplot.model.NodeModel = new Class({ - Extends: mindplot.model.INodeModel, - initialize:function(type, mindmap, id) { + Extends:mindplot.model.INodeModel, + initialize:function (type, mindmap, id) { $assert(type, 'Node type can not be null'); $assert(mindmap, 'mindmap can not be null'); this._properties = {}; @@ -32,61 +32,61 @@ mindplot.model.NodeModel = new Class({ this._feature = []; }, - createFeature: function(type, attributes) { - return mindplot.TopicFeature.createModel(type, this, attributes); + createFeature:function (type, attributes) { + return mindplot.TopicFeature.createModel(type, attributes); }, - addFeature: function(feature) { + addFeature:function (feature) { $assert(feature, 'feature can not be null'); this._feature.push(feature); }, - getFeatures: function() { + getFeatures:function () { return this._feature; }, - removeFeature: function(feature) { + removeFeature:function (feature) { $assert(feature, 'feature can not be null'); this._feature.erase(feature); }, - findFeatureByType : function(type) { + findFeatureByType:function (type) { $assert(type, 'type can not be null'); - return this._feature.filter(function(feature) { + return this._feature.filter(function (feature) { return feature.getType() == type; }); }, - findFeatureById : function(id) { + findFeatureById:function (id) { $assert($defined(id), 'id can not be null'); - return this._feature.filter(function(feature) { + return this._feature.filter(function (feature) { return feature.getId() == id; })[0]; }, - getPropertiesKeys : function() { + getPropertiesKeys:function () { return Object.keys(this._properties); }, - putProperty : function(key, value) { + putProperty:function (key, value) { $defined(key, 'key can not be null'); this._properties[key] = value; }, - getProperties: function() { + getProperties:function () { return this._properties; }, - getProperty : function(key) { + getProperty:function (key) { $defined(key, 'key can not be null'); var result = this._properties[key]; return !$defined(result) ? null : result; }, - clone : function() { + clone:function () { 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(); cnode._parent = result; return cnode; @@ -97,32 +97,52 @@ mindplot.model.NodeModel = new Class({ 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'); this._children.push(child); child._parent = this; }, - removeChild : function(child) { + removeChild:function (child) { $assert(child && child.isNodeModel(), 'Only NodeModel can be appended to Mindmap object.'); this._children.erase(child); child._parent = null; }, - getChildren : function() { + getChildren:function () { return this._children; }, - getParent : function() { + getParent:function () { return this._parent; }, - setParent : function(parent) { + setParent:function (parent) { $assert(parent != this, 'The same node can not be parent and child if itself.'); 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(sourcePosition, 'childPosition can not be null.'); $assert(targetTopicHeight, 'childrenWidth can not be null.'); @@ -169,7 +189,7 @@ mindplot.model.NodeModel = new Class({ return result; }, - _isChildNode : function(node) { + _isChildNode:function (node) { var result = false; if (node == this) { result = true; @@ -186,7 +206,7 @@ mindplot.model.NodeModel = new Class({ return result; }, - findNodeById : function(id) { + findNodeById:function (id) { var result = null; if (this.getId() == id) { result = this; diff --git a/mindplot/src/main/javascript/model/NoteModel.js b/mindplot/src/main/javascript/model/NoteModel.js index 2cd6f62f..d41ec317 100644 --- a/mindplot/src/main/javascript/model/NoteModel.js +++ b/mindplot/src/main/javascript/model/NoteModel.js @@ -18,8 +18,8 @@ mindplot.model.NoteModel = new Class({ Extends: mindplot.model.FeatureModel, - initialize : function(topic, attributes) { - this.parent(mindplot.model.NoteModel.FEATURE_TYPE, topic); + initialize : function(attributes) { + this.parent(mindplot.model.NoteModel.FEATURE_TYPE); this.setText(attributes.text); }, diff --git a/mindplot/src/main/javascript/persistence/XMLSerializer_Pela.js b/mindplot/src/main/javascript/persistence/XMLSerializer_Pela.js index 19e4f9f2..390be34a 100644 --- a/mindplot/src/main/javascript/persistence/XMLSerializer_Pela.js +++ b/mindplot/src/main/javascript/persistence/XMLSerializer_Pela.js @@ -351,7 +351,7 @@ mindplot.persistence.XMLSerializer_Pela = new Class({ // Create a new element .... var featureType = child.tagName; - var feature = mindplot.TopicFeature.createModel(featureType, topic, attributes); + var feature = mindplot.TopicFeature.createModel(featureType, attributes); topic.addFeature(feature); } else if (child.tagName == "text") { @@ -411,7 +411,7 @@ mindplot.persistence.XMLSerializer_Pela = new Class({ return null; } // 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; } diff --git a/mindplot/src/main/javascript/widget/IconPanel.js b/mindplot/src/main/javascript/widget/IconPanel.js index 4b4bc5dd..6c9f67c6 100644 --- a/mindplot/src/main/javascript/widget/IconPanel.js +++ b/mindplot/src/main/javascript/widget/IconPanel.js @@ -17,20 +17,20 @@ */ mindplot.widget.IconPanel = new Class({ - Extends: mindplot.widget.ToolbarPaneItem, - initialize : function(buttonId, model) { + Extends:mindplot.widget.ToolbarPaneItem, + initialize:function (buttonId, model) { this.parent(buttonId, model); }, - _updateSelectedItem : function() { + _updateSelectedItem:function () { return this.getPanelElem(); }, - buildPanel: function() { - var content = new Element('div', {'class':'toolbarPanel','id':'IconsPanel'}); - content.setStyles({width:253,height:210,padding:5}); - content.addEvent("click", function(event) { + buildPanel:function () { + var content = new Element('div', {'class':'toolbarPanel', 'id':'IconsPanel'}); + content.setStyles({width:253, height:210, padding:5}); + content.addEvent("click", function (event) { event.stopPropagation() }); @@ -52,12 +52,12 @@ mindplot.widget.IconPanel = new Class({ img.setStyles({width:16, height:16, padding:"0px 2px", - cursor: 'pointer' + cursor:'pointer' }).inject(familyContent); var panel = this; var model = this.getModel(); - img.addEvent('click', function(event) { + img.addEvent('click', function (event) { model.setValue(this.id); panel.hide(); }.bind(img)); diff --git a/mindplot/src/main/javascript/widget/Menu.js b/mindplot/src/main/javascript/widget/Menu.js index df636b0e..8941f2bb 100644 --- a/mindplot/src/main/javascript/widget/Menu.js +++ b/mindplot/src/main/javascript/widget/Menu.js @@ -251,10 +251,10 @@ mindplot.widget.Menu = new Class({ this._registerTooltip('redoEdition', $msg('REDO'), "meta+shift+Z"); - this._addButton('addTopic', true, false, function () { + this._addButton('addTopics', true, false, function () { designer.createChildForSelectedNode(); }); - this._registerTooltip('addTopic', $msg('ADD_TOPIC'), "Enter"); + this._registerTooltip('addTopics', $msg('ADD_TOPIC'), "Enter"); this._addButton('deleteTopic', true, true, function () { diff --git a/mindplot/src/main/resources/messages_en.properties b/mindplot/src/main/resources/messages_en.properties index ca497be2..5fc52c18 100644 --- a/mindplot/src/main/resources/messages_en.properties +++ b/mindplot/src/main/resources/messages_en.properties @@ -43,5 +43,10 @@ SUB_TOPIC=Sub Topic ISOLATED_TOPIC=Isolated Topic CENTRAL_TOPIC=Central Topic 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. \ No newline at end of file +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. +MULTIPLE_LINES=Add multiple text lines. +COPY_AND_PASTE_TOPICS=Copy and Paste Topics \ No newline at end of file diff --git a/mindplot/src/main/resources/messages_es.properties b/mindplot/src/main/resources/messages_es.properties index 0ad338e6..2bb6a9fa 100644 --- a/mindplot/src/main/resources/messages_es.properties +++ b/mindplot/src/main/resources/messages_es.properties @@ -44,3 +44,5 @@ ISOLATED_TOPIC=Tópico Aislado 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. SHORTCUTS=Accesos directos +MULTIPLE_LINES=Add multilines text node +COPY_AND_PASTE_TOPICS=Copy Topics diff --git a/mindplot/src/main/resources/messages_zh_CN.properties b/mindplot/src/main/resources/messages_zh_CN.properties index b75c77cc..3cc433de 100644 --- a/mindplot/src/main/resources/messages_zh_CN.properties +++ b/mindplot/src/main/resources/messages_zh_CN.properties @@ -1,45 +1,47 @@ -ZOOM_IN=放大 -ZOOM_OUT=缩小 -TOPIC_SHAPE=节点外形 -TOPIC_ADD=添加节点 -TOPIC_DELETE=删除节点 -TOPIC_ICON=加入图标 -TOPIC_LINK=添加链接 -TOPIC_RELATIONSHIP=关系 -TOPIC_COLOR=节点颜色 -TOPIC_BORDER_COLOR=边框颜色 -TOPIC_NOTE=添加注释 -FONT_FAMILY=字体 -FONT_SIZE=文字大小 -FONT_BOLD=粗体 -FONT_ITALIC=斜体 -UNDO=撤销 -REDO=重做 -INSERT=插入 -SAVE=保存 -NOTE=注释 - -ADD_TOPIC=添加节点 -LOADING=载入中…… -EXPORT=导出 -PRINT=打印 -PUBLISH=公开 -COLLABORATE=共享 -HISTORY=历史 -DISCARD_CHANGES=清除改变 -FONT_COLOR=文本颜色 -SAVING=保存中…… -SAVE_COMPLETE=完成保存 - -ZOOM_IN_ERROR=缩放过多。 -ZOOM_ERROR=不能再缩放。 -ONLY_ONE_TOPIC_MUST_BE_SELECTED=不能创建节点。仅能选择一个节点。 -ONE_TOPIC_MUST_BE_SELECTED=不能创建节点。必须选择一个节点。 -ONLY_ONE_TOPIC_MUST_BE_SELECTED_COLLAPSE=子节点不能折叠。必须选择一个节点。 -SAVE_COULD_NOT_BE_COMPLETED=保存未完成。稍后再试。 -UNEXPECTED_ERROR_LOADING=抱歉,突遭错误,我们无法处理你的请求。\n尝试重新装载编辑器。如果问题依然存在请联系support@wisemapping.com。 -MAIN_TOPIC=主节点 -SUB_TOPIC=子节点 -ISOLATED_TOPIC=独立节点 -CENTRAL_TOPIC=中心节点 -SHORTCUTS=快捷键 +ZOOM_IN=放大 +ZOOM_OUT=缩小 +TOPIC_SHAPE=节点外形 +TOPIC_ADD=添加节点 +TOPIC_DELETE=删除节点 +TOPIC_ICON=加入图标 +TOPIC_LINK=添加链接 +TOPIC_RELATIONSHIP=关系 +TOPIC_COLOR=节点颜色 +TOPIC_BORDER_COLOR=边框颜色 +TOPIC_NOTE=添加注释 +FONT_FAMILY=字体 +FONT_SIZE=文字大小 +FONT_BOLD=粗体 +FONT_ITALIC=斜体 +UNDO=撤销 +REDO=重做 +INSERT=插入 +SAVE=保存 +NOTE=注释 + +ADD_TOPIC=添加节点 +LOADING=载入中…… +EXPORT=导出 +PRINT=打印 +PUBLISH=公开 +COLLABORATE=共享 +HISTORY=历史 +DISCARD_CHANGES=清除改变 +FONT_COLOR=文本颜色 +SAVING=保存中…… +SAVE_COMPLETE=完成保存 + +ZOOM_IN_ERROR=缩放过多。 +ZOOM_ERROR=不能再缩放。 +ONLY_ONE_TOPIC_MUST_BE_SELECTED=不能创建节点。仅能选择一个节点。 +ONE_TOPIC_MUST_BE_SELECTED=不能创建节点。必须选择一个节点。 +ONLY_ONE_TOPIC_MUST_BE_SELECTED_COLLAPSE=子节点不能折叠。必须选择一个节点。 +SAVE_COULD_NOT_BE_COMPLETED=保存未完成。稍后再试。 +UNEXPECTED_ERROR_LOADING=抱歉,突遭错误,我们无法处理你的请求。\n尝试重新装载编辑器。如果问题依然存在请联系support@wisemapping.com。 +MAIN_TOPIC=主节点 +SUB_TOPIC=子节点 +ISOLATED_TOPIC=独立节点 +CENTRAL_TOPIC=中心节点 +SHORTCUTS=快捷键 +MULTIPLE_LINES=Add multilines text node +COPY_AND_PASTE_TOPICS=Copy Topics diff --git a/mindplot/src/main/resources/messages_zh_TW.properties b/mindplot/src/main/resources/messages_zh_TW.properties index 7f981f69..8d5533c6 100644 --- a/mindplot/src/main/resources/messages_zh_TW.properties +++ b/mindplot/src/main/resources/messages_zh_TW.properties @@ -1,45 +1,47 @@ -ZOOM_IN=放大 -ZOOM_OUT=縮小 -TOPIC_SHAPE=節點外形 -TOPIC_ADD=添加節點 -TOPIC_DELETE=刪除節點 -TOPIC_ICON=加入圖示 -TOPIC_LINK=添加鏈接 -TOPIC_RELATIONSHIP=關係 -TOPIC_COLOR=節點顏色 -TOPIC_BORDER_COLOR=邊框顏色 -TOPIC_NOTE=添加注釋 -FONT_FAMILY=字體 -FONT_SIZE=文字大小 -FONT_BOLD=粗體 -FONT_ITALIC=斜體 -UNDO=撤銷 -REDO=重做 -INSERT=插入 -SAVE=保存 -NOTE=注釋 - -ADD_TOPIC=添加節點 -LOADING=載入中…… -EXPORT=導出 -PRINT=列印 -PUBLISH=公開 -COLLABORATE=共用 -HISTORY=歷史 -DISCARD_CHANGES=清除改變 -FONT_COLOR=文本顏色 -SAVING=保存中…… -SAVE_COMPLETE=完成保存 - -ZOOM_IN_ERROR=縮放過多。 -ZOOM_ERROR=不能再縮放。 -ONLY_ONE_TOPIC_MUST_BE_SELECTED=不能創建節點。僅能選擇一個節點。 -ONE_TOPIC_MUST_BE_SELECTED=不能創建節點。必須選擇一個節點。 -ONLY_ONE_TOPIC_MUST_BE_SELECTED_COLLAPSE=子節點不能折疊。必須選擇一個節點。 -SAVE_COULD_NOT_BE_COMPLETED=保存未完成。稍後再試。 -UNEXPECTED_ERROR_LOADING=抱歉,突遭錯誤,我們無法處理你的請求。\n嘗試重新裝載編輯器。如果問題依然存在請聯繫support@wisemapping.com。 -MAIN_TOPIC=主節點 -SUB_TOPIC=子節點 -ISOLATED_TOPIC=獨立節點 -CENTRAL_TOPIC=中心節點 -SHORTCUTS=快捷鍵 +ZOOM_IN=放大 +ZOOM_OUT=縮小 +TOPIC_SHAPE=節點外形 +TOPIC_ADD=添加節點 +TOPIC_DELETE=刪除節點 +TOPIC_ICON=加入圖示 +TOPIC_LINK=添加鏈接 +TOPIC_RELATIONSHIP=關係 +TOPIC_COLOR=節點顏色 +TOPIC_BORDER_COLOR=邊框顏色 +TOPIC_NOTE=添加注釋 +FONT_FAMILY=字體 +FONT_SIZE=文字大小 +FONT_BOLD=粗體 +FONT_ITALIC=斜體 +UNDO=撤銷 +REDO=重做 +INSERT=插入 +SAVE=保存 +NOTE=注釋 + +ADD_TOPIC=添加節點 +LOADING=載入中…… +EXPORT=導出 +PRINT=列印 +PUBLISH=公開 +COLLABORATE=共用 +HISTORY=歷史 +DISCARD_CHANGES=清除改變 +FONT_COLOR=文本顏色 +SAVING=保存中…… +SAVE_COMPLETE=完成保存 + +ZOOM_IN_ERROR=縮放過多。 +ZOOM_ERROR=不能再縮放。 +ONLY_ONE_TOPIC_MUST_BE_SELECTED=不能創建節點。僅能選擇一個節點。 +ONE_TOPIC_MUST_BE_SELECTED=不能創建節點。必須選擇一個節點。 +ONLY_ONE_TOPIC_MUST_BE_SELECTED_COLLAPSE=子節點不能折疊。必須選擇一個節點。 +SAVE_COULD_NOT_BE_COMPLETED=保存未完成。稍後再試。 +UNEXPECTED_ERROR_LOADING=抱歉,突遭錯誤,我們無法處理你的請求。\n嘗試重新裝載編輯器。如果問題依然存在請聯繫support@wisemapping.com。 +MAIN_TOPIC=主節點 +SUB_TOPIC=子節點 +ISOLATED_TOPIC=獨立節點 +CENTRAL_TOPIC=中心節點 +SHORTCUTS=快捷鍵 +MULTIPLE_LINES=Add multilines text node +COPY_AND_PASTE_TOPICS=Copy Topics diff --git a/wise-editor/src/main/webapp/samples/welcome.xml b/wise-editor/src/main/webapp/samples/welcome.xml index c26ee3fb..5267dbee 100644 --- a/wise-editor/src/main/webapp/samples/welcome.xml +++ b/wise-editor/src/main/webapp/samples/welcome.xml @@ -1,46 +1,52 @@ - + - + + + + + + - + - - + + - - - + + + + + + + + + + - - - - + + + + + + + + + + + - + - - - - - - - - - - - - - - - - - - - + + + + \ No newline at end of file diff --git a/wise-webapp/src/main/webapp/jsp/mindmapEditorKeyboard.jsp b/wise-webapp/src/main/webapp/jsp/mindmapEditorKeyboard.jsp index 505e08b2..31505233 100644 --- a/wise-webapp/src/main/webapp/jsp/mindmapEditorKeyboard.jsp +++ b/wise-webapp/src/main/webapp/jsp/mindmapEditorKeyboard.jsp @@ -66,6 +66,17 @@ | F2 | F2 + + + Ctrl + Enter + ⌘ + Enter + + + + Ctrl + c/Ctrl + v + ⌘ + c/⌘ + c + + Space bar