基础框架平台——基础管理框架——GUI抽象设计(布局管理器)

本接口定义布局管理器如何管理工作空间中各GUI要素的布局。比如面板的显示、隐藏状态,面板、工作台窗体(视图)的配置,活动面板,显示、隐藏面板,重绘工作台窗体和面板。

定义属性:
 活动工作台窗体,当前活动的视图内容。

定义方法:
 驻于内存,从内存中撤出,显示面板,使面板处于活动状态,隐藏面板,判断面板是否可见,重绘所有组件,导入配合信息,恢复配置信息,活动的工作台窗体发生变化

定义事件:
 活动工作台窗体变化时触发的事件。

 1using System;
 2using System.Collections.Generic;
 3using System.Text;
 4
 5namespace MetaApplication
 6{
 7    /// <summary>
 8    /// The IWorkbenchLayout object is responsible for the layout of 
 9    /// the workspace, it shows the contents, chooses the IWorkbenchWindow
10    /// implementation etc. it could be attached/detached at the runtime
11    /// to a workbench.
12    /// </summary>

13    public interface IWorkbenchLayout
14    {
15        IWorkbenchWindow ActiveWorkbenchwindow
16        {
17            get;
18        }

19
20        object ActiveContent
21        {
22            get;
23        }

24
25        /// <summary>
26        /// Attaches this layout manager to a workbench object.
27        /// </summary>

28        void Attach(IWorkbench workbench);
29
30        /// <summary>
31        /// Detaches this layout manager from the current workspace.
32        /// </summary>

33        void Detach();
34
35        /// <summary>
36        /// Shows a new <see cref="IPadContent"/>.
37        /// </summary>

38        void ShowPad(IPadContent content);
39
40        /// <summary>
41        /// Activates a pad (Show only makes it visible but Activate does
42        /// bring it to foreground)
43        /// </summary>

44        void ActivatePad(IPadContent content);
45        void ActivatePad(string fullyQualifiedTypeName);
46
47        /// <summary>
48        /// Hides a new <see cref="IPadContent"/>.
49        /// </summary>

50        void HidePad(IPadContent content);
51
52        /// <summary>
53        /// returns true, if padContent is visible;
54        /// </summary>

55        bool IsVisible(IPadContent padContent);
56
57        /// <summary>
58        /// Re-initializes all components of the layout manager.
59        /// </summary>

60        void RedrawAllComponents();
61
62        /// <summary>
63        /// Shows a new <see cref="IViewContent"/>.
64        /// ?????不明白干什么用的,后续会如何使用
65        /// </summary>

66        IWorkbenchWindow ShowView(IViewContent content);
67
68
69        void LoadConfiguration();
70        void StoreConfiguration();
71
72        /// <summary>
73        /// Is called, when the workbench window which the user has into
74        /// the foreground (e.g. editable) changed to a new one.
75        /// </summary>

76        event EventHandler ActiveWorkbenchWindowChanged;
77
78        // only needed in the workspace window when the 'secondary view content' changed
79        // it is somewhat like 'active workbench window changed'
80        void OnActiveWorkbenchWindowChanged(EventArgs e);
81    }

82}

83
原文地址:https://www.cnblogs.com/bobzhangfw/p/632253.html