Graphical Editing Framework: Difference between revisions

Content deleted Content added
m {{cleanup}}
SmackBot (talk | contribs)
Date/fix the maintenance tags or gen fixes
Line 1:
{{Cleanup|date=September 2007}}
{{cleanup}}
'''Graphical Editing Framework''' '''(GEF)''' is a framework that was developed for the [[Eclipse (software)|Eclipse]] platform. It is known as a framework with a very steep learning curve, but it offers some benefits.
 
Line 31:
=== Request, Response in GEF ===
 
<i>''Authors' Note: For the following, knowledge of [[Design Patterns]] definitely helps.</i>''
 
Any user action can be seen as an example of request. The nature of request is understood by the context of invocation. For the discussion, one can safely say that the "context" is determined by the active "tool". Tool can be any entry in palette that is selected by user. We can say that, user using a tool, generates "Requests". The request is handed over to selected editpart, which inturn returns an "Command".
Line 37:
This is achieved using [[Chain-of-responsibility pattern|Chain of responsibility]] over Editpolicies, the editpolicies determine if they can handle the request, else 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).
 
One another mechanism to achieve the same is to create Requests programatically and hand them over to Editparts. The command generated can be subsequently executed on the "CommandStack". <i>''See [[Command pattern|Using Commands]], CommandStack holds references to commands that were previously executed. This helps in "undo", "redo" of commands.</i>''
 
== GEF Design patterns ==
In addition to MVC, GEF developers/enthusiasts need to have a good under standing of [[Design Patterns]]. The most recurring design patterns under GEF are [[Factory_method_patternFactory method pattern|Factory]], [[Chain-of-responsibility pattern|Chain of responsibility]], [[Command pattern|Command]], [[Observer pattern|Observer]] and [[State pattern|State]]. These patterns are often mandatory under GEF, for instance EditPartFactory implementation. Certain aspects of GEF code can be correlated to these. The jargon(italicized text) is strictly GEF specific.
* Factory : Creating models from palette, creating <i>''editparts</i>'' and creating figures
* Observer : Typically a controller (read <i>''editpart</i>'') listening on Model and View.
* Chain of Responsibility : To decide which <i>''EditPolicy</i>'' should handle a <i>''Request</i>''.
* State pattern: A typical example of which is opening editors for an input model .