In the contents EditPart, we used an XY layout manager.
在内容EditPart中,我们使用了XY布局管理器。
This EditPart is referred to as the contents of the viewer.
这个EditPart被称为查看器的内容。
Implementing the connection EditPart is relatively straightforward.
实现连接EditPart是比较简单的。
The EditPart either supports, prevents, or ignores a given request.
EditPart 可能支持、阻止给定请求,也可能忽略给定请求。
GEF allows you to add property sheet support either on the EditPart or in the model.
GEF允许您在EditPart上或在模型中添加特性表支持。
The first EditPart you write is the EditPart that corresponds to the diagram itself.
编写的第一个EditPart是与图本身对应的 EditPart。
Listing 5 shows the additions to the node EditPart implementation for model notification.
清单5显示了向节点EditPart实现添加的模型通知内容。
The viewer then USES its factory to construct the contents EditPart for that input object.
然后查看器可以使用自己的工厂来构造用于该输入对象的内容EditPart。
The connection EditPart shouldn't know anything about the figures being used by the nodes.
连接EditPart不应当知道节点所使用的图的任何信息。
First, configure the viewer with your own EditPart factory to construct the EditParts from Step 3.
首先,利用自己的EditPart工厂配置查看器,以从第 3步构造EditPart。
The EditPart also observes the model, and updates the view to reflect changes in the model's state.
EditPart还观察模型并更新视图,以反映模型状态中的变化。
If the user undoes a delete, it is a different EditPart that is recreated to represent the restored object.
如果用户撤销了一个删除操作,那么用于表示被恢复对象而重新创建的EditPart与原先的EditPart是不同的。
Note that a connection is referred to by the nodes at each end, but that its EditPart need only be created once.
请注意,连接是由每端的节点引用的,而其EditPart只需创建一次。
It corresponds to the top-most element in the model and is parented by the viewer's root EditPart (see Figure 4).
它对应于模型中最顶部的元素,并且其父元素为查看器的根editpart(参见图4)。
The methods that take a connection are the ones used when setting the anchors on an existing connection EditPart.
以连接(connection)为参数的方法是对现有连接EditPart设置锚时使用的方法。
It corresponds to the top-most element in the model, and is parented by the viewer's root EditPart (see Figure 4).
它对应于模型中最顶部的元素,并且其父元素为查看器的根editpart(请参阅图4)。
The method refreshVisuals() is called only once during the initialization of the EditPart and is never called again.
方法refreshVisuals()只在EditPart的初始化过程中调用一次并且决不再次调用。
Therefore, you must indicate, either in the connection EditPart or in the node implementations, which anchors to use.
因此,必须在连接EditPart中或在节点实现中表明使用哪些锚。
Listing 1 shows a sample contents EditPart that creates an opaque figure that will position its children using the XYLayout.
清单1显示了一个样本内容EditPart,它创建了一个不透明类型的图形,后者将使用XYLayout定位其子图。
When that listener receives a change, it will look up the affected EditPart (s), and then re-dispatch the change appropriately.
当该侦听器接收到更改时,它将查找受影响的EditPart,然后适当地重新分派该更改。
If your application USES distributed notification, each EditPart will typically add its own listeners to whichever model objects affect it.
如果您的应用程序使用了分布式通知,那么每个EditPart通常都将把自己的侦听器添加到任何一个影响它的模型对象。
In some situations, the EditPart may add itself as a listener to the figure, but it will only be known about as a listener, not as the EditPart.
在某些情形中,EditPart可能会将自己作为侦听器添加到图形,但是只会认为它是侦听器,而不是EditPart。
Each controller, or EditPart as they are called here, is responsible both for mapping the model to its view, and for making changes to the model.
每个控制器(即本文所谓的EditPart)负责将模型映射到它的视图,也负责对模型进行更改。
Let's assume your EditPart is going to use a label as its figure and that the model provides a name, icon, and connections going to and from the label.
让我们假定您的EditPart将使用Label作为它的图形,并且您的模型提供了名称、图标以及与标签之间的连接。
When writing the EditPart implementation later, it is trivial to indicate that the contents pane should be used as the parent for all children elements.
稍后在编写EditPart实现时,并不一定要表明应该将内容窗格用作所有子元素的父元素。
Let's assume your EditPart is going to use a label as its figure, and that the model provides a name, icon, and connections going to and from the label.
让我们假定您的EditPart将使用Label作为它的图形,并且您的模型提供了名称、图标以及与标签之间的连接。
Another reason is that when the user is creating a connection, the connection EditPart doesn't exist, so the node must be able to show feedback on its own.
另一个原因是,当用户创建连接时,连接EditPart是不存在的,因此节点必须能够自己显示反馈。
Another reason is that when the user is creating a connection, the connection EditPart doesn't exist, so the node must be able to show feedback on its own.
另一个原因是,当用户创建连接时,连接EditPart是不存在的,因此节点必须能够自己显示反馈。
应用推荐