// Draw the left and top borders
switch (tabOrientation) {
case HORIZONTAL: {
graphics.draw(new Line2D.Double(left, top, left, bottom));
Point selectedTabButtonLocation = activeTabButton.mapPointToAncestor(tabPane, 0, 0);
graphics.draw(new Line2D.Double(left, top, selectedTabButtonLocation.x + 0.5, top));
graphics.draw(new Line2D.Double(selectedTabButtonLocation.x + activeTabButton.getWidth() - 0.5,
top, right, top));
break;
}
case VERTICAL: {
graphics.draw(new Line2D.Double(left, top, right, top));
Point selectedTabButtonLocation = activeTabButton.mapPointToAncestor(tabPane, 0, 0);
graphics.draw(new Line2D.Double(left, top, left, selectedTabButtonLocation.y + 0.5));
graphics.draw(new Line2D.Double(left, selectedTabButtonLocation.y + activeTabButton.getHeight() - 0.5,
left, bottom));
break;