TreeView does not Scroll to mouse-selected element
Original report by Anonymous.
When you use the option "Scenegraph > Component Highlight/select on click" the element you've selected does not gets scrolled to on the treeView and so you end up with the information of the node but still no idea where it is located on the tree.
Original comment by Developer Diez (Bitbucket: flaviodiez, GitHub: Unknown).
(I forgot to login before I've added the issue)
I found the reason for that and actually did a fix but somehow I cannot create a pull request (maybe I need to be allowed?). Anyway:
On ScenicViewGui.doDispatchEvent() after the case NODE_SELECTED runs its course, we immediately have the event ROOT_UPDATED being called which prompts a kind of refresh of the treeView.
This issue is apparently trying to be handled inside ScenegraphTreeView.updateStageModel():
#!java
if (previouslySelectedItem != null) {
/**
* TODO Why this is not working??
*/
// treeView.getSelectionModel().clearSelection();
// treeView.getSelectionModel().select(previouslySelectedItem);
/**
* TODO Remove
*/
setSelectedNode(previouslySelectedItem);
}
However that does not work correctly... By making the last line to be:
#!java
nodeSelected(previouslySelectedItem.getValue());
instead of:
#!java
setSelectedNode(previouslySelectedItem);
this actually starts to work again.
Just as info: I am running this on Ubuntu 16.04