Scrolling diagram nodes into view [message #730694] |
Wed, 28 September 2011 21:46 |
Thomas Spall Messages: 29 Registered: July 2009 |
Junior Member |
|
|
I would like to select a particular diagram node - respectively potentially multiple nodes - and then scroll them into the user's visible field on a best effort approach. I.e. if there is only one node or the selected nodes are conveniently close, the view is scrolled and centred on the cluster and the user indeed can see all selected nodes. Otherwise, it does something default like e.g. always scrolling to the first node.
Main question is: Does anyone know if this functionality or something similar is already existing in the GMF framework somewhere?
If not, where would be a good point to insert this or start from?
Thanks,
Thomas
[Updated on: Wed, 28 September 2011 21:46] Report message to a moderator
|
|
|
|
|
Re: Scrolling diagram nodes into view [message #1034427 is a reply to message #1033410] |
Fri, 05 April 2013 12:17 |
|
Hi Ralph,
Thanks for the reply. I managed to do in the following lines of code:
GraphicalViewer gv = (GraphicalViewer)editor.getAdapter(GraphicalViewer.class);
FigureCanvas figureCanvas = (FigureCanvas) gv.getControl();
figureCanvas.scrollTo(coordinatesRectangle.x,coordinatesRectangle.y);
where the editor is the DiagramEditor and the x and y are the new values the scroll should take place.
Hope this helps to somebody else also.
|
|
|
Powered by
FUDForum. Page generated in 0.02983 seconds