Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Eclipse Projects » Sirius » Custom node styles and edit parts initialized the wrong size.
Custom node styles and edit parts initialized the wrong size. [message #1849438] Thu, 20 January 2022 04:46 Go to next message
Erik Danielsson is currently offline Erik DanielssonFriend
Messages: 14
Registered: September 2021
Junior Member
I have followed this tutorial: https://www.eclipse.org/sirius/doc/developer/extensions-provide_custom_style.html

But I have an issue where the nodes are initialized with the wrong size on the diagrams. In the .odesign there is a "size computation expression" but that creates nodes with height and width of 10x the number given. Which does not leave any options for say, 100x60.

It seems that the prefsize given to the figure in createNodeFigure() does not have an impact for me. Or, it is later overwritten in the AbstractDiagramNodeEditPartRefreshVisualsOperation

Any advice? I can provide examples of the code if needed.

Thanks in advance!
Re: Custom node styles and edit parts initialized the wrong size. [message #1849472 is a reply to message #1849438] Fri, 21 January 2022 00:00 Go to previous messageGo to next message
Steve Monnier is currently offline Steve MonnierFriend
Messages: 570
Registered: May 2011
Senior Member
Hi Erik,

Indeed, Custom Style should probably have the fields height and width that are available for a Square Style. Can you open a bugzilla about it?
What is the goal of your custom nodes style and edit part? Maybe only the edit part is necessary and you can keep on using a Square Style.

Best regards,
Steve


Steve Monnier - Obeo Canada
Need training or professional services for Sirius?
http://www.obeodesigner.com/sirius
Re: Custom node styles and edit parts initialized the wrong size. [message #1849505 is a reply to message #1849472] Fri, 21 January 2022 23:53 Go to previous message
Erik Danielsson is currently offline Erik DanielssonFriend
Messages: 14
Registered: September 2021
Junior Member
Hi Steve.

You mean put the height and width in the .odesign right? If so I can create a bugzilla for that.

But it would still be nice to be able to programmatically create the nodes with a certain size. With an empty field for the size computation expression. That way the size can easily be set along with all the other figure attributes that depend on it.
I have nodes of varying sizes and shapes, and as a workaround I have a service called during the node creation that updates the size of the figure using the rootLayoutData. However that seems a bit hacky compared to just creating the editpart/figure with the correct size. It also only works for manually created nodes.

I am currently trying to create some border nodes with different shapes. I can create the figure just fine, but the box is too small (10x20) which cuts off most of it. If I manually resize the box it looks fine.

Thanks for your help!

Erik
Previous Topic:Deploy Sirius project to an Eclipse RCP application (or other)
Next Topic:Why DiagramDialectUIServices by default uses setSelection() instead of selectAndReveal() ?
Goto Forum:
  


Current Time: Tue Sep 26 17:14:25 GMT 2023

Powered by FUDForum. Page generated in 0.02132 seconds
.:: Contact :: Home ::.

Powered by: FUDforum 3.0.2.
Copyright ©2001-2010 FUDforum Bulletin Board Software

Back to the top