posts - 1,  comments - 1,  trackbacks - 0

 

1. GEF View 实际上包含有很多部分,而不仅仅只是 figure : 

还包括visual parts, feedback, handles, toolipts等等.

It includes the visual part, which serves as the primary representation for the model object(s).  The most flexible visual parts are Figures from draw2d.  GEF also provides support for SWT TreeItems, but support for other visuals can easily be added.  While "visual part" refers to the object primarily representing a model object, the more encompassing "view" includes feedback, handles, tooltips, and all things visible to the user.  All of these make up the view, and it is the controller's job to construct and manage them.

  2. Graphical editing 可以被定义为 :

1) 操作模型,这是通过对 Request 进行响应,生成 Command 来完成的。

2) 显示 Feedback ,在复杂的交互中, EditParts 需要为用户显示操作的反馈。

3) 上面所提的两个工作,均可以被 EditParts 代理到其他额外的 EditParts 上。

  3. EditPolicy Role 字符串的作用 ,是使得 EditPolicy 能够用过这个 Key 来进行替换。例如子类可以通过 Role 这个 Key 来覆盖其父类所安装的 EditPolicy 。在 GEF 中, Role EditPolicies 能够被划分为两类: Graphical Non-Graphical 。非图形的角色能够不需要知道任何 View 的信息来处理模型对象,也就是说这种角色在不同类型的 viewers 中是可重用的。

  4. 角色及其定义

Non-Graphical Roles:

1) COMPONENT_ROLE:

一个 Component 存在于一个 parent 中,并且可以从 parent 中删除。更为一般的,它可以使任何只涉及到这个 EditPart ,而与 View 无关的东西。 (More generally, it is anything that involves only this EditPart.)

2) CONNECTION_ROLE

这是 ConnectionEditParts 应该有的一个基本角色。 Connections Components 有一点不同,删除 Connections 时通常还需要其从其 source target 节点中删除,而不是从其 parent 中删除。

3) CONTAINER_ROLE

大部分拥有 children EditParts 都应该具有这个角色。一个 Container 会涉及到 adds/orphans 以及 creates/deletes 等操作。

4) NODE_ROLE

如果一个 EditParts 用户 Connection ,则其应该具有这个角色,它可以用来创建,删除,重新连接一个 Connection

  Graphical Roles:

1) PRIMARY_DRAG_ROLE:

用来允许用户拖动这个 EditPart 。用户可以通过点击这个 EditPart 然后拖动,或者点击这个 EditPart 所创建的一个 Handle 来进行拖动。

2) LAYOUT_ROLE:

Layout 角色用来放在一个 Container EditPart 上,这个 EditPart 拥有一个 graphical layout 。如果这个 layout constraints ,则它需要通过计算来得到这个 constraints

3) GRAPHICAL_NODE_ROLE:

A node supports connections to terminals.  When creating and manipulating connections, EditPolicies with this role might analyze a Request's data to perform "hit testing" on the graphical view and determine the semantics of the connection.

4) CONNECTION_ENDPOINTS_ROLE:

这个 Role 允许用户拖动一个 ConnectionEditPart 的端点。

5) CONNECTION_BENDPOINTS_ROLE:

这个 Role 允许用户能够在一个 Connection 中间拖动和创建 bendpoints

6) SELECTION_FEEDBACK_ROLE:

这个角色只是用来显示 feedback 。当鼠标进入或者在一个 EditPart 上暂停时, Selection Tool 会发送两个类型的 request EditPart 。安装了这个角色的 EditPart 能够在此时接受这些请求来改变 view 的样子,或者弹出 tip label 等。

7) TREE_CONTAINER_ROLE:

SWT Tree Layout Role

posted on 2006-05-26 21:02 llh 阅读(247) 评论(0)  编辑  收藏 所属分类: GEF

只有注册用户登录后才能发表评论。


网站导航:
 

<2024年5月>
2829301234
567891011
12131415161718
19202122232425
2627282930311
2345678

常用链接

留言簿(1)

随笔分类

随笔档案

文章分类

文章档案

相册

收藏夹

搜索

  •  

最新评论