Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Modeling » Graphiti » Graphiti framework and decorators
Graphiti framework and decorators [message #932806] Thu, 04 October 2012 12:57 Go to next message
Junior Lekane Nimpa is currently offline Junior Lekane NimpaFriend
Messages: 23
Registered: September 2012
Junior Member
Hello everybody,
I use currently image decorators to decorate the visualization of pictogramElement.
It works fine. But I have a small problem. I use property sheet to modify some properties of business objects. Depending on the property's values, i want to display a specific icon. In the documentation i found the following:

The list of decorators that shall be applied to a PictogramElement is queried from the IToolBehaviorProvider.getDecorators(PictogramElement) method when a shape is drawn or updated on the diagram by the Graphiti framework.

So,after that i changed a property's value through the property sheet i call the following method:
  IFeatureProvider.updateIfPossible(updateContext)

But the right icon is not displayed. I have first to move the shape in the editor, before the framework remark the change and display the right icon.
i ask me therefore, if it is possible to notify this part of the framework, that is responsible for displaying icons, in the update method so that i don't have to move the shape in the editor.
Does someone has an idea , how i could solve this problem

Many Thanks in advance
Junior
Re: Graphiti framework and decorators [message #933868 is a reply to message #932806] Fri, 05 October 2012 12:12 Go to previous messageGo to next message
Michael Wenz is currently offline Michael WenzFriend
Messages: 1931
Registered: July 2009
Location: Walldorf, Germany
Senior Member
Junior,

you shouold first check if your call to updateIfPossible really invokes any
UpdateFeature and if yes, if that update feature changes anything.

An alternative could also be to link the domain object you modify from the
property sheet with the shape that will hold the decorator. In that case
changing the domain object should cause an update.

Michael
Re: Graphiti framework and decorators [message #935385 is a reply to message #933868] Sun, 07 October 2012 00:50 Go to previous messageGo to next message
Junior Lekane Nimpa is currently offline Junior Lekane NimpaFriend
Messages: 23
Registered: September 2012
Junior Member
Hallo Michael,
thanks for your reply.

> you shouold first check if your call to updateIfPossible really invokes any
> UpdateFeature and if yes, if that update feature changes anything.

My call to updateIfPossible really works and i can see the changes after the call.

By debbuging, i found out that, before the IToolBehaviorProvider.getDecorator() is called,one method refresh() is called, so i tried the following after the call to
updateIfPossible :
GraphitiShapeEditPart.refresh()
But it does not work.
Actually, i don't know how to solve this issue.

Any hint and/or answer is welcome.
Regards
Junior
Re: Graphiti framework and decorators [message #936982 is a reply to message #935385] Mon, 08 October 2012 14:39 Go to previous messageGo to next message
Michael Wenz is currently offline Michael WenzFriend
Messages: 1931
Registered: July 2009
Location: Walldorf, Germany
Senior Member
Junior,

forcing the refresh could be done by calling refreshRenderingDecorators in
DiagramEditor.

Enforcing the refresh might be needed in case your update feature does not
need to change anything on diagram level. In that case the editor won't get
refreshed automatically.

Michael
Re: Graphiti framework and decorators [message #937310 is a reply to message #936982] Mon, 08 October 2012 22:02 Go to previous message
Junior Lekane Nimpa is currently offline Junior Lekane NimpaFriend
Messages: 23
Registered: September 2012
Junior Member
Hi Michael,
many , many,many thanks for your reply.
It works now.
Best regards
junior
Previous Topic:Maintaing a list of BoxRelativeAnchors in a Shape
Next Topic:BoxRelativeAnchor and connection end points
Goto Forum:
  


Current Time: Thu Apr 25 01:10:35 GMT 2024

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

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

Back to the top