Skip to main content



      Home
Home » Eclipse Projects » GEF » [GEF4] Dynamic graph attributes
[GEF4] Dynamic graph attributes [message #1710022] Fri, 02 October 2015 13:36 Go to next message
Eclipse UserFriend
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 04:38 Go to previous messageGo to next message
Eclipse UserFriend
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] Wed, 07 October 2015 22:40 Go to previous message
Eclipse UserFriend
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: Sat Nov 08 11:26:33 EST 2025

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

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

Back to the top