if (childRootElement != null) {
List<Element> elements = childRootElement.getElements();
if (elements.isEmpty()) {
return;
}
final Element scrollElement = elements.get(0);
if (scrollElement != null) {
Scrollbar horizontalS = getElement().findNiftyControl("#nifty-internal-horizontal-scrollbar", Scrollbar.class);
if (horizontalS != null) {
horizontalS.setWorldMax(scrollElement.getWidth());
updateWorldH();
horizontalS.setWorldPageSize(horizontalS.getWidth());
horizontalS.setValue(0.0f);
horizontalS.setButtonStepSize(stepSizeX);
horizontalS.setPageStepSize(pageSizeX);
}
Scrollbar verticalS = getElement().findNiftyControl("#nifty-internal-vertical-scrollbar", Scrollbar.class);
if (verticalS != null) {
verticalS.setWorldMax(scrollElement.getHeight());
updateWorldV();
verticalS.setWorldPageSize(verticalS.getHeight());
verticalS.setValue(0.0f);
verticalS.setButtonStepSize(stepSizeY);
verticalS.setPageStepSize(pageSizeY);
}
scrollElement.setConstraintX(new SizeValue("0px"));
scrollElement.setConstraintY(new SizeValue("0px"));
}
scrollElement.layoutElements();
}
}