The Eclipse Graphical Editing Framework: A Simple Draw2D Example
- 2.1 Draw2D Installation
- 2.2 Draw2D Project
- 2.3 Draw2D Application
- 2.4 Draw2D View
- 2.5 Draw2D Events
- 2.6 Book Samples
- 2.7 Summary
- References
Before covering the Draw2D infrastructure (see Chapter 3 on page 21) and each area of building a Draw2D diagram in depth, it is useful to create a simple example on which discussion can be based. This chapter takes a step-by-step approach to creating a simple Draw2D diagram representing the relationship between two people and their offspring. To start, we take an unsophisticated "brute force" approach, which we will refactor and refine in later chapters as we introduce more concepts. This process provides valuable firsthand experience using the Draw2D API.
2.1 Draw2D Installation
Select the Help > Install New Software... menu to install the GEF framework into Eclipse. When the Install wizard opens, select the Eclipse release update site (e.g., Indigo - http://download.eclipse.org/releases/indigo). Once the wizard refreshes, expand the Modeling category and select Graphical Editing Framework GEF SDK (see Figure 2–1). Alternatively, if you would like to install a different version of GEF, enter the GEF specific update site (http://download.eclipse.org/tools/gef/updates/releases) in the Install wizard and select the GEF features you wish to install. After you click Finish and restart Eclipse, the GEF framework installation is complete.
Figure 2–1 Install wizard.