Move layout files in order to reflethe final layout structure.

This commit is contained in:
Paulo Veiga 2011-12-01 18:07:19 -03:00
parent 4d3baac09d
commit d62d4af766
15 changed files with 113 additions and 46 deletions

View File

@ -84,9 +84,18 @@
<filelist dir="${basedir}/src/main/javascript/" files="DragTopic.js"/> <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="DragManager.js"/>
<filelist dir="${basedir}/src/main/javascript/" files="DragPivot.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/layout/boards/original/"
<filelist dir="${basedir}/src/main/javascript/" files="CentralTopicBoard.js"/> files="Board.js"/>
<filelist dir="${basedir}/src/main/javascript/" files="MainTopicBoard.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="ConnectionLine.js"/>
<filelist dir="${basedir}/src/main/javascript/" files="RelationshipLine.js"/> <filelist dir="${basedir}/src/main/javascript/" files="RelationshipLine.js"/>
<filelist dir="${basedir}/src/main/javascript/" files="DragTopicPositioner.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="MultilineTextEditor.js"/>
<!--<filelist dir="${basedir}/src/main/javascript/" files="RichTextEditor.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="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="util/Shape.js"/>
<filelist dir="${basedir}/src/main/javascript/" files="FixedDistanceBoard.js"/> <filelist dir="${basedir}/src/main/javascript/layout/boards/original/"
<filelist dir="${basedir}/src/main/javascript/" files="BoardEntry.js"/> files="BoardEntry.js"/>
<filelist dir="${basedir}/src/main/javascript/" files="ModelCodeName.js"/> <filelist dir="${basedir}/src/main/javascript/" files="ModelCodeName.js"/>
<filelist dir="${basedir}/src/main/javascript/" <filelist dir="${basedir}/src/main/javascript/"
files="XMLMindmapSerializer_Pela.js"/> files="XMLMindmapSerializer_Pela.js"/>

View File

@ -278,3 +278,5 @@ mindplot.MainTopic = new Class({
var order = this.getOrder(); 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 = {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'};

View File

@ -20,6 +20,8 @@ var mindplot = {};
mindplot.util = {}; mindplot.util = {};
mindplot.commands = {}; mindplot.commands = {};
mindplot.layout = {}; mindplot.layout = {};
mindplot.layout.boards = {};
mindplot.layout.boards.original = {};
mindplot.widget = {}; mindplot.widget = {};
mindplot.model = {}; mindplot.model = {};
mindplot.collaboration = {}; 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({ mindplot.layout.BaseLayoutManager = new Class({
options: { 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({ mindplot.layout.FreeMindLayoutManager = mindplot.layout.BaseLayoutManager.extend({
options:{ 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 = {};
mindplot.layout.LayoutManagerFactory.managers = { mindplot.layout.LayoutManagerFactory.managers = {
OriginalLayoutManager:mindplot.layout.OriginalLayoutManager, OriginalLayoutManager:mindplot.layout.OriginalLayoutManager,

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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