+ -
当前位置:首页 → 问答吧 → 求递归高手!!!

求递归高手!!!

时间:2011-12-19

来源:互联网


此图实现代码如下:
offsetX,offsetY为两图间隙

JScript code

mxCompactTreeLayout.prototype.verticalLayout = function(node, parent, x0, y0, bounds) {
    node.x += x0 + node.offsetY;
    node.y += y0 + node.offsetX;
    bounds = this.apply(node, bounds);
    var child = node.child;
    if (child != null) {
        bounds = this.verticalLayout(child, node, node.x, node.y, bounds);
        var siblingOffset = node.x + child.offsetY;
        var s = child.next;
        while (s != null) {
            bounds = this.verticalLayout(s, node, siblingOffset, node.y + child.offsetX, bounds);
            siblingOffset += s.offsetY;
            s = s.next;
        }
    }
    return bounds;
};




现在的要求是,希望把3以下的排列换成竖向显示,1级和2级依然保持横向。保证美观。
如草图:

作者: wang4382   发布时间: 2011-12-19

51.com图片失效

作者: p2227   发布时间: 2011-12-19

鸟csdn,图片失效了都不可以改。。

就是这样
------------------------------------------------
A1
  / \
A1B1 A1B2
/ \
A1B1C1 A1B1C2
-------------------------------------------------------
A1
  / \
A1B1 A1B2
|
|-A1B1C1
|-A1B1C2

作者: wang4382   发布时间: 2011-12-19