EditorFigNode editorDestFig = getDestination(edge, fig.getLayer());
ModuleFigNode editorDestFig = getDestination(edge, fig.getLayer());
    private Rectangle arrange(EditorFigNode fig, Rectangle rect) {        // The 'childRect' is the rectangle that the children must        // be placed into        // The 'usedChildRect' is that portion of the 'childRect'        // that has already been used. Note the childRect is used        // from left to right.        // The 'thisChildRect' is the amount used by the currently        // arranged child.        Rectangle childRect = getChildRect(fig, rect);        Rectangle usedChildRect = new Rectangle(childRect.x, childRect.y, 0,                childRect.height);        Vector edges = getOutboundEdges(fig);        Enumeration e = edges.elements();        while (e.hasMoreElements()) {            NetEdge edge = (NetEdge) e.nextElement();            NetPort edgeSrc = (NetPort) edge.getSourcePort();            EditorFigNode editorDestFig = getDestination(edge, fig.getLayer());            Rectangle thisChildRect = arrange(editorDestFig, childRect);            // Update the child rect to have the remainder            childRect.width -= thisChildRect.width + HorizontalSep;            childRect.x += thisChildRect.width + HorizontalSep;            usedChildRect.width = (thisChildRect.x - rect.x)                    + thisChildRect.width;        }        // Move this node to its new location. If there are no        // children, its left edge should match the left edge of        // 'rect'. If it has children, its center should be in the        // middle of 'rect', which means its left edge should be        // (width of rectangle * 0.5) - (width of node * 0.5)        int x; // X coordinate==coord of left edge        if (usedChildRect.width == 0) {            x = rect.x;        } else {            x = rect.x + (int) Math.round(0.5 * usedChildRect.width)                    - (int) Math.round(0.5 * fig.getBounds().width);        }        fig.setLocation(x, rect.y);        // Return a Rectangle representing the total space taken        // by this object and its children.        return new Rectangle(rect.x, rect.y, Math.max(fig.getBounds().width,                usedChildRect.width), rect.height);    }