Sorter refactoring
This commit is contained in:
@@ -1,5 +1,5 @@
|
||||
mindplot.nlayout.BalancedSorter = new Class({
|
||||
Extends: mindplot.nlayout.ChildrenSorterStrategy,
|
||||
Extends: mindplot.nlayout.AbstractBasicSorter,
|
||||
|
||||
initialize: function() {
|
||||
|
||||
@@ -91,23 +91,6 @@ mindplot.nlayout.BalancedSorter = new Class({
|
||||
node.setOrder(0);
|
||||
},
|
||||
|
||||
_getSortedChildren:function(treeSet, node) {
|
||||
var result = treeSet.getChildren(node);
|
||||
result.sort(function(a, b) {
|
||||
return a.getOrder() - b.getOrder();
|
||||
});
|
||||
return result;
|
||||
},
|
||||
|
||||
verify:function(treeSet, node) {
|
||||
// Check that all is consistent ...
|
||||
var children = this._getSortedChildren(treeSet, node);
|
||||
|
||||
for (var i = 0; i < children.length; i++) {
|
||||
$assert(children[i].getOrder() == i, "missing order elements");
|
||||
}
|
||||
},
|
||||
|
||||
computeOffsets:function(treeSet, node) {
|
||||
$assert(treeSet, "treeSet can no be null.");
|
||||
$assert(node, "node can no be null.");
|
||||
|
||||
Reference in New Issue
Block a user