Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Eclipse Projects » GEF » Asynchronous updates of Edges(How to dynamically update the visuals of edges based on changes in the underlying domain objects)
Asynchronous updates of Edges [message #1724340] Tue, 23 February 2016 09:27 Go to next message
johan kuijpers is currently offline johan kuijpersFriend
Messages: 2
Registered: September 2009
Junior Member
I've create a JFace based ZestViewer based on domain objects for nodes and edges which are being displayed as expected. I'm using my own LabelProvider etc etc.

What I fail to understand is how changes in the domain objects arriving asynchronously from a background thread are supposed to be visualized in the graph viewer.

I've studied the behavior framework and checked the post about dynamic graph attributes but these use-cases change visuals based on actions from within the gef4 framework.

The behavior monitors the various selection/content/hide models but I can't see a subscription mechanisme between the MVC (content) model and the JFace content provider.

viewer.getAdapter(ContentModel.class).getContents().setAll(Collections.singletonList(createRootGraph(getContentProvider(), getLabelProvider())));


The line above shows how domain objects delivered by the domain specific content provider is being used to populate the graph/viewer with nodes and edges. Once this is done it looks to me that changes in the domain objects can not be detected except for calling a complete refresh which causes also a layout.

Looking at how hiding works I've tried to add a complete set of 'EdgeStatusBehavior'/Operation/Policy to support edge status changes but now I can't traverse back to the domain objects because I only have references to the ContentModel etc. The obvious solution would be to introduce something like a EdgeStatusModel but this would result in duplication of state which I don't think is the way forward.

I'm a bit lost at present: Perhaps someone can push me in the right direction.

Thanks in advance.

[Updated on: Wed, 24 February 2016 07:23]

Report message to a moderator

Re: Asynchronous updates of Edges [message #1725601 is a reply to message #1724340] Fri, 04 March 2016 18:23 Go to previous messageGo to next message
Matthias Wienand is currently offline Matthias WienandFriend
Messages: 163
Registered: March 2015
Senior Member
Hi Johan,

the API is only designed for a complete refresh as the ZestContentViewer is lacking update methods for individual elements. Do you have ideas for a good API? If so, please open a Bugzilla. I will also think about this over the weekend.

Best regards,
Matthias
Re: Asynchronous updates of Edges [message #1731305 is a reply to message #1725601] Wed, 04 May 2016 08:30 Go to previous message
Christoph Broeter is currently offline Christoph BroeterFriend
Messages: 30
Registered: July 2015
Member
Hey!
I think that I am facing a related problem. See https://www.eclipse.org/forums/index.php/t/1076280/

My issue is that I want to update the color of edges. This works in the case that refresh() is called on the viewer object, but as you mentioned this will also call complete Layout (which is in my case not inteded).
In the meantime I've tried to implement a workaround. The idea is to maintain a map storing the visuals for all edges (of type EdgeContentPart) in the current styleprovider and implementing a factory like behavior for the styleprovider aswell.
Same I did for for the nodes(NodeContentPart) and this works great. Sad thing is that this workaround works for nodes but not for edges since I am not able to get the current reference to the used color. I don't know how the EdgeAttributeMap is used by the styleProvider to influence this workaround.

If you have found n way to archive update behavior on edges please let me know.
Previous Topic:automation testing
Next Topic:Javadoc failure when Running a headless build locally
Goto Forum:
  


Current Time: Wed Sep 26 12:18:03 GMT 2018

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

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

Back to the top