initSplitBar(LayoutRegion.SOUTH, north, data);
} else {
removeSplitBar(north);
}
Rectangle b = new Rectangle();
Margins m = data.getMargins();
float s = data.getSize() <= 1 ? data.getSize() * size.height : data.getSize();
b.height = (int) s;
b.width = w - (m.left + m.right);
b.x = m.left;
b.y = m.top;
centerY = b.height + b.y + m.bottom;
centerH -= centerY;
b.x += sLeft;
b.y += sTop;
applyLayout(north, b);
} else {
removeSplitBar(north);
}
}
if (south != null) {
BorderLayoutData data = (BorderLayoutData) getLayoutData(south);
south.setVisible(!data.isHidden());
if (!data.isHidden()) {
if (south.getData("init") == null) {
initPanel(south);
}
if (data.isSplit()) {
initSplitBar(LayoutRegion.NORTH, south, data);
} else {
removeSplitBar(south);
}
Rectangle b = south.getBounds(false);
Margins m = data.getMargins();
float s = data.getSize() <= 1 ? data.getSize() * size.height : data.getSize();
b.height = (int) s;
b.width = w - (m.left + m.right);
b.x = m.left;
int totalHeight = (b.height + m.top + m.bottom);
b.y = h - totalHeight + m.top;
centerH -= totalHeight;
b.x += sLeft;
b.y += sTop;
applyLayout(south, b);
} else {
removeSplitBar(south);
}
}
if (west != null) {
BorderLayoutData data = (BorderLayoutData) getLayoutData(west);
west.setVisible(!data.isHidden());
if (!data.isHidden()) {
if (west.getData("init") == null) {
initPanel(west);
}
if (data.isSplit()) {
initSplitBar(LayoutRegion.EAST, west, data);
} else {
removeSplitBar(west);
}
Rectangle box = new Rectangle();
Margins m = data.getMargins();
float s = data.getSize() <= 1 ? data.getSize() * size.width : data.getSize();
box.width = (int) s;
box.height = centerH - (m.top + m.bottom);
box.x = m.left;
box.y = centerY + m.top;
int totalWidth = (box.width + m.left + m.right);
centerX += totalWidth;
centerW -= totalWidth;
box.x += sLeft;
box.y += sTop;
applyLayout(west, box);
} else {
removeSplitBar(west);
}
}
if (east != null) {
BorderLayoutData data = (BorderLayoutData) getLayoutData(east);
east.setVisible(!data.isHidden());
if (!data.isHidden()) {
if (east.getData("init") == null) {
initPanel(east);
}
if (data.isSplit()) {
initSplitBar(LayoutRegion.WEST, east, data);
} else {
removeSplitBar(east);
}
Rectangle b = east.getBounds(false);
Margins m = data.getMargins();
float s = data.getSize() <= 1 ? data.getSize() * size.width : data.getSize();
b.width = (int) s;
b.height = centerH - (m.top + m.bottom);
int totalWidth = (b.width + m.left + m.right);
b.x = w - totalWidth + m.left;
b.y = centerY + m.top;
centerW -= totalWidth;
b.x += sLeft;
b.y += sTop;
applyLayout(east, b);
} else {
removeSplitBar(east);
}
}
lastCenter = new Rectangle(centerX, centerY, centerW, centerH);
if (center != null) {
BorderLayoutData data = (BorderLayoutData) getLayoutData(center);
Margins m = data.getMargins();
lastCenter.x = centerX + m.left;
lastCenter.y = centerY + m.top;
lastCenter.width = centerW - (m.left + m.right);
lastCenter.height = centerH - (m.top + m.bottom);
lastCenter.x += sLeft;