}
}
}
}
Size size = getContainerTarget().getStyleSize();
if (GXTLogConfiguration.loggingIsEnabled()) {
logger.finest(getId() + " doLayout size: " + size);
}
int w = size.getWidth();
int h = size.getHeight();
int sLeft = getContainerTarget().getPadding(Side.LEFT);
int sTop = getContainerTarget().getPadding(Side.TOP);
int centerW = w, centerH = h, centerY = 0, centerX = 0;
if (north != null) {
BorderLayoutData data = getLayoutData(north);
north.setVisible(!data.isHidden());
if (north.isVisible()) {
Rectangle b = new Rectangle();
Margins m = data.getMargins() != null ? data.getMargins() : new Margins();
double s = data.getSize() <= 1 ? data.getSize() * size.getHeight() : data.getSize();
b.setHeight((int) s);
b.setWidth(w - (m.getLeft() + m.getRight()));
b.setX(m.getLeft());
b.setY(m.getTop());
centerY = b.getHeight() + b.getY() + m.getBottom();
centerH -= centerY;
b.setX(b.getX() + sLeft);
b.setY(b.getY() + sTop);
applyLayout(north, b);
}
}
if (south != null) {
BorderLayoutData data = getLayoutData(south);
south.setVisible(!data.isHidden());
if (south.isVisible()) {
Rectangle b = new Rectangle();
Margins m = data.getMargins() != null ? data.getMargins() : new Margins();
double s = data.getSize() <= 1 ? data.getSize() * size.getHeight() : data.getSize();
b.setHeight((int) s);
b.setWidth(w - (m.getLeft() + m.getRight()));
b.setX(m.getLeft());
int totalHeight = (b.getHeight() + m.getTop() + m.getBottom());
b.setY(h - totalHeight + m.getTop());
centerH -= totalHeight;
b.setX(b.getX() + sLeft);
b.setY(b.getY() + sTop);
applyLayout(south, b);
}
}
if (west != null) {
BorderLayoutData data = getLayoutData(west);
west.setVisible(!data.isHidden());
if (west.isVisible()) {
Rectangle box = new Rectangle();
Margins m = data.getMargins() != null ? data.getMargins() : new Margins();
double s = data.getSize() <= 1 ? data.getSize() * size.getWidth() : data.getSize();
box.setWidth((int) s);
box.setHeight(centerH - (m.getTop() + m.getBottom()));
box.setX(m.getLeft());
box.setY(centerY + m.getTop());
int totalWidth = (box.getWidth() + m.getLeft() + m.getRight());
centerX += totalWidth;
centerW -= totalWidth;
box.setX(box.getX() + sLeft);
box.setY(box.getY() + sTop);
applyLayout(west, box);
}
}
if (east != null) {
BorderLayoutData data = getLayoutData(east);
east.setVisible(!data.isHidden());
if (east.isVisible()) {
Rectangle b = new Rectangle();
Margins m = data.getMargins() != null ? data.getMargins() : new Margins();
double s = data.getSize() <= 1 ? data.getSize() * size.getWidth() : data.getSize();
b.setWidth((int) s);
b.setHeight(centerH - (m.getTop() + m.getBottom()));
int totalWidth = (b.getWidth() + m.getLeft() + m.getRight());
b.setX(w - totalWidth + m.getLeft());
b.setY(centerY + m.getTop());