Building custom layout managers for Graphiti [message #1735849] |
Thu, 23 June 2016 09:24 |
Alex Rusu Messages: 4 Registered: September 2015 |
Junior Member |
|
|
Hello!
I have recently stumbled upon an issue in a tool I have developed about 6 months ago. The tool employed an existing extension point in ELK, at the time, entitled:
<extension
point="org.eclipse.elk.core.service.layoutManagers">
<manager
class="CustomGraphitiLayoutManager ">
</manager>
</extension>
and my implementation:
public class CustomGraphitiLayoutManager extends GraphitiDiagramLayoutManager{
@Override
protected boolean isNodeShape(final Shape shape) {
return true;
}
@Override
protected KNode createNode(final LayoutMapping mapping, final KNode parentNode,
final Shape shape) {
final KNode node = super.createNode(mapping, parentNode, shape);
final KShapeLayout nodeLayout = node.getData(KShapeLayout.class);
nodeLayout.setProperty(LayoutOptions.DIRECTION, Direction.DOWN);
nodeLayout.setProperty(LayoutOptions.LAYOUT_HIERARCHY, true);
return node;
}
}
With the given setup, I get the following issues:
* Unknown extension point: 'org.eclipse.elk.core.layoutManagers' in plugin.xml
* The GraphitiDiagramLayoutManager class no longer exists or has been renamed or moved
* The LayoutOptions no longer exists ( I have managed to fix that by replacing it with CoreOptions, but I am not sure it is the correct solution)
I am basically interested in getting a correct specification for creating and registering a custom graphiti diagram layout manager, within the correct extension point.
The only source I could find seems to not be up to date:
https://www.eclipse.org/elk/getting-started.php
|
|
|
|
|
|
Powered by
FUDForum. Page generated in 0.03998 seconds