Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Modeling » Graphiti » Positioning IDecorator in different PictogramElement
Positioning IDecorator in different PictogramElement [message #1709633] Tue, 29 September 2015 18:12 Go to next message
Alex Kravets is currently offline Alex KravetsFriend
Messages: 528
Registered: November 2009
Senior Member
When using getDecorators(...) method is it possible to instruct decorator to be drawn in another PictogramElement? Here is my use case:

I have a ContainerShape that is marked as default by green check image:

http://i.imgur.com/oQV8vmv.png

User can double-click on this image and make this Shape non-default, and thus a code in getDecorators(...) method triggers decorator to be drawn:

http://i.imgur.com/5P8RDej.png

This decorator is drawn in the PE that triggered this event, which is fine, but for my visual representation I'd like decorator to be drawn in another PE:

http://i.imgur.com/LYErRP1.png

Is this something that is doable?

Regards,
Alex

[Updated on: Wed, 30 September 2015 14:20]

Report message to a moderator

Re: Positioning IDecorator in different PictogramElement [message #1709668 is a reply to message #1709633] Wed, 30 September 2015 08:16 Go to previous messageGo to next message
Michael Wenz is currently offline Michael WenzFriend
Messages: 1894
Registered: July 2009
Location: Walldorf, Germany
Senior Member
Alex,

the method getDecorators is triggered for all pictogram elements on the diagram when the decorators are refreshed. Can you return the decorator only for the other PE instead of the original one? Unfortunatly I cannot follow your Googleusercontent links as they are not clickable or copyable...

HTH,
Michael
Re: Positioning IDecorator in different PictogramElement [message #1709732 is a reply to message #1709668] Wed, 30 September 2015 14:56 Go to previous messageGo to next message
Alex Kravets is currently offline Alex KravetsFriend
Messages: 528
Registered: November 2009
Senior Member
Thanks Michael,

I updated by original post. Not sure what happened with those images, I think Google Photos removes share after some period of time.

I tried refreshing decorators, but decorators did not refresh for all PEs when I executed getDiagramBehavior().refreshRenderingDecorators(getDiagram()); in ICustomFeature that is being returned in getDoubleClickFeature(...) of DefaultToolBehaviorProvider. What worked for me was executing getDiagramBehavior().refreshRenderingDecorators(containerToBeUpdated); where containerToBeUpdated is the PE that I wanted decorator to appear, and that worked.

Regards,
Alex

Re: Positioning IDecorator in different PictogramElement [message #1709790 is a reply to message #1709732] Thu, 01 October 2015 07:17 Go to previous message
Michael Wenz is currently offline Michael WenzFriend
Messages: 1894
Registered: July 2009
Location: Walldorf, Germany
Senior Member
Alex,

the call to refreshRenderingDecorators will update the decoratos for the given PE only, e.g. it is not recursive.

Michael
Previous Topic:Splitting the domain model and diagram file
Next Topic:"If the meaning of the X attribute isn't clear, there really should be more of a description...
Goto Forum:
  


Current Time: Sat Jul 21 23:08:41 GMT 2018

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

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

Back to the top