Feeling's profile路漫漫其修远兮,吾将上下而求索PhotosBlogLists Tools Help

Blog


    4/20/2006

    GEF的初步认识

     

    GEF我严重低估了它的学习周期,原因是我一直无法把握它的全局架构。了解了这一点之后,我首先从GEF的设计着手研究。

     

    在表现层上,GEF采用的是EditPartViewer,所有的用户界面都在上面显示,一般采用的是Draw2d。Draw2d上所有的图形都是实现了IFigure接口,所以实际上EditPartViewer上放置的都是一些IFigure。当用户针对EditPartViewer做出了一些动作,实际上都是对某个IFigure提出了请求。每一个IFigure都对应了一个控制器EditPart,EditPart也是一个事件监听器,用来捕获用户的操作事件。

     

    每一个EditPart都可以对应若干个EditPolicy。所有的用户请求分类都被认为是一种角色(Role),当EditPart收到一个用户请求以后,就会分析这个请求属于哪一种角色,然后将请求交给相应的EditPolicy进行处理。EditPolicy根据请求创建相应的Command,通过Command就可以操作GEF背后的Model,达到通过操作图形来操作Model的效果。由于EditPolicy是和Role对应的,而不绑定于EditPart,所以实际上针对不用的EditPart,EditPolicy能达到重用的效果。

    Comments

    Please wait...
    Sorry, the comment you entered is too long. Please shorten it.
    You didn't enter anything. Please try again.
    Sorry, we can't add your comment right now. Please try again later.
    To add a comment, you need permission from your parent. Ask for permission
    Your parent has turned off comments.
    Sorry, we can't delete your comment right now. Please try again later.
    You've exceeded the maximum number of comments that can be left in one day. Please try again in 24 hours.
    Your account has had the ability to leave comments disabled because our systems indicate that you may be spamming other users. If you believe that your account has been disabled in error please contact Windows Live support.
    Complete the security check below to finish leaving your comment.
    The characters you type in the security check must match the characters in the picture or audio.

    To add a comment, sign in with your Windows Live ID (if you use Hotmail, Messenger, or Xbox LIVE, you have a Windows Live ID). Sign in


    Don't have a Windows Live ID? Sign up

    Trackbacks

    The trackback URL for this entry is:
    http://cnfree2000.spaces.live.com/blog/cns!6201144F025F9D77!712.trak
    Weblogs that reference this entry
    • None