| < Day Day Up > |
In this chapter, we provide an introduction to GEF and Draw2D. You can read about the basics of the frameworks and get some first tips about using them.
After the introduction, we show you how to build a graphical editor skeleton using our step-by-step instructions, and then explain how to map your model into GEF edit
| Note |
The sample code we describe in this chapter is available as part of the redbook additional material. See Appendix A, "Additional material" on page 225 for details on how to obtain and work with the additional material. The sample code for this chapter is provided as Eclipse projects that can be imported into your Eclipse workbench. Each major section of this chapter has a matching Eclipse project in the additional material. |
| < Day Day Up > |
| < Day Day Up > |
The Graphical Editing Framework allows us to easily develop graphical representations for existing models. It is possible to develop feature rich graphical editors using GEF.
All graphical visualization is done via the Draw2D framework, which is a standard 2D drawing framework based on SWT from eclipse.org.
The editing possibilities of the Graphical Editing Framework allow you to build graphical editors for nearly every model. With these editors, it is possible to do simple modifications to your model, like changing element properties or complex operations like changing the structure of your model in different ways at the same time.
All these modifications to your model can be handled in a graphical editor using very common functions like drag and drop, copy and paste, and actions invoked from
For our demonstration code and for
Basically there are two kinds of additional resources available — one that ships with the Graphical Editing Framework and other
The Graphical Editing Framework SDK provides online help that is integrated into Eclipse. This should be used as a starting point. It is available by clicking Help -> Help Contents and then clicking the topic Draw2D Developers Guide or GEF Developer Guide on the left side of the new window.
| Note |
Only the GEF SDK is shipped with the developer documentation of GEF and Draw2D. |
The GEF Web site provides access to a wide range of resources
http://www.eclipse.org/gef
Any questions and topics not
A public community driven pool is available at:
http://eclipsewiki.swiki.net
The Eclipse Wiki also has a section for GEF related topics, which provides an additional list of answers for frequently asked questions and additional examples and other resources.
We found
The most common case might be a modelling application. You can build graphical editors for modelling nearly every kind of situation (for example, business processes, application models, or even UI screens).
There are also graphical editors available for designing documents such as
The possibilities are only limited by your
Available as an Eclipse-based IDE or plug-in, MDE for Struts (Figure 3-1) enables model-driven development of Struts 1.1 applications using standard UML. From simple class diagrams, MDE for Struts creates JSPs, Java classes, struts-config.xml, validator.xml, Application Resource, ANT build scripts and J2EE deployment files. You can take control of the architecture by changing Java MetaPrograms that translate the model to code. A free evaluation version is available at:
http://www.metanology.com
Figure 3-1:
Struts MDE
AcmeStudio (Figure 3-2) is a customizable editing environment and visualization tool for software architecture designs based on the Acme architectural description language (ADL). With AcmeStudio, you can define new Acme families for specific domains and customize the environment to work with those families by defining new diagram styles. AcmeStudio is an adaptable front-end that may be used in a variety of modeling and analysis applications. Written as an Eclipse plug-in, AcmeStudio provides the opportunity to integrate third-party architectural analysis tools.
Figure 3-2:
AcmeStudio
AcmeStudio is being developed at the School of Computer Science at Carnegie Mellon University. This work is supported in part by DARPA under Grants N66001-99-2-8918 and F30602-00-2-0616, and by the High Dependability Computing Program from NASA Ames, cooperative agreement NCC-2-11298.
EclipseDesigner (Figure 3-3) is a two-way visual designer for SWT. Design editing can be done in Java editor or visually on a design page using property tables and mouse manipulations in a GEF editor. It is freely available at:
http://eclipsedesigner.
Figure 3-3:
EclipseDesigner
Jeez Report Designer (Figure 3-4) allows visual designing of reports that can be executed using a report engine. It is freely available at:
http://jeez.sourceforge.net
Figure 3-4:
Jeez Report Designer
| < Day Day Up > |