/** * */ protected void layoutLeaf(TreeNode node) { double dist = 2 * nodeDistance; node.contour.upperTail = createLine(node.height + dist, 0, null); node.contour.upperHead = node.contour.upperTail; node.contour.lowerTail = createLine(0, -node.width - dist, null); node.contour.lowerHead = createLine(node.height + dist, 0, node.contour.lowerTail); }
/** * */ protected void layoutLeaf(TreeNode node) { double dist = 2 * nodeDistance; node.contour.upperTail = createLine(node.height + dist, 0, null); node.contour.upperHead = node.contour.upperTail; node.contour.lowerTail = createLine(0, -node.width - dist, null); node.contour.lowerHead = createLine(node.height + dist, 0, node.contour.lowerTail); }
/** * */ protected void attachParent(TreeNode node, double height) { double x = nodeDistance + levelDistance; double y2 = (height - node.width) / 2 - nodeDistance; double y1 = y2 + node.width + 2 * nodeDistance - height; node.child.offsetX = x + node.height; node.child.offsetY = y1; node.contour.upperHead = createLine(node.height, 0, createLine(x, y1, node.contour.upperHead)); node.contour.lowerHead = createLine(node.height, 0, createLine(x, y2, node.contour.lowerHead)); }
/** * */ protected void attachParent(TreeNode node, double height) { double x = nodeDistance + levelDistance; double y2 = (height - node.width) / 2 - nodeDistance; double y1 = y2 + node.width + 2 * nodeDistance - height; node.child.offsetX = x + node.height; node.child.offsetY = y1; node.contour.upperHead = createLine(node.height, 0, createLine(x, y1, node.contour.upperHead)); node.contour.lowerHead = createLine(node.height, 0, createLine(x, y2, node.contour.lowerHead)); }
/** * */ protected Polyline bridge(Polyline line1, double x1, double y1, Polyline line2, double x2, double y2) { double dx = x2 + line2.dx - x1; double dy = 0; double s = 0; if (line2.dx == 0) { dy = line2.dy; } else { s = dx * line2.dy; dy = s / line2.dx; } Polyline r = createLine(dx, dy, line2.next); line1.next = createLine(0, y2 + line2.dy - dy - y1, r); return r; }
/** * */ protected Polyline bridge(Polyline line1, double x1, double y1, Polyline line2, double x2, double y2) { double dx = x2 + line2.dx - x1; double dy = 0; double s = 0; if (line2.dx == 0) { dy = line2.dy; } else { s = dx * line2.dy; dy = s / line2.dx; } Polyline r = createLine(dx, dy, line2.next); line1.next = createLine(0, y2 + line2.dy - dy - y1, r); return r; }