Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Eclipse Projects » Sirius » how to edit DDiagram element?
how to edit DDiagram element? [message #1818740] Thu, 26 December 2019 10:47 Go to next message
Qiran Cong is currently offline Qiran CongFriend
Messages: 20
Registered: November 2019
Junior Member
Look this requirement: in a wizard I select an EObject element, after selection all related nodes in the diagram turn into red border.
I want to use a tool, with operation the related DDiagram element can be modified programmatically. But I didn't find a way to modify the DDiagram's attributes, even in java service.
thank you.
Re: how to edit DDiagram element? [message #1818742 is a reply to message #1818740] Thu, 26 December 2019 12:47 Go to previous messageGo to next message
Steve Monnier is currently offline Steve MonnierFriend
Messages: 462
Registered: May 2011
Senior Member
Hello,

You are trying to execute a purely graphical modification of the style of nodes, therefore you need to access to the NodeStyle of the element (getOwnStyle()) and then register which feature will be modified from the odesign specification or the change will disappear at the next refresh. To do this you need to register the feature "color" to the getCustomFeatures method. After that you can change the color itself (setBorderColor).

Depending on the kind of relation you want to display with your wizard, it can be easier for the user if you have an edge mapping presenting these relations without having to use a tool.

Best regards,
Steve


Steve Monnier - Obeo
Need training or professional services for Sirius?
http://www.obeodesigner.com/sirius
Re: how to edit DDiagram element? [message #1818753 is a reply to message #1818742] Fri, 27 December 2019 07:58 Go to previous messageGo to next message
Qiran Cong is currently offline Qiran CongFriend
Messages: 20
Registered: November 2019
Junior Member
thank you for your help Steve, I made it!
I also need a function to format these nodes back to the default style, is there any convenient way to get access to the default style defined in odesign specification ?
Re: how to edit DDiagram element? [message #1818836 is a reply to message #1818753] Mon, 30 December 2019 09:44 Go to previous messageGo to next message
Steve Monnier is currently offline Steve MonnierFriend
Messages: 462
Registered: May 2011
Senior Member
Hello,

If you select a diagram element that has been modified from its specified type, in the tabbar of the editor a new action with the tooltip "Reset style properties to default value" will appear (it has an icon with a yellow arrow).
If you want to do it programmatically, in order to return each diagram element to their default style at once, you can use the command ResetStylePropertiesToDefaultValuesCommand.

Best regards,
Steve


Steve Monnier - Obeo
Need training or professional services for Sirius?
http://www.obeodesigner.com/sirius
Re: how to edit DDiagram element? [message #1818913 is a reply to message #1818836] Thu, 02 January 2020 00:55 Go to previous message
Qiran Cong is currently offline Qiran CongFriend
Messages: 20
Registered: November 2019
Junior Member
thank you, that works
Previous Topic:Hide BorderedNode when connected Edge is hidden or filtered
Next Topic:SIRIUS VS EPSILON?
Goto Forum:
  


Current Time: Wed Feb 26 17:44:05 GMT 2020

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

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

Back to the top