GEFStudy Notes (2) SimulationGEFDesign Concept, anatomyGEF 1
GEFLike otherFrameworkSimilarly, it is a complex and huge (exaggerated). When we want to use it, we must fully understand its overall architecture and its operation process. This requires our perseverance and acumen. Journey started....
GEFThe main task is2dGraphic editing operations, such.
to make GEF can be widely used in a wide variety of 2D graphic editing field, GEF / easy combination / reusable MVC framework (of course, this method of decomposing and refining functional objects can be used in other places, other fields and other languages such as C # on ).
If you design This Strict MVC Framework ( For Model Is strictly independent, it does not depend on View And Controller) And This framework How To Easy to expand / Easy combination / Easy to use . Below I will follow my own bad ideas to see the sparrow's eye The ambition of Hongyan
ForMVCMedium
View part: GEF naturally use your own stuff draw2d . draw2d figuer as your own View .
ModelPart:It often contains wide-ranging and unpredictable business information. Therefore,GEFThe framework should minimize the constraints (the constraints will be described in detail below ).
Controller Part: Editpart/draw2d Of Figure/Model The three tree object models are Editpart The corresponding Draw2d Of Figure/Model Node Establish a one-to-one association.
The architecture is as follows:
Thoughts:
controller same View what about tree structures?
when controller in a tree, this facilitates functional breakdown (this is a bit like in class design composite over inheritance General)
the controller ( that is editpart) handle only
- logical functions
- Management Sub controller
- notify parent if necessary controller
Especially when you need to edit the interface on the GUI, you need to use a varietyUIBehavior rule2dElements (such as different shape blocks and connections with different behaviors) are combined to complete the work (for example, similarVisioSuch an interface), the advantages of this architecture are undoubtedly exposed.
To be continued.... (The following describes how to generate the preceding three tree models..)