|Re: adaptViewNodeSizeWithLabel result over written [message #1822956 is a reply to message #1822916]
||Tue, 17 March 2020 10:48
| Simon Castle
Registered: June 2019
Thanks for your comments Steve.|
But calling setWidth() on the node results in
java.lang.IllegalStateException: Cannot modify resource set without a write transaction
I have simplified my real situation to highlight the problem in isolation from any other potential issues, in the example I have a simple square style on the node.
In reality I have a CustomEditPart which extends LozengeEditPart and a CustomFigure extending LozengeFigure which then draws its own shape.
This all appears to work, display and resize correctly.
The main issue is that the custom style only has a single SizeComputationExpression which doesnt fit my needs as I need my shapes to be wider than its height due to its label. When it is created.
It would be sufficient to issue the AutoSize command on creation of the new Node but I think this will also end up in the wrong transaction stack.
I have experimented with points 4/5 here https://wiki.eclipse.org/Sirius/Cookbook which did allow me to size the first container but the situation is more complex as the node in question is a subnode of a container. So in my odesign ContainerCreator, I made the container (CreateView) and its sub node (CreateView) and passed them both into a service where I tried to set some layout hints, but only managed to get it to work for the outer container. I may look into this again and try to figure out what the SiriusLayoutDataManager needs.
I have also tried to issue SetBoundsCommand() on the EditingDomain of the Part but again I end up in a ReadOnlyTransaction.
I have spent some days on this already, so my just live with it for now, may be the solution will revel itself later with more experience.
But if anyone has an idea how I may size this node correctly after its created I would be grateful.
[Updated on: Tue, 17 March 2020 10:58]
Report message to a moderator
Powered by FUDForum
. Page generated in 0.01697 seconds