正文
Master Views
母版视图
Master views are alternate versions of masters designed for specific contexts. They allow you to create a master once and then rearrange, resize, and restyle its widgets to fit each context you intend to use it in. When you add an instance of a master to the canvas, you can choose which of its views to display.
母版视图是为特定上下文设计的母版视图的替代版本。它们允许您创建一次母版视图,然后重新排列、调整其小部件的大小和样式,以适应您打算在其中使用它的每个上下文。当您将一个master实例添加到画布中时,您可以选择要显示哪个视图。
1、Adding Views to a Master
向母版添加视图
To add master views to a master, start by opening the master on the canvas for editing. Click the canvas to focus the master itself, and then click
Add Master Views
in the
Style
pane to open the
Master Views
dialog, where you'll create and manage your views.
要将母版视图添加到母版,首先要在画布上打开母版视图进行编辑。单击画布以关注母版视图本身,然后单击
Style
窗格中的
添加主视图
,以打开
主视图
对话框,您将在其中创建和管理您的视图。
To remove master views from a master, click
Remove Views
at the top-right of the
Style
pane.
要从主视图中删除主视图,请单击“
Style
”窗格右上角的“
删除视图
”。
2、Master View Inheritance
母版视图继承
Master views are organized into chains of inheritance. The first link in the chain, the view from which all others inherit, is the
Base
view. Each view you add inherits its widgets and widget properties either directly from the
Base
view or from another view in the chain.
母版视图被组织成继承的链。链中的第一个链接,所有其他继承的视图都是基本视图。您可以从基本视图或从另一个视图中添加它的小部件和小部件属性。
For example, the chain of inheritance for a button master might looks like this:
例如,按钮管理员的继承链可能是这样的:
Primary Button (Base) > Secondary Button > Text Link Button
-
Edits made in the
Primary Button
view would be reflected in both the
Secondary Button
and
Text Link Button
views as well.
在
主按钮
视图中进行的编辑将同时反映在
次按钮
和
文本链接按钮
视图中。
-
Edits made in the
Secondary Button
view would be reflected in the
Text Link Button
view but not in the
Primary Button
view.
在
辅助按钮
视图中进行的编辑将反映在
文本链接按钮
视图中,但不会反映在
主按钮
视图中。
-
Edits made in the
Text Link Button
view would only affect that view.
在*
文本链接按钮
*视图中生成的编辑只会影响视图。
3、Editing Diagrams in Master Views
在母版视图中编辑关系图
Once you've added master views to a master, you can access each view by clicking its name at the top of the canvas. The color of a view's name indicates whether or not it will be affected by edits you make on the canvas:
一旦您将主视图添加到master中,您可以通过单击画布顶部的名称来访问每个视图。一个视图的颜色的颜色表明它是否会受到你在画布上的编辑的影响:
-
Turquoise:
The view currently displayed on the canvas.
Edits will affect this view.
当前在画布上显示的视图。
-
Yellow:
A child of the view currently displayed on the canvas.
Edits will affect this view.
当前显示在画布上的视图的子视图。
-
Grey:
A parent of the view currently displayed on the canvas.
Edits will not affect this view.
视图的父视图当前显示在画布上。
-
Green:
The
Affect All Views
checkbox is checked.
Edits will affect all views.
影响所有视图
复选框被检查。*编辑会影响所有的观点。
Furthermore, if you edit a widget property in a child view, edits to the same property in a parent view will no longer affect the child view. For example, if you change a button's fill color to pink in a child view and then change that same button's fill color to green in the parent view, the button will still be pink in the child view, not green.
此外,如果在子视图中编辑小部件属性,则对父视图中相同属性的编辑将不再影响子视图。例如,如果在子视图中将按钮的填充颜色更改为粉红色,然后在父视图中将相同按钮的填充颜色更改为绿色,则该按钮在子视图中仍然是粉红色,而不是绿色。
Tip
提示
To take full advantage of the benefits of master view edit inheritance, we suggest you take a top-down approach to editing your diagrams, starting in the
Base
view and then working your way down the chain.
为了充分利用主视图编辑继承的好处,我们建议您采用自顶向下的方法来编辑您的图表,从
Base
视图开始,然后沿着这个链向下工作。
3.1、Cross-View Widget Properties
跨视图部件属性
You can change the visual styling, size, and position of widgets freely across master views. Some widget properties, however, are always the same in every view.
These include widget text, notes, and interactions/interactive properties. Making edits to these on a widget in one view will always affect all other views as well.
您可以在主视图中自由地改变小部件的视觉样式、大小和位置。然而,在每个视图中,一些小部件属性总是相同的。* *这些包括小部件文本、注释和交互/交互属性。在一个视图中对这些选项进行编辑对所有其他视图都有影响
Additionally, special widget properties like the options in a droplist widget, the rows and columns in a table widget, and the nodes in a tree widget, are also shared across views.
此外,像droplist小部件中的选项、表小部件中的行和列和树小部件中的节点一样,特殊的小部件属性也会在视图中共享。
If you need a cross-view widget property to vary across your master views, create an additional copy of the widget for each variation and use the "unplace" feature to choose which version of the widget appears in each view.
如果您需要一个跨视图小部件属性,以在您的主视图上有所不同,为每个变体创建一个小部件的额外副本,并使用“unplace”特性来选择每个视图中出现哪个版本的小部件。
3.2、Unplaced Widgets
未放置的小部件
"Unplaced" widgets are widgets that are included in some of a master's views but not in others. Any widgets that have been unplaced from the current view are listed in red in the
Outline
pane.
“未放置”的小部件是包含在一些主视图中的小部件,而不是在其他的。从当前视图中未放置的任何小部件都在
Outline
窗格中被列在红色中。
Note
提示
To ensure that you see both placed and unplaced widgets in the
Outline
pane, click the
Sort and Filter
icon at the top-right of the pane and select
Placed or Unplaced
.
要确保在
Outline
窗格中同时看到放置和未放置的小部件,请单击窗格右上角的
Sort和Filter
图标,并选择
放置或未放置
。