TreePostScriptGenerator.java 文件源码

java
阅读 24 收藏 0 点赞 0 评论 0

项目:codebuff 作者:
protected void generateEdges(Tree parent) {
        if (!getTree().isLeaf(parent)) {
            Rectangle2D.Double parentBounds = getBoundsOfNode(parent);
//          System.out.println("%% parent("+getText(parent)+")="+parentBounds);
            double x1 = parentBounds.getCenterX();
            double y1 = parentBounds.y;
            for (Tree child : getChildren(parent)) {
                Rectangle2D.Double childBounds = getBoundsOfNode(child);
//              System.out.println("%% child("+getText(child)+")="+childBounds);
                double x2 = childBounds.getCenterX();
                double y2 = childBounds.getMaxY();
                doc.line(x1, y1, x2, y2);
                generateEdges(child);
            }
        }
    }
评论列表
文章目录


问题


面经


文章

微信
公众号

扫码关注公众号