HOME

TheInfoList



OR:

The Graphical Editing Framework (GEF) is an
Eclipse An eclipse is an astronomical event that occurs when an astronomical object or spacecraft is temporarily obscured, by passing into the shadow of another body or by having another body pass between it and the viewer. This alignment of three ce ...
project that provides framework and end-user components related to graphical applications.


History

GEF was initially developed as part of IBM's etools (com.ibm.etools.gef) and was contributed to
Eclipse An eclipse is an astronomical event that occurs when an astronomical object or spacecraft is temporarily obscured, by passing into the shadow of another body or by having another body pass between it and the viewer. This alignment of three ce ...
in 2002 in version 2.0.0, consisting then of two components: Draw2d, a 2D visualization component based on the Standard Widget Toolkit (SWT) and GEF (MVC), a related model-view-controller framework that can be used to realize graphical editors as part of Eclipse Rich Client Platform (RCP) applications. The first release at Eclipse was GEF 2.1.0 in March 2003. The next major version, GEF 3.0.0, was released in June 2004, providing many new features like support for rules and guides. Zest was added as a third project component in 2007 in version 1.0.0 as part of the GEF 3.4.0 release. Since 2004, when GEF 3.0.0 was released, only compatible changes have been applied to the framework's application programming interface (API). A new major revision of the framework has been developed in parallel to the maintenance of the GEF 3.x components by the project team since 2010. It is a complete redesign that is much more modular, uses JavaFX instead of SWT as underlying rendering framework, and can be used also independently of Eclipse RCP applications. Commonly referred to as GEF4, its components were initially released in version 0.1.0 (with still provisional API) in June 2015 as part of the GEF 3.10.0 (Mars) release. The GEF4 components are to be published in version 1.0.0 as part of the GEF 4.0.0 (Neon) release in June 2016.


GEF 3.x

GEF 3.x provides framework technology to realize graphical editors and views as part of Eclipse Rich Client Platform (RCP) applications. It is internally decomposed into three components: * Draw2d – A 2D visualization component based on the Standard Widget Toolkit (SWT) * GEF (MVC) - A model-view-controller component that can be used to realize graphical editors as part of Eclipse Rich Client Product (RCP) applications * Zest - A graph-based visualization toolkit that can be used to realize views for visualization of graph-like data structures as part of Eclipse RCP applications While graphical applications can be built on top of the GEF 3.x components directly, Draw2d and GEF (MVC) are also used by the Graphical Modeling Framework (GMF), which combines them with the Eclipse Modeling Framework (EMF) to create the code for both the data model and the graphical editor.


Architecture

Editors created with GEF (MVC) consist of the following components: * The diagram editor including tool palette * Figures which graphically represent the underlying data model elements * EditParts which match figures and their respective model elements * Request objects for user input * EditPolicy objects which evaluate the requests and create appropriate command objects * Command objects that edit the model and provide
undo Undo is an interaction technique which is implemented in many computer programs. It erases the last change done to the document, reverting it to an older state. In some more advanced programs, such as graphic processing, undo will negate the las ...
-redo


Design pattern usage

GEF makes heavy use of
design pattern A design pattern is the re-usable form of a solution to a design problem. The idea was introduced by the architect Christopher Alexander and has been adapted for various other disciplines, particularly software engineering. The " Gang of Four" b ...
s. These patterns are often mandatory under GEF and developers are required to understand them. * 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. ** Controller: The EditParts act as controllers. Typically, each model element has its matching EditPart. EditParts may contain other EditParts thereby matching model elements containing other model elements. EditParts also have a reference to the figure which graphically represents the model element. Finally, EditParts evaluate requests and create the appropriate command to edit the underlying model. ** 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. *
Factory A factory, manufacturing plant or a production plant is an industrial facility, often a complex consisting of several buildings filled with machinery, where workers manufacture items or operate machines which process each item into another. T ...
: Creating models from palette, creating EditParts and creating Figures *
Observer An observer is one who engages in observation or in watching an experiment. Observer may also refer to: Computer science and information theory * In information theory, any system which receives information from an object * State observer in con ...
: Typically a controller (EditPart) listening on Model and View *
Command Command may refer to: Computing * Command (computing), a statement in a computer language * COMMAND.COM, the default operating system shell and command-line interpreter for DOS * Command key, a modifier key on Apple Macintosh computer keyboards * ...
: To implement Undo and Redo functions *
Strategy Strategy (from Greek στρατηγία ''stratēgia'', "art of troop leader; office of general, command, generalship") is a general plan to achieve one or more long-term or overall goals under conditions of uncertainty. In the sense of the "art ...
: EditParts can install and remove EditPolicies dynamically *
Chain of responsibility The chain of responsibility is a policy concept used in Australian transport legislation to place legal obligations on parties in the transport supply chain or across transport industries generally. The concept was initially developed to apply ...
: 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. This is achieved using the
chain of responsibility The chain of responsibility is a policy concept used in Australian transport legislation to place legal obligations on parties in the transport supply chain or across transport industries generally. The concept was initially developed to apply ...
mechanism over Editpolicies. The editpolicies determine if they can handle the request, otherwise they pass on to the next editpolicy. The order of declaration of editpolicies determine the order in which the request is passed around. The capable editpolicy creates a command. This command is handed back to the tool which initiated the "Request". Execution of the command causes the model to be modified (Response).


References


External links


GEF Project Page

GEF Wiki

Create an eclipse-based application using the Graphical Editing Framework

Create an eclipse-based application using the Graphical Editing Framework (new version)
{{Eclipse Foundation Graphics software Eclipse (software)