Merge branch 'master' of ssh://wisemapping.com/var/git-repos/wise-source

This commit is contained in:
Gonzalo Bellver 2011-12-02 14:08:28 -03:00
commit d20a4bfcea
24 changed files with 145 additions and 76 deletions

View File

@ -84,9 +84,18 @@
<filelist dir="${basedir}/src/main/javascript/" files="DragTopic.js"/>
<filelist dir="${basedir}/src/main/javascript/" files="DragManager.js"/>
<filelist dir="${basedir}/src/main/javascript/" files="DragPivot.js"/>
<filelist dir="${basedir}/src/main/javascript/" files="Board.js"/>
<filelist dir="${basedir}/src/main/javascript/" files="CentralTopicBoard.js"/>
<filelist dir="${basedir}/src/main/javascript/" files="MainTopicBoard.js"/>
<filelist dir="${basedir}/src/main/javascript/layout/boards/original/"
files="Board.js"/>
<filelist dir="${basedir}/src/main/javascript/layout/boards/original/"
files="CentralTopicBoard.js"/>
<filelist dir="${basedir}/src/main/javascript/layout/boards/original/"
files="MainTopicBoard.js"/>
<filelist dir="${basedir}/src/main/javascript/layout/boards/original/"
files="FixedDistanceBoard.js"/>
<filelist dir="${basedir}/src/main/javascript//layout/boards/original/"
files="VariableDistanceBoard.js"/>
<filelist dir="${basedir}/src/main/javascript/" files="ConnectionLine.js"/>
<filelist dir="${basedir}/src/main/javascript/" files="RelationshipLine.js"/>
<filelist dir="${basedir}/src/main/javascript/" files="DragTopicPositioner.js"/>
@ -94,10 +103,9 @@
<filelist dir="${basedir}/src/main/javascript/" files="MultilineTextEditor.js"/>
<!--<filelist dir="${basedir}/src/main/javascript/" files="RichTextEditor.js"/>-->
<filelist dir="${basedir}/src/main/javascript/" files="TextEditorFactory.js"/>
<filelist dir="${basedir}/src/main/javascript/" files="VariableDistanceBoard.js"/>
<filelist dir="${basedir}/src/main/javascript/" files="util/Shape.js"/>
<filelist dir="${basedir}/src/main/javascript/" files="FixedDistanceBoard.js"/>
<filelist dir="${basedir}/src/main/javascript/" files="BoardEntry.js"/>
<filelist dir="${basedir}/src/main/javascript/layout/boards/original/"
files="BoardEntry.js"/>
<filelist dir="${basedir}/src/main/javascript/" files="ModelCodeName.js"/>
<filelist dir="${basedir}/src/main/javascript/"
files="XMLMindmapSerializer_Pela.js"/>
@ -152,21 +160,21 @@
<filelist dir="${basedir}/src/main/javascript/"
files="commands/MoveControlPointCommand.js"/>
<!--<filelist dir="${basedir}/src/main/javascript/"-->
<!--files="commands/freeMind/DragTopicCommand.js"/>-->
<!--files="commands/freeMind/DragTopicCommand.js"/>-->
<!--<filelist dir="${basedir}/src/main/javascript/"-->
<!--files="commands/freeMind/ReconnectTopicCommand.js"/>-->
<!--files="commands/freeMind/ReconnectTopicCommand.js"/>-->
<filelist dir="${basedir}/src/main/javascript/"
files="layout/boards/Board.js"/>
<!--<filelist dir="${basedir}/src/main/javascript/"-->
<!--files="layout/boards/freemind/Board.js"/>-->
<!--files="layout/boards/freemind/Board.js"/>-->
<!--<filelist dir="${basedir}/src/main/javascript/"-->
<!--files="layout/boards/freemind/Entry.js"/>-->
<!--files="layout/boards/freemind/Entry.js"/>-->
<!--<filelist dir="${basedir}/src/main/javascript/"-->
<!--files="layout/boards/freemind/CentralTopicBoard.js"/>-->
<!--files="layout/boards/freemind/CentralTopicBoard.js"/>-->
<!--<filelist dir="${basedir}/src/main/javascript/"-->
<!--files="layout/boards/freemind/MainTopicBoard.js"/>-->
<!--files="layout/boards/freemind/MainTopicBoard.js"/>-->
<filelist dir="${basedir}/src/main/javascript/"
files="layout/BaseLayoutManager.js"/>
<filelist dir="${basedir}/src/main/javascript/"

