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進(jìn)行響應(yīng),生成Command來完成的。

          2) 顯示Feedback,在復(fù)雜的交互中,EditParts需要為用戶顯示操作的反饋。

          3) 上面所提的兩個工作,均可以被EditParts代理到其他額外的EditParts上。

           3. EditPolicyRole字符串的作用,是使得EditPolicy能夠用過這個Key來進(jìn)行替換。例如子類可以通過Role這個Key來覆蓋其父類所安裝的EditPolicy。在GEF中,RoleEditPolicies能夠被劃分為兩類:GraphicalNon-Graphical。非圖形的角色能夠不需要知道任何View的信息來處理模型對象,也就是說這種角色在不同類型的viewers中是可重用的。

           4. 角色及其定義

          Non-Graphical Roles:

          1) COMPONENT_ROLE:

          一個Component存在于一個parent中,并且可以從parent中刪除。更為一般的,它可以使任何只涉及到這個EditPart,而與View無關(guān)的東西。(More generally, it is anything that involves only this EditPart.)

          2) CONNECTION_ROLE

          這是ConnectionEditParts應(yīng)該有的一個基本角色。ConnectionsComponents有一點(diǎn)不同,刪除Connections時通常還需要其從其sourcetarget節(jié)點(diǎn)中刪除,而不是從其parent中刪除。

          3) CONTAINER_ROLE

          大部分擁有childrenEditParts都應(yīng)該具有這個角色。一個Container會涉及到adds/orphans以及creates/deletes等操作。

          4) NODE_ROLE

          如果一個EditParts用戶Connection,則其應(yīng)該具有這個角色,它可以用來創(chuàng)建,刪除,重新連接一個Connection

           Graphical Roles:

          1) PRIMARY_DRAG_ROLE:

          用來允許用戶拖動這個EditPart。用戶可以通過點(diǎn)擊這個EditPart然后拖動,或者點(diǎn)擊這個EditPart所創(chuàng)建的一個Handle來進(jìn)行拖動。

          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的端點(diǎn)。

          5) CONNECTION_BENDPOINTS_ROLE:

          這個Role允許用戶能夠在一個Connection中間拖動和創(chuàng)建bendpoints

          6) SELECTION_FEEDBACK_ROLE:

          這個角色只是用來顯示feedback。當(dāng)鼠標(biāo)進(jìn)入或者在一個EditPart上暫停時,Selection Tool會發(fā)送兩個類型的requestEditPart。安裝了這個角色的EditPart能夠在此時接受這些請求來改變view的樣子,或者彈出tiplabel等。

          7) TREE_CONTAINER_ROLE:

          SWT TreeLayout Role

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


          只有注冊用戶登錄后才能發(fā)表評論。


          網(wǎng)站導(dǎo)航:
           
          主站蜘蛛池模板: 鲁山县| 通州区| 缙云县| 剑河县| 隆回县| 达州市| 噶尔县| 曲麻莱县| 阿巴嘎旗| 南昌市| 临颍县| 应城市| 桃江县| 赫章县| 克山县| 吴江市| 城固县| 宁乡县| 康保县| 于都县| 外汇| 鄱阳县| 高陵县| 蚌埠市| 汕尾市| 同心县| 永新县| 昭平县| 西昌市| 阿坝| 灯塔市| 南安市| 竹山县| 广汉市| 万源市| 津市市| 桃江县| 土默特右旗| 竹山县| 铁力市| 出国|