public void switchLayout(int newId, boolean bLayout) { if (layoutId == newId) return; if (newId >= nviews) updateVpInfo(newId + 1); if (bSwitching) { return; } bSwitching = true; int oldId = layoutId; vpId = newId; layoutId = newId; recordCurrentLayout(); VpLayoutInfo vInfo = Util.getViewArea().getLayoutInfo(oldId); if (vInfo != null) { // save current layout info vInfo.tp_selectedTab = tp_selectedTab; vInfo.setVerticalTabName(selectedTabName); // copyCurrentLayout(vInfo); } vInfo = Util.getViewArea().getLayoutInfo(newId); putHsLayout(oldId); if (bLayout) getHsLayout(vpId); for (int i = 0; i < toolList.size(); i++) ((VToolPanel) toolList.get(i)).switchLayout(newId, bLayout); if (bLayout) setCurrentLayout(); /* if(comparePanelLayout(oldId, newId)) { setCurrentLayout(); } if ((vInfo != null) && vInfo.bAvailable && compareCurrentLayout(vInfo)) { setCurrentLayout(vInfo); } for(int i=0; i< toolList.size(); i++) ((VToolPanel) toolList.get(i)).switchLayout(newId); */ // setViewPort(newId); if (bLayout) setCurrentLayout(vInfo); updateValue(); if (bLayout) { if (pinPanel.isOpen()) { if (!pinPanel.isVisible()) pinPanel.setVisible(true); } else pinPanel.setVisible(false); } validate(); repaint(); bSwitching = false; }
public void setCurrentLayout(VpLayoutInfo info) { if ((info == null) || (!info.bAvailable)) return; tp_selectedTab = info.tp_selectedTab; selectedTabName = info.getVerticalTabName(); setSelectedTab(tp_selectedTab, selectedTabName); }
public void copyCurrentLayout(VpLayoutInfo info) { info.tp_selectedTab = tp_selectedTab; info.setVerticalTabName(selectedTabName); }