Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Eclipse Projects » GEF » [GEF4] Dynamic graph attributes
[GEF4] Dynamic graph attributes [message #1710022] Fri, 02 October 2015 17:36 Go to next message
Greg Watson is currently offline Greg WatsonFriend
Messages: 115
Registered: July 2009
Senior Member
I'm using the JFace Zest API. I would like to be able to change node and edge attributes (e.g. color) dynamically, say in response to a user selecting a node. I'm using the IGraphNodeLabelProvider to set the attributes, but the only way I can see to change the graph dynamically is to call the refresh() method on the ZestContentViewer. Unfortunately this has the effect of recreating the entire graph, which seems pretty undesirable for a mouse click. Also it means I lose any state information that was cached regarding the model.

Is there a better way to achieve this?

Thanks,
Greg
Re: [GEF4] Dynamic graph attributes [message #1710182 is a reply to message #1710022] Mon, 05 October 2015 08:38 Go to previous messageGo to next message
Alexander Nyssen is currently offline Alexander NyssenFriend
Messages: 244
Registered: July 2009
Location: Lünen
Senior Member
You can do this easily my using underlying MVC mechanisms. You can either bind an AbstractFXOnClickPolicy for Node- or EdgeContentPart, that is directly called by the FXClickDragTool whenever the user clicks the respective visuals. Alternatively, you can bind an IBehavior that registers it self as listener on the SelectionModel of the FXViewer. The first is the option that should be used if you want to have it undoable, the latter if not.
Re: [GEF4] Dynamic graph attributes [message #1710622 is a reply to message #1710182] Thu, 08 October 2015 02:40 Go to previous message
Greg Watson is currently offline Greg WatsonFriend
Messages: 115
Registered: July 2009
Senior Member
I'll give this a try. Many thanks.
Previous Topic:Zest2 in E4 JavaFX Application
Next Topic:[GEF4] Is there a tutorial?
Goto Forum:
  


Current Time: Thu Apr 25 01:28:42 GMT 2024

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

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

Back to the top