Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Eclipse Projects » Sirius » Computed color for edges
Computed color for edges [message #1323477] Wed, 30 April 2014 09:20 Go to next message
Charlie Mordant is currently offline Charlie MordantFriend
Messages: 88
Registered: July 2010
Member

Hi,

Is there a way to retreive both source and target of an edge to compute its color?

When I try to compute for example red on an edge computed color, self is equals to my edge source, and it looks like I'm not able to access $view element.

Thank you in advance,

Charlie
Re: Computed color for edges [message #1323526 is a reply to message #1323477] Wed, 30 April 2014 09:55 Go to previous messageGo to next message
Pierre-Charles David is currently offline Pierre-Charles DavidFriend
Messages: 703
Registered: July 2009
Senior Member
Le 30/04/2014 11:20, Charlie Mordant a écrit :
> Hi,

Hi.

> Is there a way to retreive both source and target of an edge to compute
> its color?
>
> When I try to compute for example red on an edge computed color, self is
> equals to my edge source, and it looks like I'm not able to access $view
> element.

Depending on your case, if you have the source element, you may be able
to find the target by following the same path your
targetFinderExpression will (i.e. copying your target finder expression
inside your color computation). This assumes each semantic source has at
most one target. Even if it works it would no be ideal in terms or
performance and maintanability.

Another possibility would be to use the inverse cross-referencer to find
the view element: assuming you use Acceleo, call eInverse() on the
initial "self" then filter to select the DEdge element which would
correspond to the "view" variable if it was visible.

Can you open a bugzilla for giving direct access to the relevant
variable in that evaluation context?

Regards,
Pierre-Charles David


Pierre-Charles David - Obeo

Need training or professional services for Sirius?
http://www.obeodesigner.com/sirius
Re: Computed color for edges [message #1323550 is a reply to message #1323526] Wed, 30 April 2014 10:10 Go to previous messageGo to next message
Charlie Mordant is currently offline Charlie MordantFriend
Messages: 88
Registered: July 2010
Member

Thank you for the crossreferencer tips, i didn't thought about it looks like it totally fill my needs (for the moment).

I'll fill an issue on it (for example, self equals to $view should be nice, or edge associatedElement expression would be an alternative: both would have their advantages and counterparts).

Best regards Pierre-Charles, also for all the Nantes team.
Re: Computed color for edges [message #1323565 is a reply to message #1323550] Wed, 30 April 2014 10:17 Go to previous messageGo to next message
Charlie Mordant is currently offline Charlie MordantFriend
Messages: 88
Registered: July 2010
Member

For the records: https://bugs.eclipse.org/bugs/show_bug.cgi?id=433831
Re: Computed color for edges [message #1323785 is a reply to message #1323565] Wed, 30 April 2014 12:41 Go to previous messageGo to next message
Charlie Mordant is currently offline Charlie MordantFriend
Messages: 88
Registered: July 2010
Member

Hi,

I ended up with a hack which is working for my concern:
I made a style customization where i put a precondition as [$view.registerColorHack()/] which registers the current edge view in my service cache then call the property customization on 'strokeColor' that references my computed color.
Finally, my computed color has just to query this cache to retreive the corresponding edge...

This is a little ugly but works in any case.

Regards,
Re: Computed color for edges [message #1323838 is a reply to message #1323785] Wed, 30 April 2014 13:17 Go to previous messageGo to next message
Pierre-Charles David is currently offline Pierre-Charles DavidFriend
Messages: 703
Registered: July 2009
Senior Member
Le 30/04/2014 14:41, Charlie Mordant a écrit :
> Hi,
>
> I ended up with a hack which is working for my concern:
> I made a style customization where i put a precondition as
> [$view.registerColorHack()/]

Mmh, $view is not valid Acceleo 3 syntax: there is no prefix for
accessing variables in Acceleo 3. Are you sure this was not the root
issue? Maybe the "view" variable is actually visible but you used the
wrong syntax?


Pierre-Charles David - Obeo

Need training or professional services for Sirius?
http://www.obeodesigner.com/sirius
Re: Computed color for edges [message #1376536 is a reply to message #1323838] Fri, 23 May 2014 13:10 Go to previous message
Charlie Mordant is currently offline Charlie MordantFriend
Messages: 88
Registered: July 2010
Member

Hi Pierre-Charles,

Sorry, i didn't noticed you reanswer...
in fact, I'm using Acceleo 2 with OD, but post my issues on the Eclipse forum as of everyone can see a solution to a potential recurent question. So that $view is valid Wink. Sorry for the incovenience, I will try to be more attentive while posting.

Regards,
Previous Topic:Refreshing the palette after programmatically deselect a layer
Next Topic:An exception stack trace is not available.
Goto Forum:
  


Current Time: Tue Apr 23 12:49:17 GMT 2024

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

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

Back to the top