int nfigs = children.size();
    public void layoutContainer(FigPanel parent) {        Insets insets = parent.getInsets();        Vector children = parent.getContents();        int nfigs = children.size();        int left = parent.getX() + insets.left;        int top = parent.getY() + insets.top;        int bottom = parent.getY() + parent.getHeight() - insets.bottom;        int right = parent.getX() + parent.getWidth() - insets.right;        if (_axis == X_AXIS) {            int cx = left;            Enumeration e = children.elements();            while (e.hasMoreElements()) {                Fig fig = (Fig) e.nextElement();                Dimension d = fig.getPreferredSize();                switch (_alignment) {                case TOP:                    fig.setBounds(cx, top, d.width, d.height);                    break;                case CENTER:                    fig.setBounds(cx, top + (bottom - top - d.height) / 2,                            d.width, d.height);                    break;                case BOTTOM:                    fig.setBounds(cx, bottom - d.height, d.width, d.height);                    break;                }                cx += d.width + _gap;            }        } else {            int cy = top;            Enumeration e = children.elements();            while (e.hasMoreElements()) {                Fig fig = (Fig) e.nextElement();                Dimension d = fig.getPreferredSize();                switch (_alignment) {                case LEFT:                    fig.setBounds(left, cy, d.width, d.height);                    break;                case CENTER:                    fig.setBounds(left + (right - left - d.width) / 2, cy,                            d.width, d.height);                    break;                case BOTTOM:                    fig.setBounds(right - d.width, cy, d.width, d.height);                    break;                }                cy += d.height + _gap;            }        }    }