GEF is built on a architecture, which separates your data from how it is displayed and how users interact with it:
: Tutorials guide you through creating the three core layers: : Plain Old Java Objects (POJOs) or EMF-based models that notify listeners of changes. : Using the eclipse gef tutorial
| Layer | Purpose | Example | |-------|---------|---------| | | Data + properties | RectangleShape , Diagram | | Figure | Rendering | RectangleFigure | | EditPart | MVC bridge | ShapeEditPart | | Editor | Hosts viewer | ShapeEditor | | EditPolicy | Enables editing | Move, resize, delete | | Command | Undoable actions | SetBoundsCommand | GEF is built on a architecture, which separates
In ShapeEditPart :
import org.eclipse.draw2d. ; import org.eclipse.gef. ; import org.eclipse.gef.editparts.AbstractGraphicalEditPart; import com.example.shapeditor.figures.RectangleFigure; import com.example.shapeditor.model.Shape; ; import org