LayoutPassInfo (List<TabInfo> visibleInfos) { SingleRowPassInfo data = new SingleRowPassInfo(this, visibleInfos); final boolean shouldLayoutLabels = checkLayoutLabels(data); if (!shouldLayoutLabels) { data = lastSingRowLayout; } final TabInfo selected = myTabs.getSelectedInfo(); prepareLayoutPassInfo(data, selected); myTabs.resetLayout(shouldLayoutLabels || myTabs.isHideTabs()); if (shouldLayoutLabels && !myTabs.isHideTabs()) { recomputeToLayout(data); data.position = getStrategy().getStartPosition(data) - getScrollOffset(); layoutTitle(data); if (ExperimentalUI.isNewUI() && myTabs.getTabsPosition().isSide()) { // Layout buttons first because their position will be used to calculate label positions layoutEntryPointButton(data); layoutMoreButton(data); layoutLabels(data); } else { layoutLabels(data); layoutEntryPointButton(data); layoutMoreButton(data); } } if (selected != null) { data.component = new WeakReference<>(selected.getComponent()); getStrategy().layoutComp(data); } data.tabRectangle = new Rectangle(); if (!data.toLayout.isEmpty()) { final TabLabel firstLabel = myTabs.getInfoToLabel().get(data.toLayout.get(0)); final TabLabel lastLabel = findLastVisibleLabel(data); if (firstLabel != null && lastLabel != null) { data.tabRectangle.x = firstLabel.getBounds().x; data.tabRectangle.y = firstLabel.getBounds().y; data.tabRectangle.width = ExperimentalUI.isNewUI() ? (int)data.entryPointRect.getMaxX() + myTabs.getActionsInsets().right - data.tabRectangle.x : (int)lastLabel.getBounds().getMaxX() - data.tabRectangle.x; data.tabRectangle.height = (int)lastLabel.getBounds().getMaxY() - data.tabRectangle.y; } } lastSingRowLayout = data; return data; }