/** * Obtains the tree node corresponding to the specified cell * * @param cell * the cell whose tree node is to be found * @return the matching tree node, if any */ protected StandardTreeNode getTreeNode(Object cell) { if (cell != null) { OrganizationalTreeNode node = (OrganizationalTreeNode) nodes.get(cell); if (node == null) { node = new OrganizationalTreeNode(cell); nodes.put(cell, node); } return node; } return null; }
positionVerticalChildren(parent); } else { for (Iterator it = children.iterator(); it.hasNext();) { positionVerticalChildren(pt); } else { for (Iterator it = children.iterator(); it.hasNext();) {
protected void positionVerticalChildren(Point2D parent) { double verticalOffset = levelDistance; for (Iterator it = children.iterator(); it.hasNext();) { OrganizationalTreeNode node = (OrganizationalTreeNode) it .next(); if (getParent() == null) { System.out.println("something to break on"); } graph.setLocation(node.cell, parent.getX() + verticalEdgeLeftInset + verticalEdgeRightInset, parent.getY() + node.getParent().height + + verticalOffset); verticalOffset += levelDistance + node.height; // Also set the control point of the vertical node's edge List incomingEdges = graph.getIncomingEdges(node.cell, null, true, false); if (incomingEdges != null && incomingEdges.size() > 0) { Object edge = incomingEdges.get(0); List oldPoints = graph.getPoints(edge); List newPoints = new ArrayList(3); newPoints.add(oldPoints.get(0)); newPoints.add(new Point2D.Double( parent.getX() + verticalEdgeLeftInset, parent.getY() + verticalOffset - node.getParent().height)); newPoints.add(oldPoints.get(oldPoints.size() - 1)); graph.setPoints(edge, newPoints); graph.disableRouting(edge); } } } }