Keep a clean separation between EditPart and figure.
保持EditPart和图形之间“彻底”的分离。
They should avoid referencing an EditPart or figure.
它们应当避免引用EditPart或图形。
Don't reference the model or EditPart from the figure.
不要从图形引用模型或EditPart。
In the contents EditPart, we used an XY layout manager.
在内容EditPart中,我们使用了XY布局管理器。
The figure should not have access to the EditPart or model.
图形不应该具有对EditPart或模型的访问权。
This EditPart is referred to as the contents of the viewer.
这个EditPart被称为查看器的内容。
This happens when a request for a command is sent to the EditPart.
当命令的请求被发送给EditPart时就会发生这种情况。
Implementing the connection EditPart is relatively straightforward.
实现连接EditPart是比较简单的。
The EditPart either supports, prevents, or ignores a given request.
EditPart 可能支持、阻止给定请求,也可能忽略给定请求。
Next, we'll bridge the model and view with the controller, or EditPart.
接下来,我们将用控制器或EditPart在模型与视图之间架起桥梁。
It turns out, this is basically all you do in the EditPart class itself.
结果表明,这基本上是您在editpart类自身中所做的所有工作。
Once you implement this method, you are pretty much done with your EditPart.
一旦您实现该方法,您就几乎已经完成了您的EditPart。
It is possible (but not a good idea) to have the EditPart build everything itself.
让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通常都将把自己的侦听器添加到任何一个影响它的模型对象。
应用推荐