View File

@ -277,4 +277,6 @@ mindplot.MainTopic = new Class({
addSibling : function() {
var order = this.getOrder();
}
});
});
mindplot.MainTopic.DEFAULT_MAIN_TOPIC_HEIGHT = 18;

View File

@ -1254,3 +1254,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_FOCUS = {fillColor:'rgb(244,184,45)',x:0,y:0};
mindplot.Topic.INNER_RECT_ATTRIBUTES = {stroke:'2 solid'};

View File

@ -21,18 +21,18 @@ mindplot.commands.AddIconToTopicCommand = new Class({
initialize: function(topicId, iconType) {
$assert($defined(topicId), 'topicId can not be null');
$assert(iconType, 'iconType can not be null');
this._objectsIds = topicId;
this._topicsIds = topicId;
this._iconType = iconType;
},
execute: function(commandContext) {
var topic = commandContext.findTopics(this._objectsIds)[0];
var topic = commandContext.findTopics(this._topicsIds)[0];
var iconImg = topic.addIcon(this._iconType, commandContext._designer);
this._iconModel = iconImg.getModel();
},
undoExecute: function(commandContext) {
var topic = commandContext.findTopics(this._objectsIds)[0];
var topic = commandContext.findTopics(this._topicsIds)[0];
topic.removeIcon(this._iconModel);
}
});

View File

