Skip to main content



      Home
Home » Eclipse Projects » Sirius » Rounded corners and bordered nodes
Rounded corners and bordered nodes [message #1860963] Tue, 12 September 2023 05:22 Go to next message
Eclipse UserFriend
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 08:54 Go to previous messageGo to next message
Eclipse UserFriend
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
Re: Rounded corners and bordered nodes [message #1860987 is a reply to message #1860968] Wed, 13 September 2023 05:50 Go to previous message
Eclipse UserFriend
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: Sun Apr 27 16:57:08 EDT 2025

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

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

Back to the top