@Override public void update() { if (open && currentWidth < maxWidth) { currentWidth += tabExpandSpeed; } else if (!open && currentWidth > minWidth) { currentWidth -= tabExpandSpeed; } if (currentWidth > maxWidth) { currentWidth = maxWidth; } else if (currentWidth < minWidth) { currentWidth = minWidth; } if (open && currentHeight < maxHeight) { currentHeight += tabExpandSpeed; } else if (!open && currentHeight > minHeight) { currentHeight -= tabExpandSpeed; } if (currentHeight > maxHeight) { currentHeight = maxHeight; } else if (currentHeight < minHeight) { currentHeight = minHeight; } if (!fullyOpen && open && currentWidth == maxWidth && currentHeight == maxHeight) { setFullyOpen(); } }
@Override public void setFullyOpen() { if (!myPlayer.equals(myContainer.getOwner().getId())) { return; } super.setFullyOpen(); }
public TabBase addTab(TabBase tab) { int yOffset = 4; for (TabBase tab1 : tabs) { if (tab1.side == tab.side && tab1.isVisible()) { yOffset += tab1.currentHeight; } } tab.setPosition(tab.side == TabBase.LEFT ? 0 : xSize, yOffset); tabs.add(tab); if (TabTracker.getOpenedLeftTab() != null && tab.getClass().equals(TabTracker.getOpenedLeftTab())) { tab.setFullyOpen(); } else if (TabTracker.getOpenedRightTab() != null && tab.getClass().equals(TabTracker.getOpenedRightTab())) { tab.setFullyOpen(); } return tab; }
public TabBase addTab(TabBase tab, int index) { int yOffset = 4; for (TabBase tab1 : tabs) { if (tab1.side == tab.side && tab1.isVisible()) { yOffset += tab1.currentHeight; } } tab.setPosition(tab.side == TabBase.LEFT ? 0 : xSize, yOffset); tabs.add(index, tab); if (TabTracker.getOpenedLeftTab() != null && tab.getClass().equals(TabTracker.getOpenedLeftTab())) { tab.setFullyOpen(); } else if (TabTracker.getOpenedRightTab() != null && tab.getClass().equals(TabTracker.getOpenedRightTab())) { tab.setFullyOpen(); } return tab; }
return; super.setFullyOpen();