Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Eclipse Projects » Sirius » Diagram extension question
Diagram extension question [message #1776542] Fri, 17 November 2017 13:59 Go to next message
Eduardo Silva is currently offline Eduardo SilvaFriend
Messages: 12
Registered: September 2014
Junior Member
Hello there,

I'm developing a GEMOC solution for a DSL. The GEMOC part is already done and it works pretty good, but I have some questions about Sirius diagram extension mechanism.

The background:
I have a completely functional language, let's call it language A, with Sirius diagrams working pretty good. I needed to extend the metamodel elements to include some properties I will use for GEMOC (the GEMOC part is not important, just giving the context). GEMOC generates the extended language model, classes and adapters, so I have a second language (extended A) also completely functional in terms of metamodeling.
The fact is that I want to define an diagram extension for this extended A, that will (of course) extends the existing diagram definition of language A. In this first moment, I just want to change the color of element borders if a boolean property (hasChanged) is true.

I created, therefore, a new viewpoints specification file (.odesign) with a new viewpoint I called ExtendedA. This viewpoint contains a single element: a diagram extension. That extends an ActivityDiagram present in language A.
This extension contains a single layer, I named it Debug. Debug has a single element: a style customization. The predicate expression is [self.hasChanded/], since it will trigger when the boolean property hasChanged is true.
The style customization also have a single element: a property customization (by selection). Follows a print with the definition of this property customization.
index.php/fa/31305/0/

The issue is that the "value selection" field appears empty, and it is always empty. I tried a lot of things but nothing worked. I created a new UserDefinedColor DebugColor and want to use it as the value of borderColor, but the value never appears here.
index.php/fa/31306/0/

It is worth highlighting that not every element have this property (hasChanged), just a few. However, Sirius should ignore everyone that doesnt match it, right?

What am I missing?

@edit
I'm using Sirius 5.0.2
  • Attachment: sirius1.png
    (Size: 18.39KB, Downloaded 475 times)
  • Attachment: sirius2.png
    (Size: 6.38KB, Downloaded 376 times)

[Updated on: Fri, 17 November 2017 14:01]

Report message to a moderator

Re: Diagram extension question [message #1776545 is a reply to message #1776542] Fri, 17 November 2017 14:40 Go to previous messageGo to next message
Steve Monnier is currently offline Steve MonnierFriend
Messages: 470
Registered: May 2011
Senior Member
Hello,

Based on the screenshot, you have added a "User Color Palette" named DebugColor, but you have not defined a color inside it. In your property extension, it is a color that is expected not a palette.

Regards,
Steve


Steve Monnier - Obeo
Need training or professional services for Sirius?
http://www.obeodesigner.com/sirius
Re: Diagram extension question [message #1776546 is a reply to message #1776545] Fri, 17 November 2017 14:41 Go to previous messageGo to next message
Steve Monnier is currently offline Steve MonnierFriend
Messages: 470
Registered: May 2011
Senior Member
By the way, there are different kind of colors that can be added to a "User Color Palette". You can find more information about it here: https://www.eclipse.org/sirius/doc/specifier/general/Colors.html

Steve Monnier - Obeo
Need training or professional services for Sirius?
http://www.obeodesigner.com/sirius
Re: Diagram extension question [message #1776548 is a reply to message #1776546] Fri, 17 November 2017 14:59 Go to previous messageGo to next message
Eduardo Silva is currently offline Eduardo SilvaFriend
Messages: 12
Registered: September 2014
Junior Member
Hello Steve,

Oh, I cut off the part of the screenshot that shows the arrow to expand the defined User Colors. But there is one.

@edit
index.php/fa/31307/0/
  • Attachment: sirius3.png
    (Size: 1.40KB, Downloaded 293 times)

[Updated on: Fri, 17 November 2017 15:02]

Report message to a moderator

Re: Diagram extension question [message #1776553 is a reply to message #1776548] Fri, 17 November 2017 16:12 Go to previous messageGo to next message
Steve Monnier is currently offline Steve MonnierFriend
Messages: 470
Registered: May 2011
Senior Member
Ok ok that was too simple.

I tested with a sample and it seems that we have a bug. When the "apply on all" checkbox is checked...the value selection list is empty/blank. Can you try to uncheck the checkbox, then select your color and then check it again? With my sample I end up with the wanted result (despite the extra steps) and the serialisation of the odesign file is OK.
Can you create a bugzilla on this issue please?

Regards,
Steve


Steve Monnier - Obeo
Need training or professional services for Sirius?
http://www.obeodesigner.com/sirius
Re: Diagram extension question [message #1776558 is a reply to message #1776553] Fri, 17 November 2017 17:13 Go to previous messageGo to next message
Eduardo Silva is currently offline Eduardo SilvaFriend
Messages: 12
Registered: September 2014
Junior Member
Hello Steve,

I tried that, still empty. I managed to add the value manually (editing the file as text), but apparently is not working. Is the property name borderColor correct? I'm pretty sure that I'm setting the wrong property. I saw in an example but can be outdated. Will try to change the color of the element, instead of the border.
Re: Diagram extension question [message #1776717 is a reply to message #1776558] Mon, 20 November 2017 17:31 Go to previous message
Steve Monnier is currently offline Steve MonnierFriend
Messages: 470
Registered: May 2011
Senior Member
Hello,

Yes the property is named "borderColor". You need to select the a style to have the auto-completion if I remember correctly. When I tested it provided me with the choices color, labelColor and borderColor.

Regards,
Steve


Steve Monnier - Obeo
Need training or professional services for Sirius?
http://www.obeodesigner.com/sirius
Previous Topic:Two different representations of the same relationship
Next Topic:Evaluating "If" condition in Acceleo/Sirius
Goto Forum:
  


Current Time: Sat Apr 04 16:36:57 GMT 2020

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

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

Back to the top