protected TabBase getTabAtPosition(int mX, int mY) { int xShift = 0; int yShift = 4; for (TabBase tab : tabs) { if (!tab.isVisible() || tab.side == TabBase.RIGHT) { continue; } tab.setCurrentShift(xShift, yShift); if (tab.intersectsWith(mX, mY, xShift, yShift)) { return tab; } yShift += tab.currentHeight; } xShift = xSize; yShift = 4; for (TabBase tab : tabs) { if (!tab.isVisible() || tab.side == TabBase.LEFT) { continue; } tab.setCurrentShift(xShift, yShift); if (tab.intersectsWith(mX, mY, xShift, yShift)) { return tab; } yShift += tab.currentHeight; } return null; }