[GEF5] Hover Feedback parts and zoom [message #1785009] |
Fri, 06 April 2018 21:58  |
Eclipse User |
|
|
|
In my graph I have a node that when I hover the mouse over it I pop up a visual displaying contextual information about that node. When I zoom the entire graph in and out this context popup shrinks with the graph. How to I get this feedback visual to stay legible? and disregard the zoom?
I've tried to get the inverse of the host visual parts localToSceneTransform matrix and scale by that... and it almost works except for when I drag the host part and the context pop up either shrinks or grows to oblivion as a drag it around.
I'm doing all this in the popup parts doRefreshVisual() method is that the right place to do it? Changing the transform of the visual causes the doRefreshVisual to be called multiple times so I'm guessing it should be done elsewhere?
|
|
|
Re: [GEF5] Hover Feedback parts and zoom [message #1785836 is a reply to message #1785009] |
Fri, 20 April 2018 08:07  |
Eclipse User |
|
|
|
Hi Kyle,
you need to place the popup visual in another layer than the contents, so that the popup is not scrolled/zoomed with the contents.
The InfiniteCanvas provides several JavaFX Parent visuals that can be used to place custom visualisations, e.g. scrollbar group (on top), overlay group, scrolled pane (this is where the contents are placed, too, but in a sub-layer thereof), and underlay group.
The underlayGroup is suitable for visuals that should lie behind the contents.
The overlayGroup is where you could place the popup.
Unfortunately, the GEF defaults do not place visuals in any other layer than the scrolled content layer of the InfiniteCanvas, i.e. you would probably want to extend the RootPart so that special PopupHandleParts are added to the overlay group instead.
Additionally, you will need to write code to keep the popup at the correct location within the overlay group.
If you have further questions, feel free to ask. Also, we can discuss code here that is giving you troubles.
h2h
Matthias
|
|
|
Powered by
FUDForum. Page generated in 0.05290 seconds