public String getBranchLine() { int width = getMinWidth(); int space = width - (name.length() + 2); int left = space / 2; int right = space - left; StringBuilder r = new StringBuilder(); for (Node child : children) { int w = child.getMinWidth(); int t = child.getTopAnchor(); r.append(ws(t)); if (r.length() < left) r.append("/"); else if (r.length() > width - right) r.append("\\"); else r.append("|"); r.append(ws(w - (t))); } return r.toString(); }
public String getBranchLine() { int width = getMinWidth(); int space = width - (name.length() + 2); int left = space / 2; int right = space - left; StringBuilder r = new StringBuilder(); for (Node child : children) { int w = child.getMinWidth(); int t = child.getTopAnchor(); r.append(ws(t)); if (r.length() < left) r.append("/"); else if (r.length() > width - right) r.append("\\"); else r.append("|"); r.append(ws(w - (t))); } return r.toString(); }