|Re: refresh zest graph on click [message #975383 is a reply to message #975310]
||Wed, 07 November 2012 20:55
| Zoltan Ujhelyi
Registered: July 2015
there is no direct support for these features, however there are some ways to tackle the issue:
* If you are using a GraphViewer API, you could add org.eclipse.zest.layouts.Filter (in version 1.x) or org.eclipse.zest.core.widgets.LayoutFilter (version 2.x). A GraphViewer supports multiple filters, or your filter could have a switch functionality for selected items. In case of filtering changes you have to refresh the viewer.
* You could define with the GraphViewer API a content provider that reacts to the selection changes. If new elements are to be added, then you have to refresh the input, so the content provider runs again.
* Zest 2 introduces a new functionality called SubGraph handling (see http://wiki.eclipse.org/index.php/Zest#New_subgraph_rendering for details). Although this functionality does not directly support, what you need, but might form a basis to create it.
* All of the previous solutions relied on the creation and removal of nodes. If you want to have a dedicated place for non-visible objects, you would either need a very specific layout algorithm (quite probably custom written). If this is not acceptable, you could implement in your LabelProvider the IFigureProvider interface, and replace the filtered elements with non-visible Figures.
I hope, at least one of the ideas is useful to you.
Powered by FUDForum
. Page generated in 0.02453 seconds