Graphical Editing Framework
From Wikipedia, the free encyclopedia
Just a quick writeup, please review
Graphical Editing Framework (GEF) is a framework that was developed for the Eclipse platform. It is known as a framework with a very steep learning curve, but it offers some benefits.
GEF consists of the following components
- draw2d has to be used for the View components
- Requests/Commands have to be used to edit the model
- Palette of Tools that are offered to the user
Contents |
[edit] Benefits
- Having a Graphical Representation and being able to edit it
- Predefined Tools for Selection, Connection Creation and others.
- MVC (Model View Controller) Concept
[edit] MVC Concept
Model: The model has to be implemented by the user or it exists already in case of a legacy software.
Controller: The EditPart acts as a controller. Usually a GraphicalEditPart is chosen. For each model element, including connections, a specific EditPart has to be implemented. Listeners for the model have to be registered in the function EditPart.activate() and have to be unregistered within EditPart.deactivate(). If a model change is detected the view has to be updated accordingly. The EditPart knows both the model and the view. The view has to be created within .createFigure().
View: For each element within the model, including connections, a View has to be implemented, using draw2d. In order to implement the view, an implementation of IFigure of the draw2d library has to be used.
[edit] GMF and EMF
The Graphical Modeling Framework offers the ability to create diagrams for Eclipse Modeling Framework models based on GEF.