Graphical Editing Framework: Difference between revisions

Content deleted Content added
m clean up and fixes, typo(s) fixed: Often times → Oftentimes using AWB
Line 1:
 
'''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.
 
Line 18 ⟶ 17:
* 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. Often timesOftentimes the figure is some geometrical drawing.
 
=== Other Featured Design Patterns ===
Line 30 ⟶ 29:
== 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 pattern|Chain of responsibility]] 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).
Line 40 ⟶ 39:
* [http://gef.tigris.org/ A similar Graph Editing Framework at tigris.org]
{{Eclipse Foundation}}
 
[[Category:Graphics software]]
[[Category:Eclipse (software)]]