/** * Moves the specified node and all of its children by the given amount. */ protected void moveNode(TreeNode node, double dx, double dy) { node.x += dx; node.y += dy; apply(node, null); TreeNode child = node.child; while (child != null) { moveNode(child, dx, dy); child = child.next; } }
/** * Moves the specified node and all of its children by the given amount. */ protected void moveNode(TreeNode node, double dx, double dy) { node.x += dx; node.y += dy; apply(node, null); TreeNode child = node.child; while (child != null) { moveNode(child, dx, dy); child = child.next; } }
/** * */ protected mxRectangle horizontalLayout(TreeNode node, double x0, double y0, mxRectangle bounds) { node.x += x0 + node.offsetX; node.y += y0 + node.offsetY; bounds = apply(node, bounds); TreeNode child = node.child; if (child != null) { bounds = horizontalLayout(child, node.x, node.y, bounds); double siblingOffset = node.y + child.offsetY; TreeNode s = child.next; while (s != null) { bounds = horizontalLayout(s, node.x + child.offsetX, siblingOffset, bounds); siblingOffset += s.offsetY; s = s.next; } } return bounds; }
/** * */ protected mxRectangle verticalLayout(TreeNode node, Object parent, double x0, double y0, mxRectangle bounds) { node.x += x0 + node.offsetY; node.y += y0 + node.offsetX; bounds = apply(node, bounds); TreeNode child = node.child; if (child != null) { bounds = verticalLayout(child, node, node.x, node.y, bounds); double siblingOffset = node.x + child.offsetY; TreeNode s = child.next; while (s != null) { bounds = verticalLayout(s, node, siblingOffset, node.y + child.offsetX, bounds); siblingOffset += s.offsetY; s = s.next; } } return bounds; }
/** * */ protected mxRectangle horizontalLayout(TreeNode node, double x0, double y0, mxRectangle bounds) { node.x += x0 + node.offsetX; node.y += y0 + node.offsetY; bounds = apply(node, bounds); TreeNode child = node.child; if (child != null) { bounds = horizontalLayout(child, node.x, node.y, bounds); double siblingOffset = node.y + child.offsetY; TreeNode s = child.next; while (s != null) { bounds = horizontalLayout(s, node.x + child.offsetX, siblingOffset, bounds); siblingOffset += s.offsetY; s = s.next; } } return bounds; }
/** * */ protected mxRectangle verticalLayout(TreeNode node, Object parent, double x0, double y0, mxRectangle bounds) { node.x += x0 + node.offsetY; node.y += y0 + node.offsetX; bounds = apply(node, bounds); TreeNode child = node.child; if (child != null) { bounds = verticalLayout(child, node, node.x, node.y, bounds); double siblingOffset = node.x + child.offsetY; TreeNode s = child.next; while (s != null) { bounds = verticalLayout(s, node, siblingOffset, node.y + child.offsetX, bounds); siblingOffset += s.offsetY; s = s.next; } } return bounds; }