|
|
|
Re: Add LayoutAlgorithm in MinMap example [message #1803077 is a reply to message #1794027] |
Thu, 21 February 2019 21:24 |
|
Hi Joao,
sorry, for not coming back to this earlier.
The LayoutAlgorithm can be set as an attribute on the Graph object. In order to integrate ELK with current Zest defaults, you would need to implement an ILayoutAlgorithm that transforms the Graph, invokes ELK, and applies the results back. Using default LayoutBehaviors requires to read and write LayoutProperties[1].
However, you are not bound to conform to this mechanism. Maybe it is easier to create a LayoutPolicy that does not force a layout mechanism on to you but a transaction mechanism that enables you to undo/redo a layout. The main difference would be that a LayoutPolicy needs to be invoked explicitly while a LayoutBehavior will react on its own. The latter is good enough for most cases, but when seeking more control, replacing it with a passive component (Policy) is a viable approach.
[1] https://github.com/eclipse/gef/blob/6920fe104da1ae4b6b841e31850e7dc89d1ede57/org.eclipse.gef.layout/src/org/eclipse/gef/layout/LayoutProperties.java#L27
Best regards,
Matthias
|
|
|
|
|
Powered by
FUDForum. Page generated in 0.04272 seconds