eclipshine

          Eclipse主題站

          GEF的Developer Guide的筆記

          1. GEFView實際上包含有很多部分,而不僅僅只是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. EditPolicyRole字符串的作用,是使得EditPolicy能夠用過這個Key來進行替換。例如子類可以通過Role這個Key來覆蓋其父類所安裝的EditPolicy。在GEF中,RoleEditPolicies能夠被劃分為兩類:GraphicalNon-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應該有的一個基本角色。ConnectionsComponents有一點不同,刪除Connections時通常還需要其從其sourcetarget節點中刪除,而不是從其parent中刪除。

          3) CONTAINER_ROLE

          大部分擁有childrenEditParts都應該具有這個角色。一個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角色用來放在一個ContainerEditPart上,這個EditPart擁有一個graphical layout。如果這個layoutconstraints,則它需要通過計算來得到這個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會發送兩個類型的requestEditPart。安裝了這個角色的EditPart能夠在此時接受這些請求來改變view的樣子,或者彈出tip,label等。

          7) TREE_CONTAINER_ROLE:

          SWT TreeLayout Role

          posted on 2005-07-27 21:16 Living Not Striving 閱讀(1303) 評論(0)  編輯  收藏 所屬分類: GEF

          主站蜘蛛池模板: 手游| 华阴市| 格尔木市| 峡江县| 郓城县| 瑞昌市| 桐梓县| 通榆县| 宁乡县| 郁南县| 凯里市| 涪陵区| 永宁县| 陆良县| 六盘水市| 南岸区| 工布江达县| 大石桥市| 高密市| 奉化市| 迁安市| 金坛市| 略阳县| 当涂县| 永宁县| 德安县| 福泉市| 东明县| 察雅县| 呼伦贝尔市| 周至县| 交城县| 衡阳县| 红原县| 偏关县| 阿巴嘎旗| 泗水县| 蒲城县| 嘉黎县| 张家口市| 鄂托克旗|