[Eclipse] GEF entry series (sequence)

Source: Internet
Author: User

I was always excited when I changed my new computer the other day. It was basically "out of service. It's almost New Year's Eve. Although I have no motivation to work, I have a poor gaming technology. It's still hard for Warcraft 3 to play a computer. Just write a post and take a rest!

Due to work needs, recently began to study the GEF (Graphical Editor framework) framework, which can be used to provide users with graphical model editing functions, so as to improve user experience, typical application-oriented flow designer and UML class Graph Editor. In fact, the projects we have done over the past year are related to it, but what I was previously responsible for has nothing to do with it. At that time, I also read what Huang Dafang wrote.Code, EMF and GEF are very dizzy and fail to stick to it. I have to do it myself this time. I just want to take this opportunity to understand it. I feel that what GEF has made gives people a very professional feeling and has powerful functions. It should be very promising. In addition, GEF uses many classic modes, such as the extensive application of command mode to conveniently implement Undo/Redo functions. By learning GEF, it is equivalent to practicing these modes, it is much better than just looking at several types of learning methods.

CurrentlyArticleAnd there are not many tutorials (several more than a year ago), which are basically those on eclipse.org. A few of them have Chinese versions, and the original Chinese is rare, the market does not seem to have such success books. Documents in the gef sdk are abstract and not suitable for beginners. I think the best way to get started is to look at the code, compare the document, and then do it by yourself. Of course, this example should be simpler. The logic example of GEF is too complicated, even the flow (see the running interface). In addition, the example should be more standardized, otherwise, it will not be worth the effort to change the course after learning the wrong path.

Flow editor compiled with GEF

the structure of GEF determines the complexity of the Program of the GEF application, even if the simplest GEF program contains five or six packages and dozens of classes, it is normal to feel dizzy at first. I found a good example. Of course it is quite simple. If you want to try GEF now, click here to download a zip package (if you cannot download it, please use this link ), six projects (pt1, pt2 ,..., Pt6), each of which is based on the previous one. pt1 is the simplest one, so that you can see the typical functions (such as directedit and palette) how should we implement it in GEF. For more information about this example, see the instructions on the author's blog:

"back in March, I talked a little about my initial attempts writing an eclipse Graphical Editor framework (GEF) application. I wanted, then, to write a tutorial that essential ed the reader through the various stages of the development of my first application. I even suggested some kind of versioned literate programming approach to writing the tutorial and the code at the same time.

I haven't had time since then to make any progress, but I did get the GEF application to the stage where I had put together a snapshot at each of six milestones. A few people have written to me over the last six months asking the status of my tutorial and I 've sent them my six snapshots as a starting point.

it makes sense for me to just to offer them here.

you can download a zip file with the six snapshots at http://jtauber.com/2004/gef/gef.zip.

hopefully they are still useful, even without a surrounding tutorial. "

Note that this example is written in eclipse 2.1. to run this example in eclipse 3, modify dependencies in plug-in. XML:

 
<ImportPlugin = "org. Eclipse. Core. Resources"/> <ImportPlugin = "org. Eclipse. GEF"/> <ImportPlugin = "org. Eclipse. UI"/> <ImportPlugin = "org. Eclipse. Core. RunTime"/> <ImportPlugin = "org. Eclipse. Core. runtime. Compatibility"/> <ImportPlugin = "org. Eclipse. UI. Views"/>

Modify the page in the finish () method of the diagramcreationwizard class. openeditor (newfile); this sentence is changed to page. openeditor (New fileeditorinput (newfile), "com. jtauber. river. editor ");, there are some warning does not affect, you don't need to worry about it.

Or if you are not in a hurry, pay attention to my half-new entry-level series of GEF posts, which may resonate with you more. It is also a solution.

The learning cycle of GEF is relatively long, so we should have this mental preparation before learning. Especially if you have not developed Eclipse plug-ins, it is best to take the time to familiarize yourself with the Eclipse plug-in architecture. There are still a lot of articles in this regard, which is not very difficult, basically, a simple editor can be developed, because GEF applications generally perform graphic editing in the editor. In addition, the vast majority of GEF applications are based on draw2d. It can be said that GEF cannot do without draw2d, while the latter has some difficult concepts to understand. In addition, it has fewer documents than GEF, so I will start with draw2d, of course, I can't go into depth, because I know nothing about it myself.

To be honest, I am not very confident in writing this series, because I am just getting started. However, if you wait a few months later to write it again, you may not be able to tell me much about it. If you still have any mistakes, please correct them and welcome them.

Related Article

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.