@ -19,14 +19,14 @@
mindplot.commands.ChangeLinkToTopicCommand = new Class({
Extends:mindplot.Command,
initialize: function(topicId, url) {
$assert(topicId, 'topicId can not be null');
this._objectsIds = topicId;
$assert($defined(topicId), 'topicId can not be null');
this._topicsIds = topicId;
this._url = url;
this._id = mindplot.Command._nextUUID();
},
execute: function(commandContext) {
var topic = commandContext.findTopics(this._objectsIds)[0];
var topic = commandContext.findTopics(this._topicsIds)[0];
if (topic.hasLink()) {
var model = topic.getModel();
var link = model.getLinks()[0];
@ -37,7 +37,7 @@ mindplot.commands.ChangeLinkToTopicCommand = new Class({
},
undoExecute: function(commandContext) {
var topic = commandContext.findTopics(this._objectsIds)[0];
var topic = commandContext.findTopics(this._topicsIds)[0];
if (this._oldtext) {
topic.removeLink();
topic.addLink(this._oldUrl);

View File

@ -19,15 +19,15 @@
mindplot.commands.ChangeNoteToTopicCommand = new Class({
Extends:mindplot.Command,
initialize: function(topicId, text) {
$assert(topicId, 'topicId can not be null');
this._objectsIds = topicId;
$assert($defined(topicId), 'topicId can not be null');
this._topicsIds = topicId;
this._text = text;
this._oldtext = null;
this._id = mindplot.Command._nextUUID();
},
execute: function(commandContext) {
var topic = commandContext.findTopics(this._objectsIds)[0];
execute: function(commandContext) {
var topic = commandContext.findTopics(this._topicsIds)[0];
if (topic.hasNote()) {
var model = topic.getModel();
var notes = model.getNotes()[0];
@ -38,7 +38,7 @@ mindplot.commands.ChangeNoteToTopicCommand = new Class({
},
undoExecute: function(commandContext) {
var topic = commandContext.findTopics(this._objectsIds)[0];
var topic = commandContext.findTopics(this._topicsIds)[0];
if (this._oldtext) {
topic.removeNote();
topic.addNote(this._oldtext);

View File

@ -19,6 +19,8 @@
mindplot.commands.DeleteCommand = new Class({
Extends:mindplot.Command,
initialize: function(topicIds, relIds) {
$assert($defined(topicIds), 'topicIds can not be null');
this._relIds = relIds;
this._topicIds = topicIds;
this._deletedTopicModels = [];

View File

@ -21,7 +21,7 @@ mindplot.commands.DragTopicCommand = new Class({
initialize: function(topicIds, position, order, parentTopic) {
$assert(topicIds, "topicIds must be defined");
this._objectsIds = topicIds;
this._topicsIds = topicIds;
if ($defined(parentTopic))
this._parentId = parentTopic.getId();
@ -32,7 +32,7 @@ mindplot.commands.DragTopicCommand = new Class({
execute: function(commandContext) {
var topic = commandContext.findTopics([this._objectsIds])[0];
var topic = commandContext.findTopics([this._topicsIds])[0];
// Save old position ...
var origParentTopic = topic.getOutgoingConnectedTopic();

View File

@ -20,17 +20,17 @@ mindplot.commands.GenericFunctionCommand = new Class({
Extends:mindplot.Command,
initialize: function(commandFunc, topicsIds,value) {
$assert(commandFunc, "commandFunc must be defined");
$assert(topicsIds, "topicsIds must be defined");
$assert($defined(topicsIds), "topicsIds must be defined");
this._value = value;
this._objectsIds = topicsIds;
this._topicsIds = topicsIds;
this._commandFunc = commandFunc;
this._oldValues = [];
this._id = mindplot.Command._nextUUID();
},
execute: function(commandContext) {
if (!this.applied) {
var topics = commandContext.findTopics(this._objectsIds);
var topics = commandContext.findTopics(this._topicsIds);
topics.forEach(function(topic) {
var oldValue = this._commandFunc(topic, this._value);
this._oldValues.push(oldValue);
@ -43,7 +43,7 @@ mindplot.commands.GenericFunctionCommand = new Class({
},
undoExecute: function(commandContext) {
if (this.applied) {
var topics = commandContext.findTopics(this._objectsIds);
var topics = commandContext.findTopics(this._topicsIds);
topics.forEach(function(topic, index) {
this._commandFunc(topic, this._oldValues[index]);

View File

@ -19,19 +19,19 @@
mindplot.commands.RemoveIconFromTopicCommand = new Class({
Extends:mindplot.Command,
initialize: function(topicIds, iconModel) {
$assert(topicIds, 'topicIds can not be null');
$assert($defined(topicIds), 'topicIds can not be null');
$assert(iconModel, 'iconModel can not be null');
this._objectsIds = topicIds;
this._topicsIds = topicIds;
this._iconModel = iconModel;
},
execute: function(commandContext) {
var topic = commandContext.findTopics(this._objectsIds)[0];
var topic = commandContext.findTopics(this._topicsIds)[0];
topic.removeIcon(this._iconModel);
},
undoExecute: function(commandContext) {
var topic = commandContext.findTopics(this._objectsIds)[0];
var topic = commandContext.findTopics(this._topicsIds)[0];
var iconType = this._iconModel.getIconType();
var iconImg = topic.addIcon(iconType, commandContext._designer);
this._iconModel = iconImg.getModel();

View File

@ -19,12 +19,12 @@
mindplot.commands.RemoveLinkFromTopicCommand = new Class({
Extends:mindplot.Command,
initialize: function(topicId) {
$assert(topicId, 'topicId can not be null');
this._objectsIds = topicId;
$assert($defined(topicId), 'topicId can not be null');
this._topicsIds = topicId;
},
execute: function(commandContext) {
var topic = commandContext.findTopics(this._objectsIds)[0];
var topic = commandContext.findTopics(this._topicsIds)[0];
var model = topic.getModel();
var links = model.getLinks()[0];
this._text = links.getUrl();
@ -32,7 +32,7 @@ mindplot.commands.RemoveLinkFromTopicCommand = new Class({
},
undoExecute: function(commandContext) {
var topic = commandContext.findTopics(this._objectsIds)[0];
var topic = commandContext.findTopics(this._topicsIds)[0];
topic.addLink(this._url, commandContext._designer);
}
});

View File

@ -19,18 +19,18 @@
mindplot.commands.RemoveNoteFromTopicCommand = new Class({
Extends:mindplot.Command,
initialize: function(topicId) {
$assert(topicId, 'topicId can not be null');
this._objectsIds = topicId;
$assert($defined(topicId), 'topicId can not be null');
this._topicsIds = topicId;
},
execute: function(commandContext) {
var topic = commandContext.findTopics(this._objectsIds)[0];
var topic = commandContext.findTopics(this._topicsIds)[0];
var model = topic.getModel();
var notes = model.getNotes()[0];
this._text = notes.getText();
topic.removeNote();
},
undoExecute: function(commandContext) {
var topic = commandContext.findTopics(this._objectsIds)[0];
var topic = commandContext.findTopics(this._topicsIds)[0];
topic.addNote(this._text, commandContext._designer);
}
});

View File

@ -20,6 +20,8 @@ var mindplot = {};
mindplot.util = {};
mindplot.commands = {};
mindplot.layout = {};
mindplot.layout.boards = {};
mindplot.layout.boards.original = {};
mindplot.widget = {};
mindplot.model = {};
mindplot.collaboration = {};

View File

@ -1,3 +1,21 @@
/*
* 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.layout.BaseLayoutManager = new Class({
options: {

View File

@ -1,3 +1,21 @@
/*
* 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.layout.FreeMindLayoutManager = mindplot.layout.BaseLayoutManager.extend({
options:{

View File

@ -1,3 +1,21 @@
/*
* 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.layout.LayoutManagerFactory = {};
mindplot.layout.LayoutManagerFactory.managers = {
OriginalLayoutManager:mindplot.layout.OriginalLayoutManager,

View File

@ -133,11 +133,11 @@ mindplot.layout.OriginalLayoutManager = new Class({
},
_createMainTopicBoard:function(node) {
return new mindplot.MainTopicBoard(node, this);
return new mindplot.layout.boards.original.MainTopicBoard(node, this);
},
_createCentralTopicBoard:function(node) {
return new mindplot.CentralTopicBoard(node, this);
return new mindplot.layout.boards.original.CentralTopicBoard(node, this);
},
getClassName:function() {

View File

@ -1,5 +1,3 @@
mindplot.layout.boards = {};
mindplot.layout.boards.Board = new Class({
Implements: [Events,Options],
options: {

View File

@ -16,11 +16,11 @@
* limitations under the License.
*/
mindplot.Board = new Class({
mindplot.layout.boards.original.Board = new Class({
initialize : function(defaultHeight, referencePoint) {
$assert(referencePoint, "referencePoint can not be null");
this._defaultWidth = defaultHeight;
this._entries = new mindplot.BidirectionalArray();
this._entries = new mindplot.layout.boards.original.BidirectionalArray();
this._referencePoint = referencePoint;
},
@ -58,7 +58,7 @@ mindplot.Board = new Class({
/**
* ---------------------------------------
*/
mindplot.BidirectionalArray = new Class({
mindplot.layout.boards.original.BidirectionalArray = new Class({
initialize: function() {
this._leftElem = [];

View File

@ -16,7 +16,7 @@
* limitations under the License.
*/
mindplot.BoardEntry = new Class({
mindplot.layout.boards.original.BoardEntry = new Class({
initialize:function(lowerLimit, upperLimit, order) {
if ($defined(lowerLimit) && $defined(upperLimit)) {
$assert(lowerLimit < upperLimit, 'lowerLimit can not be greater that upperLimit');

View File

@ -16,13 +16,13 @@
* limitations under the License.
*/
mindplot.CentralTopicBoard = new Class({
Extends: mindplot.Board,
mindplot.layout.boards.original.CentralTopicBoard = new Class({
Extends:mindplot.layout.boards.original.Board,
initialize:function(centralTopic, layoutManager) {
var point = new core.Point(0, 0);
this._layoutManager = layoutManager;
this._rightBoard = new mindplot.VariableDistanceBoard(50, point);
this._leftBoard = new mindplot.VariableDistanceBoard(50, point);
this._rightBoard = new mindplot.layout.boards.original.VariableDistanceBoard(50, point);
this._leftBoard = new mindplot.layout.boards.original.VariableDistanceBoard(50, point);
this._centralTopic = centralTopic;
},

View File

@ -16,8 +16,8 @@
* limitations under the License.
*/
mindplot.FixedDistanceBoard = new Class({
Extends:mindplot.Board,
mindplot.layout.boards.original.FixedDistanceBoard = new Class({
Extends:mindplot.layout.boards.original.Board,
initialize:function(defaultHeight, topic, layoutManager) {
this._topic = topic;
this._layoutManager = layoutManager;
@ -56,7 +56,7 @@ mindplot.FixedDistanceBoard = new Class({
},
createBoardEntry : function(lowerLimit, upperLimit, order) {
var result = new mindplot.BoardEntry(lowerLimit, upperLimit, order);
var result = new mindplot.layout.boards.original.BoardEntry(lowerLimit, upperLimit, order);
var xPos = this.workoutXBorderDistance();
result.setXPosition(xPos);
return result;
@ -100,9 +100,9 @@ mindplot.FixedDistanceBoard = new Class({
var result;
if (topicPosition.x >= 0) {
// It's at right.
result = topicPosition.x + halfTargetWidth + mindplot.FixedDistanceBoard.MAIN_TOPIC_TO_MAIN_TOPIC_DISTANCE;
result = topicPosition.x + halfTargetWidth + mindplot.layout.boards.original.FixedDistanceBoard.MAIN_TOPIC_TO_MAIN_TOPIC_DISTANCE;
} else {
result = topicPosition.x - (halfTargetWidth + mindplot.FixedDistanceBoard.MAIN_TOPIC_TO_MAIN_TOPIC_DISTANCE);
result = topicPosition.x - (halfTargetWidth + mindplot.layout.boards.original.FixedDistanceBoard.MAIN_TOPIC_TO_MAIN_TOPIC_DISTANCE);
}
return result;
},
@ -140,13 +140,13 @@ mindplot.FixedDistanceBoard = new Class({
var topicBoardHeight = topicBoard.getHeight();
height += topicBoardHeight + mindplot.FixedDistanceBoard.INTER_TOPIC_DISTANCE;
height += topicBoardHeight + mindplot.layout.boards.original.FixedDistanceBoard.INTER_TOPIC_DISTANCE;
}
}
}
else {
var topic = this._topic;
height = topic.getSize().height + mindplot.FixedDistanceBoard.INTER_TOPIC_DISTANCE;
height = topic.getSize().height + mindplot.layout.boards.original.FixedDistanceBoard.INTER_TOPIC_DISTANCE;
}
var oldHeight = this._height;
@ -193,7 +193,7 @@ mindplot.FixedDistanceBoard = new Class({
var topicBoard = this._layoutManager.getTopicBoardForTopic(currentTopic);
var topicBoardHeight = topicBoard.getHeight();
upperLimit = lowerLimit + topicBoardHeight + mindplot.FixedDistanceBoard.INTER_TOPIC_DISTANCE;
upperLimit = lowerLimit + topicBoardHeight + mindplot.layout.boards.original.FixedDistanceBoard.INTER_TOPIC_DISTANCE;
e.setUpperLimit(upperLimit);
lowerLimit = upperLimit;
@ -277,8 +277,10 @@ mindplot.FixedDistanceBoard = new Class({
return result;
}
})
;
mindplot.FixedDistanceBoard.INTER_TOPIC_DISTANCE = 6;
mindplot.FixedDistanceBoard.MAIN_TOPIC_TO_MAIN_TOPIC_DISTANCE = 60;
});
mindplot.layout.boards.original.FixedDistanceBoard.MAIN_TOPIC_TO_MAIN_TOPIC_DISTANCE = 60;
mindplot.layout.boards.original.FixedDistanceBoard.INTER_TOPIC_DISTANCE = 6;

View File

@ -16,8 +16,8 @@
* limitations under the License.
*/
mindplot.MainTopicBoard = new Class({
Extends:mindplot.Board,
mindplot.layout.boards.original.MainTopicBoard = new Class({
Extends:mindplot.layout.boards.original.Board,
initialize:function(topic, layoutManager) {
this._layoutManager = layoutManager;
this._topic = topic;
@ -29,7 +29,7 @@ mindplot.MainTopicBoard = new Class({
_getBoard: function() {
if (!$defined(this._board)) {
var topic = this._topic;
this._board = new mindplot.FixedDistanceBoard(mindplot.MainTopicBoard.DEFAULT_MAIN_TOPIC_HEIGHT, topic, this._layoutManager);
this._board = new mindplot.layout.boards.original.FixedDistanceBoard(mindplot.MainTopic.DEFAULT_MAIN_TOPIC_HEIGHT, topic, this._layoutManager);
}
return this._board;
},
@ -124,6 +124,4 @@ mindplot.MainTopicBoard = new Class({
mindplot.EventBus.instance.fireEvent(mindplot.EventBus.events.NodeRepositionateEvent, [connectedTopic]);
}
}
});
mindplot.MainTopicBoard.DEFAULT_MAIN_TOPIC_HEIGHT = 18;
});

View File

@ -16,8 +16,8 @@
* limitations under the License.
*/
mindplot.VariableDistanceBoard = new Class({
Extends: mindplot.Board,
mindplot.layout.boards.original.VariableDistanceBoard = new Class({
Extends: mindplot.layout.boards.original.Board,
initialize: function(defaultHeight, referencePoint) {
this.parent(defaultHeight, referencePoint);
var zeroEntryCoordinate = referencePoint.y;
@ -66,7 +66,7 @@ mindplot.VariableDistanceBoard = new Class({
},
createBoardEntry:function(lowerLimit, upperLimit, order) {
return new mindplot.BoardEntry(lowerLimit, upperLimit, order);
return new mindplot.layout.boards.original.BoardEntry(lowerLimit, upperLimit, order);
},
updateReferencePoint:function(position) {