Node Resize when doing auto layout [message #1727947] |
Tue, 29 March 2016 16:29  |
Eclipse User |
|
|
|
Hi All 
I am just a newbie to elk and layouting 
I am usuing SIrius (based on GMF) to develope a modelling environment for an SDL. I have installed elk and I could see that it does auto-layout for my diagrams, how ever it automatically resizes the node as shown in the below image 

Do you have any idea why this is happening ? I have found some other guys also had this issue and apparently it because of the border spacing option of the layout option which is 12 by default.
Now, I need some help on how to override the default values for the layout options (maybe using extension points). I have check the video on youtube but it uses staticConfig as the extension point, which is not available anymore due to the reconstruction of elk.
I found this elk very interesting but since it resizes the nodes I can't use it right now 
Thanks,
Bests,
Parsa
|
|
|
|
Re: Node Resize when doing auto layout [message #1727993 is a reply to message #1727991] |
Wed, 30 March 2016 06:56  |
Eclipse User |
|
|
|
Example:
public class MyLayoutConnector extends GmfDiagramLayoutConnector {
...
protected KNode createNode(LayoutMapping mapping, ShapeNodeEditPart nodeEditPart,
IGraphicalEditPart parentEditPart, KNode parentKNode, Maybe<KInsets> kinsets) {
KNode node = super.createNode(mapping, nodeEditPart, parentEditPart, parentKNode, kinsets);
if (nodeEditPart instanceof MySpecialEditPart) {
KShapeLayout shapeLayout = node.getData(KShapeLayout.class);
shapeLayout.setProperty(CoreOptions.NODE_SIZE_CONSTRAINTS, SizeConstraint.fixed());
}
return node;
}
}
But beware! This is a very early stage of ELK and the APIs are likely to change further in the course of this year.
[Updated on: Wed, 30 March 2016 06:58] by Moderator Report message to a moderator
|
|
|
Powered by
FUDForum. Page generated in 0.02885 seconds