Graphical Editing Framework: Difference between revisions

Content deleted Content added
m clean up and fixes, typo(s) fixed: Often times → Oftentimes using AWB
Anyssen (talk | contribs)
Added some historic information about the project as well as information about the new development stream GEF4.
Line 1:
The '''Graphical Editing Framework''' '''(GEF)''' is an [[Eclipse (software)|Eclipse]] project that provides framework components to realize rich graphical applications.
'''Graphical Editing Framework''' '''(GEF)''' is a framework that was developed for the [[Eclipse (software)|Eclipse]] platform. It is used to create graphical editors for various diagrams like electrical networks or tree diagrams. Such diagrams offer easy editing capabilities for data in specific domains and are well suited as a graphical representation of that data. GEF editors can be used inside an Eclipse RCP application, the application framework offered by Eclipse. Usually, GEF is used as a part of the [[Graphical Modeling Framework|Graphical Modeling Framework (GMF)]] which combines the [[Eclipse Modeling Framework|Eclipse Modeling Framework (EMF)]] and GEF to create the code for both the data model and the diagram editor.
 
The project was initially contributed to Eclipse by IBM in 2002, consisting of two components: Draw2d, a 2D-visualization component based on the Standard Widget Toolkit (SWT), as well as GEF (MVC), a related model-view-controller component that can be used to realize graphical editors as part of an Eclipse Rich Client Product (RCP) application. It is inter alia used by the [[Graphical Modeling Framework|Graphical Modeling Framework (GMF)]], which combines the [[Eclipse Modeling Framework|Eclipse Modeling Framework (EMF)]] and GEF to create the code for both the data model and the graphical editor. Zest, a graph-based visualization toolkit, was added as a third project component in 2007. It can be used to realize views for visualization of graph-like data structures inside Eclipse applications.
==Structure==
 
Editors generated with GEF consist of the following components:
Since 2004, when GEF 3.0 was released, only compatible changes have been applied to the framework's application programming interface (API). A new major revision of the framework, GEF 4.0, has been developed in parallel to the maintenance of the GEF 3.x code base by the project team since 2010. It is a complete redesign that is much more modular (consisting of 9 components), uses JavaFX instead of SWT as underlying rendering framework, and can be used also independent of the Eclipse RCP platform. Commonly referred to as GEF4, it was initially released in version 0.1.0 (with still provisional API) in June 2015 with the Eclipse Mars release.
 
== Structure of GEF (MVC) ==
Editors generatedcreated with GEF (MVC) consist of the following components:
* The diagram editor including tool palette
* Figures which graphically represent the underlying data model elements
Line 10 ⟶ 14:
* Command objects that edit the model and provide [[undo]]-redo
 
=== Design Pattern Usage in GEF (MVC) ===
GEF makes heavy use of [[design pattern|Design Patterns]]. These patterns are often mandatory under GEF and developers are required to understand them.
 
==== Model-View-Controller Pattern in GEF ====
[[Model-View-Controller]] is an architectural design pattern which divides an application into separate parts which communicate with each other in a specific way. The goal is to separate data model (model), graphical user interface (view) and business logic (controller). GEF uses the MVC pattern extensively.
* Model: The data model can either be generated using EMF, self-implemented by the user or it may already exist in case of a legacy software.
Line 19 ⟶ 23:
* View: For each element within the model, including connections, a figure has to be implemented using the Draw2d framework. Oftentimes the figure is some geometrical drawing.
 
==== Other Featured Design Patterns ====
 
* [[Factory pattern|Factory]]: Creating models from palette, creating EditParts and creating Figures
Line 27 ⟶ 31:
* [[Chain-of-responsibility pattern|Chain of responsibility]]: To decide which EditPolicy should handle a Request
 
=== Request and Response Mechanism ===
 
Any user action with the editor can generate a request. The nature of the request is understood by the context of invocation. The context is determined by the EditPart the user interacts with and the active tool. The tool can be any selected entry in a tool palette. The request is handed over to the selected EditPart, which in turn returns a Command.
Line 34 ⟶ 38:
 
==External links==
* [http://www.eclipse.org/gef GEF Project Page]
* [http://wiki.eclipse.org/GEF GEF Wiki]
* [http://www-128.ibm.com/developerworks/opensource/library/os-gef/ Create an eclipse-based application using the Graphical Editing Framework]
* [http://www.ibm.com/developerworks/library/os-eclipse-gef11/ Create an eclipse-based application using the Graphical Editing Framework (new version)]
* [http://wiki.eclipse.org/index.php/Graphical_Editing_Framework GEF on Eclipsepedia]
* [http://gef.tigris.org/ A similar Graph Editing Framework at tigris.org]
{{Eclipse Foundation}}