You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@netbeans.apache.org by GitBox <gi...@apache.org> on 2017/12/01 08:00:43 UTC

[GitHub] sdedic opened a new pull request #308: Support for lazy object creation in Visual Library

sdedic opened a new pull request #308: Support for lazy object creation in Visual Library
URL: https://github.com/apache/incubator-netbeans/pull/308
 
 
   For large graphs, the creation of Widgets is time consuming (talking about 10000s of objects) and for most of the part, they are even not visible to the user (I intentionally left aside printing etc). I have decided to register and create Widgets for only such objects, which are within the visible rectangle plus some surrounding area to allow the user smooth scrolling using keyboard. 
   
   Smaller number of "materialized" widgets also speeds up all operations on the visual hierarchy: graphs are usually rather flat structures (in terms of the visual library Widget hierarchy). In my case, there's just "entity" layer that contains all the figures "connection" layer that contains all the links between the figures. A figure has some sub-widgets, but most part of the graph lays flat in a BIG arraylist just under the layer Widget.
   
   All this can be implemented on top of unmodified Visual Library, but state tracking in VL assumes that **all** objects exist at all times. So when e.g. an object's state is set to highlighted, that object must have been already known to Visual Library. Consider a situation when the user hovers a loong connection with  endpoints far off the screen. The UI handler code will set the connection, and its endpoints as highlighted - but since VisualLibrary does not have any widgets registered for the endpoint (still outside the viewport) , it will throw an exception.
   
   I present here the minimal changes that allow the objects and their widgets to be lazily created. However the object state (selection, highlight) is tracked even though the object has currently no widgets associated (which also allows to cleanup widgets which are off screen).
   
   The entire system of creating widgets lazily, depending on scroll position, is still somwhat under development, and there are surely more approaches how to address this. So this PR is not a sophisticated lazy-painting system, but rather opens a door for one.
   

----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on GitHub and use the
URL above to go to the specific comment.
 
For queries about this service, please contact Infrastructure at:
users@infra.apache.org


With regards,
Apache Git Services