public void setDimension(Dimension dim, int size) {
        if (dim.getSize() == size) return;

        dim.setSize(size);

        Set param_set = getParamsForDim(dim);
        for (Iterator i = param_set.iterator(); i.hasNext();) {
            Parameter param = (Parameter)(i.next());
            param.resize();
        }

        history.add (new ParameterSetHistory (dim, "changed size to " + size));
    }