Skip to main content



      Home
Home » Modeling » Graphiti » Positioning IDecorator in different PictogramElement
Positioning IDecorator in different PictogramElement [message #1709633] Tue, 29 September 2015 14:12 Go to next message
Eclipse UserFriend
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 10:20] by Moderator

Re: Positioning IDecorator in different PictogramElement [message #1709668 is a reply to message #1709633] Wed, 30 September 2015 04:16 Go to previous messageGo to next message
Eclipse UserFriend
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 10:56 Go to previous messageGo to next message
Eclipse UserFriend
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 03:17 Go to previous message
Eclipse UserFriend
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: Wed Mar 19 09:38:42 EDT 2025

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

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

Back to the top