}
}
rendered = true;
}
Rectangle rect = target.getBounds();
int w = rect.width - target.getBorderWidth("lr");
int h = rect.height - target.getBorderWidth("tb");
int centerW = w, centerH = h, centerY = 0, centerX = 0;
north = getRegionWidget(LayoutRegion.NORTH);
south = getRegionWidget(LayoutRegion.SOUTH);
west = getRegionWidget(LayoutRegion.WEST);
east = getRegionWidget(LayoutRegion.EAST);
center = getRegionWidget(LayoutRegion.CENTER);
if (north != null) {
BorderLayoutData data = (BorderLayoutData) getLayoutData(north);
if (north.getData("init") == null) {
initPanel(north);
}
if (data.isSplit()) {
initSplitBar(LayoutRegion.SOUTH, north, data);
} else {
removeSplitBar(LayoutRegion.SOUTH);
}
Rectangle b = new Rectangle();
Margins m = data.getMargins();
float s = data.getSize() < 1 ? data.getSize() * rect.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;
applyLayout(north, b);
}
if (south != null) {
BorderLayoutData data = (BorderLayoutData) getLayoutData(south);
if (south.getData("init") == null) {
initPanel(south);
}
if (data.isSplit()) {
initSplitBar(LayoutRegion.NORTH, south, data);
} else {
removeSplitBar(LayoutRegion.NORTH);
}
Rectangle b = south.getBounds(false);
Margins m = data.getMargins();
float s = data.getSize() < 1 ? data.getSize() * rect.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;
applyLayout(south, b);
}
if (west != null) {
if (west.getData("init") == null) {
initPanel(west);
}
BorderLayoutData data = (BorderLayoutData) getLayoutData(west);
if (data.isSplit()) {
initSplitBar(LayoutRegion.EAST, west, data);
} else {
removeSplitBar(LayoutRegion.EAST);
}
Rectangle box = new Rectangle();
Margins m = data.getMargins();
float s = data.getSize() < 1 ? data.getSize() * rect.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;
applyLayout(west, box);
}
if (east != null) {
if (east.getData("init") == null) {
initPanel(east);
}
BorderLayoutData data = (BorderLayoutData) getLayoutData(east);
if (data.isSplit()) {
initSplitBar(LayoutRegion.WEST, east, data);
} else {
removeSplitBar(LayoutRegion.WEST);
}
Rectangle b = east.getBounds(false);
Margins m = data.getMargins();
float s = data.getSize() < 1 ? data.getSize() * rect.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;
applyLayout(east, b);
}
lastCenter = new Rectangle(centerX, centerY, centerW, centerH);
if (center != null) {
BorderLayoutData data = (BorderLayoutData) getLayoutData(center);
Margins m = data.getMargins();
lastCenter.x = centerX + m.left;