* calculated. It just lays out the components according to the specified
* alignment.
*/
public void doLayout(Container container_) {
Dimension containersize = container_.getSize();
Dimension minsize = minimumSize(container_);
/*
* Ensure that the container is at least as large as the minimum size.
*/
if (containersize.width < minsize.width)
containersize.width = minsize.width;
if (containersize.height < minsize.height)
containersize.height = minsize.height;
container_.setSize(containersize);
Component[] components = container_.getComponents();
int hoffset = container_.getInsets().left;
int voffset = container_.getInsets().top;
for (int i = 0; i < components.length; i++) {
Component c = components[ i];
/*
* Get the contained container to lay itself out at its preferred
* size.
*/
if (c instanceof Container) {
Container cont = (Container) c;
cont.setSize(cont.minimumSize());
cont.doLayout();
}
Dimension componentsize = c.getSize();
if (_axis == X_AXIS) {
float alignment = c.getAlignmentY();
if (alignment == Component.TOP_ALIGNMENT)
voffset = container_.getInsets().top;
else if (alignment == Component.CENTER_ALIGNMENT) {