}
@Override protected void layoutChildren(final double x, final double y,
final double w, final double h) {
TabPane tabPane = getSkinnable();
Side tabPosition = tabPane.getSide();
double headerHeight = snapSize(tabHeaderArea.prefHeight(-1));
double tabsStartX = tabPosition.equals(Side.RIGHT)? x + w - headerHeight : x;
double tabsStartY = tabPosition.equals(Side.BOTTOM)? y + h - headerHeight : y;
if (tabPosition.equals(tabPosition.TOP)) {
tabHeaderArea.resize(w, headerHeight);
tabHeaderArea.relocate(tabsStartX, tabsStartY);
tabHeaderArea.getTransforms().clear();
tabHeaderArea.getTransforms().add(new Rotate(getRotation(tabPosition.TOP)));
} else if (tabPosition.equals(tabPosition.BOTTOM)) {
tabHeaderArea.resize(w, headerHeight);
tabHeaderArea.relocate(w, tabsStartY - headerHeight);
tabHeaderArea.getTransforms().clear();
tabHeaderArea.getTransforms().add(new Rotate(getRotation(tabPosition.BOTTOM), 0, headerHeight));
} else if (tabPosition.equals(tabPosition.LEFT)) {
tabHeaderArea.resize(h, headerHeight);
tabHeaderArea.relocate(tabsStartX + headerHeight, h - headerHeight);
tabHeaderArea.getTransforms().clear();
tabHeaderArea.getTransforms().add(new Rotate(getRotation(tabPosition.LEFT), 0, headerHeight));
} else if (tabPosition.equals(tabPosition.RIGHT)) {
tabHeaderArea.resize(h, headerHeight);
tabHeaderArea.relocate(tabsStartX, y - headerHeight);
tabHeaderArea.getTransforms().clear();
tabHeaderArea.getTransforms().add(new Rotate(getRotation(tabPosition.RIGHT), 0, headerHeight));
}
tabHeaderAreaClipRect.setX(0);
tabHeaderAreaClipRect.setY(0);
if (isHorizontal()) {
tabHeaderAreaClipRect.setWidth(w);
} else {
tabHeaderAreaClipRect.setWidth(h);
}
tabHeaderAreaClipRect.setHeight(headerHeight);
// ==================================
// position the tab content for the selected tab only
// ==================================
// if the tabs are on the left, the content needs to be indented
double contentStartX = 0;
double contentStartY = 0;
if (tabPosition.equals(tabPosition.TOP)) {
contentStartX = x;
contentStartY = y + headerHeight;
if (isFloatingStyleClass()) {
// This is to hide the top border content
contentStartY -= 1;
}
} else if (tabPosition.equals(tabPosition.BOTTOM)) {
contentStartX = x;
contentStartY = y;
if (isFloatingStyleClass()) {
// This is to hide the bottom border content
contentStartY = 1;
}
} else if (tabPosition.equals(tabPosition.LEFT)) {
contentStartX = x + headerHeight;
contentStartY = y;
if (isFloatingStyleClass()) {
// This is to hide the left border content
contentStartX -= 1;
}
} else if (tabPosition.equals(tabPosition.RIGHT)) {
contentStartX = x;
contentStartY = y;
if (isFloatingStyleClass()) {
// This is to hide the right border content
contentStartX = 1;