Home > Articles > Programming > Java

The Eclipse Graphical Editing Framework: A Simple Draw2D Example

  • Print
  • + Share This
This chapter takes a step-by-step approach to creating a simple Draw2D diagram representing the relationship between two people and their offspring. This process provides valuable firsthand experience using the Draw2D API.
This chapter is from the book

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

Figure 2–1 Install wizard.

  • + Share This
  • 🔖 Save To Your Account