From 8062a29323b7968ceeb03c6e489b6866d9d1c0db Mon Sep 17 00:00:00 2001 From: Paulo Veiga Date: Sat, 31 Dec 2011 14:52:13 -0300 Subject: [PATCH] - Exclude brix during export - More changes for layout manager. --- core-js/pepe.txy | 1 + installer/package-src.sh | 2 +- mindplot/pom.xml | 9 --------- mindplot/src/main/javascript/BubbleTip.js | 2 +- .../src/main/javascript/layout/BaseLayoutManager.js | 1 + mindplot/src/main/javascript/nlayout/OriginalLayout.js | 10 +++++++--- mindplot/src/main/javascript/nlayout/SymetricSorter.js | 8 ++++---- mindplot/src/main/javascript/nlayout/TestSuite.js | 7 +++++-- 8 files changed, 20 insertions(+), 20 deletions(-) create mode 100644 core-js/pepe.txy diff --git a/core-js/pepe.txy b/core-js/pepe.txy new file mode 100644 index 00000000..2f259b79 --- /dev/null +++ b/core-js/pepe.txy @@ -0,0 +1 @@ +s \ No newline at end of file diff --git a/installer/package-src.sh b/installer/package-src.sh index 02a9011d..505a4bb4 100755 --- a/installer/package-src.sh +++ b/installer/package-src.sh @@ -17,7 +17,7 @@ mvn clean # Prepare copy mkdir -p ${TMP_DIR} -rsync -aCv --exclude ".git" --exclude "wisemapping.i*" --exclude "*/*.iml" --exclude "*/wisemapping.log*" --exclude "**/.DS_Store" --exclude "*.textile" --exclude "**/.gitignore" --exclude "installer" --exclude "*/target" . ${TMP_DIR} +rsync -aCv --exclude ".git" --exclude "wisemapping.i*" --exclude "**/*/Brix*" --exclude "**/brix" --exclude "*/*.iml" --exclude "*/wisemapping.log*" --exclude "**/.DS_Store" --exclude "*.textile" --exclude "**/.gitignore" --exclude "installer" --exclude "*/target" . ${TMP_DIR} # Zip file [ ! -e ${OUTPUT_DIR} ] && mkdir ${OUTPUT_DIR} diff --git a/mindplot/pom.xml b/mindplot/pom.xml index 5571e12b..2dca66a1 100644 --- a/mindplot/pom.xml +++ b/mindplot/pom.xml @@ -68,7 +68,6 @@ - @@ -190,14 +189,6 @@ files="collaboration/framework/AbstractCollaborativeFramework.js"/> - - - - diff --git a/mindplot/src/main/javascript/BubbleTip.js b/mindplot/src/main/javascript/BubbleTip.js index db66c277..fbb0e680 100644 --- a/mindplot/src/main/javascript/BubbleTip.js +++ b/mindplot/src/main/javascript/BubbleTip.js @@ -90,7 +90,7 @@ mindplot.BubbleTip = new Class({ }.bind(this)}).start(0, 100); } }, - updatePosition : function(event) { + updateBranchPosition : function(event) { this._evt = new Event(event); }, close : function(event) { diff --git a/mindplot/src/main/javascript/layout/BaseLayoutManager.js b/mindplot/src/main/javascript/layout/BaseLayoutManager.js index 76ce90d4..977ad6fe 100644 --- a/mindplot/src/main/javascript/layout/BaseLayoutManager.js +++ b/mindplot/src/main/javascript/layout/BaseLayoutManager.js @@ -103,6 +103,7 @@ mindplot.layout.BaseLayoutManager = new Class({ var type = node.getModel().getType(); return type == mindplot.model.INodeModel.CENTRAL_TOPIC_TYPE; }, + getClassName:function() { return mindplot.layout.BaseLayoutManager.NAME; } diff --git a/mindplot/src/main/javascript/nlayout/OriginalLayout.js b/mindplot/src/main/javascript/nlayout/OriginalLayout.js index 435b9038..0bcb706f 100644 --- a/mindplot/src/main/javascript/nlayout/OriginalLayout.js +++ b/mindplot/src/main/javascript/nlayout/OriginalLayout.js @@ -31,7 +31,7 @@ mindplot.nlayout.OriginalLayout = new Class({ disconnectNode: function(nodeId) { var node = this._treeSet.find(nodeId); - $assert(this._treeSet.getParent(node),"Node already disconnected"); + $assert(this._treeSet.getParent(node), "Node already disconnected"); // Remove from children list. var sorter = node.getSorter(); @@ -42,7 +42,6 @@ mindplot.nlayout.OriginalLayout = new Class({ // Fire a basic validation ... sorter.verify(this._treeSet, node); - }, layout: function() { @@ -79,7 +78,12 @@ mindplot.nlayout.OriginalLayout = new Class({ children.forEach(function(child) { var offset = offsetById[child.getId()]; - var newPos = {x:parentPosition.x + offset.x,y:parentPosition.y + offset.y}; + var parentX = parentPosition.x; + var parentY = parentPosition.y; + + var verticalOffset = (node.getSize().height / 2); + + var newPos = {x:parentX + offset.x,y:parentY + offset.y + verticalOffset}; this._treeSet.updateBranchPosition(child, newPos); }.bind(this)); diff --git a/mindplot/src/main/javascript/nlayout/SymetricSorter.js b/mindplot/src/main/javascript/nlayout/SymetricSorter.js index 6b391135..dd9173c0 100644 --- a/mindplot/src/main/javascript/nlayout/SymetricSorter.js +++ b/mindplot/src/main/javascript/nlayout/SymetricSorter.js @@ -10,7 +10,6 @@ mindplot.nlayout.SymetricSorder = new Class({ return result; }, - _computeChildrenHeight : function(treeSet, node, heightCache) { var height = node.getSize().height + (mindplot.nlayout.SymetricSorder.INTERNODE_VERTICAL_PADDING * 2); // 2* Top and down padding; @@ -39,13 +38,13 @@ mindplot.nlayout.SymetricSorder = new Class({ // No children... var children = graph.getChildren(parent); if (children.length == 0) { - return [0,parent.getPosition()]; + return [0,parent.getPosition()]; // @Todo:Change x ... } // Try to fit within ... // // - Order is change if the position top position is changed ... - // - Suggested position is the middle bitween the two topics... + // - Suggested position is the middle between the two topics... // var result = null; children.forEach(function(child) { @@ -67,6 +66,7 @@ mindplot.nlayout.SymetricSorder = new Class({ insert: function(treeSet, parent, child, order) { var children = this._getSortedChildren(treeSet, parent); $assert(order <= children.length, "Order must be continues and can not have holes. Order:" + order); + $assert(order <= children.length, "Order must be continues and can not have holes. Order:" + order); // Shift all the elements in one . for (var i = order; i < children.length; i++) { @@ -117,7 +117,7 @@ mindplot.nlayout.SymetricSorder = new Class({ // Compute heights ... var heights = children.map(function(child) { return {id:child.getId(),height:this._computeChildrenHeight(treeSet, child)}; - }.bind(this)); + }, this); // Compute the center of the branch ... var totalHeight = 0; diff --git a/mindplot/src/main/javascript/nlayout/TestSuite.js b/mindplot/src/main/javascript/nlayout/TestSuite.js index cfc59cb8..7dd79b4a 100644 --- a/mindplot/src/main/javascript/nlayout/TestSuite.js +++ b/mindplot/src/main/javascript/nlayout/TestSuite.js @@ -16,9 +16,12 @@ mindplot.nlayout.TestSuite = new Class({ var manager = new mindplot.nlayout.LayoutManager(0, size); manager.addNode(1, size, position); - manager.connectNode(0, 1, 0); + manager.addNode(2, size, position); - manager.layout(); + manager.connectNode(0, 1, 0); + manager.connectNode(0, 2, 0); + + manager.layout(); manager.dump(); },