From f704e730c977e3366accad79ee8bc2055e8c3a68 Mon Sep 17 00:00:00 2001 From: Paulo Gustavo Veiga Date: Wed, 29 Feb 2012 18:52:07 -0300 Subject: [PATCH] Minor bug fixing. --- mindplot/src/main/javascript/MediaTopic.js | 136 ------------------ mindplot/src/main/javascript/Topic.js | 5 +- .../src/main/javascript/model/INodeModel.js | 2 +- .../src/main/webapp/jsp/mindmapPrint.jsp | 2 +- 4 files changed, 5 insertions(+), 140 deletions(-) delete mode 100644 mindplot/src/main/javascript/MediaTopic.js diff --git a/mindplot/src/main/javascript/MediaTopic.js b/mindplot/src/main/javascript/MediaTopic.js deleted file mode 100644 index aaad649a..00000000 --- a/mindplot/src/main/javascript/MediaTopic.js +++ /dev/null @@ -1,136 +0,0 @@ -/* - * Copyright [2011] [wisemapping] - * - * Licensed under WiseMapping Public License, Version 1.0 (the "License"). - * It is basically the Apache License, Version 2.0 (the "License") plus the - * "powered by wisemapping" text requirement on every single page; - * you may not use this file except in compliance with the License. - * You may obtain a copy of the license at - * - * http://www.wisemapping.org/license - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - - -mindplot.MediaTopic = new Class({ - Extends:mindplot.Topic, - initialize : function(model, options) { - this.parent(model, options); - }, - - getInnerShape : function() { - if (!$defined(this._innerShape)) { - // Create inner box. - var model = this.getModel(); - - this._innerShape = new web2d.Image(); - this._innerShape.setHref(model.getImageUrl()); - this._innerShape.setPosition(0, 0); - } - return this._innerShape; - }, - - getOuterShape : function() { - if (!$defined(this._outerShape)) { - var rect = new web2d.Rect(0, mindplot.Topic.OUTER_SHAPE_ATTRIBUTES); - rect.setPosition(-2, -3); - rect.setOpacity(0); - this._outerShape = rect; - } - - return this._outerShape; - }, - - - _buildShape : function() { - var groupAttributes = {width: 100, height:100,coordSizeWidth:100,coordSizeHeight:100}; - var group = new web2d.Group(groupAttributes); - this._set2DElement(group); - - // Shape must be build based on the model width ... - var outerShape = this.getOuterShape(); - var innerShape = this.getInnerShape(); - var shrinkConnector = this.getShrinkConnector(); - - // Add to the group ... - group.appendChild(outerShape); - group.appendChild(innerShape); - - // Update figure size ... -// var model = this.getModel(); -// if (model.getLinks().length != 0 || model.getNotes().length != 0 || model.getIcons().length != 0) { -// this.getOrBuildIconGroup(); -// } - - if (this.getType() != mindplot.model.INodeModel.CENTRAL_TOPIC_TYPE) { - shrinkConnector.addToWorkspace(group); - } - - // Register listeners ... - this._registerDefaultListenersToElement(group, this); - - - }, - - workoutOutgoingConnectionPoint : function(targetPosition) { - $assert(targetPosition, 'targetPoint can not be null'); - var pos = this.getPosition(); - - var result; - result = new core.Point(); - var groupPosition = this._elem2d.getPosition(); - var innerShareSize = this.getInnerShape().getSize(); - var isAtRight = mindplot.util.Shape.isAtRight(targetPosition, pos); - - result = mindplot.util.Shape.calculateRectConnectionPoint(pos, this.getSize(), isAtRight, true); - return result; - }, - - createDragNode : function(layoutManager) { - var result = this.parent(layoutManager); - - // Is the node already connected ? - var targetTopic = this.getOutgoingConnectedTopic(); - if ($defined(targetTopic)) { - result.connectTo(targetTopic); - result.setVisibility(false); - } - return result; - }, - - _adjustShapes : function() { - if (this._isInWorkspace) { - - var size = this.getModel().getSize(); - this.setSize(size, true); - - } - }, - - _updatePositionOnChangeSize : function(oldSize, newSize) { - - var xOffset = Math.round((newSize.width - oldSize.width) / 2); - var pos = this.getPosition(); - if ($defined(pos)) { - if (pos.x > 0) { - pos.x = pos.x + xOffset; - } else { - pos.x = pos.x - xOffset; - } - this.setPosition(pos); - } - }, - - updateTopicShape : function() { - // Todo: verify ... - }, - - closeEditors : function() { - //@Todo: - } -}); diff --git a/mindplot/src/main/javascript/Topic.js b/mindplot/src/main/javascript/Topic.js index 9e62422d..15ec72d8 100644 --- a/mindplot/src/main/javascript/Topic.js +++ b/mindplot/src/main/javascript/Topic.js @@ -68,7 +68,6 @@ mindplot.Topic = new Class({ setShapeType : function(type) { this._setShapeType(type, true); - }, getParent : function() { @@ -164,8 +163,10 @@ mindplot.Topic = new Class({ if (type == mindplot.model.TopicShape.RECTANGLE) { result = new web2d.Rect(0, attributes); + }else if(type == mindplot.model.TopicShape.IMAGE){ + throw "Must be implemented ..."; } - else if (type == mindplot.model.TopicShape.ELIPSE) { + else if (type == mindplot.model.TopicShape.ELLIPSE) { result = new web2d.Rect(0.9, attributes); } else if (type == mindplot.model.TopicShape.ROUNDED_RECT) { diff --git a/mindplot/src/main/javascript/model/INodeModel.js b/mindplot/src/main/javascript/model/INodeModel.js index 78883e86..e0e98570 100644 --- a/mindplot/src/main/javascript/model/INodeModel.js +++ b/mindplot/src/main/javascript/model/INodeModel.js @@ -293,7 +293,7 @@ mindplot.model.TopicShape = { RECTANGLE : 'rectagle', ROUNDED_RECT : 'rounded rectagle', - ELIPSE : 'elipse', + ELLIPSE : 'elipse', LINE : 'line', IMAGE : 'image' }; diff --git a/wise-webapp/src/main/webapp/jsp/mindmapPrint.jsp b/wise-webapp/src/main/webapp/jsp/mindmapPrint.jsp index c6800919..8a4db9e9 100644 --- a/wise-webapp/src/main/webapp/jsp/mindmapPrint.jsp +++ b/wise-webapp/src/main/webapp/jsp/mindmapPrint.jsp @@ -42,7 +42,7 @@ designer = buildDesigner(editorProperties); var domDocument = core.Utils.createDocumentFromText(mapXml); - var serializer = mindplot.persistence.MLSerializerFactory.getSerializerFromDocument(domDocument); + var serializer = mindplot.persistence.XMLSerializerFactory.getSerializerFromDocument(domDocument); var mindmap = serializer.loadFromDom(domDocument, mapId); // Now, load the map ...