Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Eclipse Projects » Sirius » Rounded corners and bordered nodes
Rounded corners and bordered nodes [message #1860963] Tue, 12 September 2023 09:22 Go to next message
Leonard Theisler is currently offline Leonard TheislerFriend
Messages: 16
Registered: September 2023
Junior Member
Hi everyone,

I'm new to Sirius and I am using it to make an editor for a modelling language called EGSM. I have two style related questions to make my editor more accurate (and nicer to use):
- I need to make a rectangle that has rounded corners, how can I acheive this?
- I also need to have shapes on the side of this rectangle, ideally on the line. I am using bordered nodes for this but they are not quite where I would like them to be.

I attached an image of what I currently have and what I am trying to achieve, does anyone have any tips?

Thank you
Re: Rounded corners and bordered nodes [message #1860968 is a reply to message #1860963] Tue, 12 September 2023 12:54 Go to previous messageGo to next message
Laurent Redor is currently offline Laurent RedorFriend
Messages: 300
Registered: July 2009
Senior Member
Hi Leonard,

For the rounded corner, this option is only available on "container". According to your example, the problem I saw is that with a container the label is on the top (and not centered vertically). I have attached an example: "roundedCorner.png".

To locate more precisely the border node location, you have to customize the style progamatically. It is not possible directly in the VSM (odesign file). You can use the extension point "org.eclipse.sirius.diagram.ui.styleConfigurationProvider" (see global documentation here), by using the method getBorderItemLocatorProvider to return a specific border node locator. In this locator, you have to set the BorderItemOffset (8 pixels by default). The offset represents how much of a bordered node can be "inside" its parent.

Regards,

Laurent


Laurent Redor - Obeo

Need training or professional services for Sirius?
http://www.obeodesigner.com/sirius
Re: Rounded corners and bordered nodes [message #1860987 is a reply to message #1860968] Wed, 13 September 2023 09:50 Go to previous message
Leonard Theisler is currently offline Leonard TheislerFriend
Messages: 16
Registered: September 2023
Junior Member
Hi Laurent

Thank you for your reply.

I have managed to make the rounded corners on the rectangle like I wanted to, however I am having some trouble with editing the style programmatically.

I have added the extension point to the plugin.xml file and I wanted to make my own style configuration as a sub class of SimpleStyleConfiguration like the documentation suggested. However, when I copy paste the implemetation of SimpleStyleConfiguration I get a lot of errors. Most of them are just a matter of importing a thing or two, but many remain. They are mostly errors where something cannot be resolved to a type (IBorderItemLocator, DDiagramElement, WrapLabel...) where I do not have the option to import the missing elements. Maybe I am missing some plugin dependencies? Also, do I need to define my own provider class or should the one from the documentation work fine? I have attached a few screenshots of the errors and plugin.xml file.

Thank you

Previous Topic:Adding to collections using the Set operation
Next Topic:[ANN] Sirius Desktop 7.2.1
Goto Forum:
  


Current Time: Sat Nov 02 09:38:19 GMT 2024

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

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

Back to the top