www.gusucode.com > mbcguitools 工具箱 matlab 源码程序 > mbcguitools/@mbcmultiview/@MultiViewPanel/pInstallLayoutStructure.m
function pInstallLayoutStructure(obj, struc) %PINSTALLLAYOUTSTRUCTURE Set up the display from a saved layout % % PINSTALLLAYOUTSTRUCTURE(OBJ, STRUC) recreates the display described by % the structure STRUC. STRUC must have been created by % PGETLAYOUTSTRUCTURE. % Copyright 2005-2011 The MathWorks, Inc. and Ford Global Technologies, Inc. if ~isempty(struc) hL = i_createViewObject(obj, struc); obj.pSetViewLayout(hL); set(hL, 'Visible', obj.Visible); end function hL = i_createViewObject(obj, struc) if strcmp(struc.Type, 'split') hLeft = i_createViewObject(obj, struc.Left); hRight = i_createViewObject(obj, struc.Right); hL = xregsplitlayout(obj.Parent, ... 'Visible', 'off', ... 'Left', hLeft, ... 'Right', hRight, ... 'Orientation', struc.Orientation, ... 'DividerStyle', 'flat', ... 'DividerWidth', 4, ... 'Split', struc.Split); set(hLeft, 'UserData', {hL, 1}); set(hRight, 'UserData', {hL, 2}); else % Construct a view from the stored information Index = obj.ViewList.findViewLabel(struc.ViewLabel); if ~isempty(Index) % Construct using current view definition hL = obj.pCreateView(Index); else % Fall back on the view class as a constructor hL = obj.pCreateContainer(struc.ViewClass); end end