Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Eclipse Projects » GEF » Lazy-loading while rendering the graph
Lazy-loading while rendering the graph [message #228084] Fri, 15 December 2006 08:27 Go to next message
Eclipse UserFriend
Originally posted by: keyanema.rediffmail.com

Hi,

I am drawing a graph using GEF and Draw2D components. The graph which I
am trying to draw is quite huge carrying many widgets / figures. At the
time of loading or refreshing the graph, considerable delay is observed.
The whole application window seems to hang for a minute or two. If the
graph is pretty big then OutOfMemory error is also observed. I was
wondering if there is some way available with GEF which allows
lazy-loading i.e. loading only a portion of the graph with limited data
sets [ models ]. This will save considerable memory and loading time of
the graph.

Please update my knowledge regarding any such thing available with GEF.

Thanks & Regards,
Keya
Re: Lazy-loading while rendering the graph [message #228137 is a reply to message #228084] Sat, 16 December 2006 21:25 Go to previous messageGo to next message
Eclipse UserFriend
Originally posted by: none.unknown.com

In getModel*() methods of your EditPart, only return the children and
connections that you want created.

"Keya" <keyanema@rediffmail.com> wrote in message
news:c349812e458f6ce266ab9597a7f90e3f$1@www.eclipse.org...
> Hi,
>
> I am drawing a graph using GEF and Draw2D components. The graph which I
> am trying to draw is quite huge carrying many widgets / figures. At the
> time of loading or refreshing the graph, considerable delay is observed.
> The whole application window seems to hang for a minute or two. If the
> graph is pretty big then OutOfMemory error is also observed. I was
> wondering if there is some way available with GEF which allows
> lazy-loading i.e. loading only a portion of the graph with limited data
> sets [ models ]. This will save considerable memory and loading time of
> the graph.
> Please update my knowledge regarding any such thing available with GEF.
>
> Thanks & Regards,
> Keya
>
Re: Lazy-loading while rendering the graph [message #228191 is a reply to message #228137] Mon, 18 December 2006 06:40 Go to previous messageGo to next message
Eclipse UserFriend
Originally posted by: keyanema.rediffmail.com

Hi,

Yes, the getModel*() methods will return the necessary children to be
rendered on the graph. But these methods are not called again until the
EditPart is repainted. I want to reset the children on events like
Scrolling the graph in x / y direction. So depending on the area exposed
the children located within that range should only be displayed. Rest of
the children need not be rendered on the graph until the area occupied by
them is exposed.

I was trying to implement my own FigureCanvas class which is used in the
GraphicalViewer. This class implements the methods "ScrolltoX" and
"ScrollToY" which are called when the canvas is scrolled horizontally and
vertically. I am trying to re-populate the children list here. Is it
good enough and efficient? I am just worried it will slow down the entire
rendering graph process.

From the analysis of entire framework I also found that the views like
Outline View [ TreeViewer ] which list down model children and are also
synchronized with the graph causes major memory hog. What is your
suggesstion here ? Have you experienced load delay and memory problem
with TreeViewers?

Let me know your opinion.

Regards,
Keya


> In getModel*() methods of your EditPart, only return the children and
> connections that you want created.


> news:c349812e458f6ce266ab9597a7f90e3f$1@www.eclipse.org...
>> Hi,
>>
>> I am drawing a graph using GEF and Draw2D components. The graph which I
>> am trying to draw is quite huge carrying many widgets / figures. At the
>> time of loading or refreshing the graph, considerable delay is observed.
>> The whole application window seems to hang for a minute or two. If the
>> graph is pretty big then OutOfMemory error is also observed. I was
>> wondering if there is some way available with GEF which allows
>> lazy-loading i.e. loading only a portion of the graph with limited data
>> sets [ models ]. This will save considerable memory and loading time of
>> the graph.
>> Please update my knowledge regarding any such thing available with GEF.
>>
>> Thanks & Regards,
>> Keya
>>
Re: Lazy-loading while rendering the graph [message #228262 is a reply to message #228191] Mon, 18 December 2006 21:11 Go to previous messageGo to next message
Eclipse UserFriend
Originally posted by: none.unknown.com

How many editparts do you have in your diagram (including nodes and
connections)? Does you graph represent a hierarchical structure?

Doing it based on scrolling will not work. It certainly won't be very easy.
Probably not reliable or fast either (when scrolling). Remember,
adding/removing figures will affect the scrollbars, and cause layouts. If
you still want to try out this option, you can just add a listener to the
RangeModel. You don't need to create your own FigureCanvas. I wouldn't
recommend this option though.

Something more practical to do would be to have subgraphs that can be opened
by some trigger (say, double-clicking), assuming you have a hierarchical
structure. So, say in a UML Diagram, you show interface I, but not the
classes that subclass that interface until you double-click on I to show
them (note that these subclasses are not the child editparts of the editpart
for interface I).

The performance tests we had done a while back didn't reveal any problems
with the outline tree (in terms of cpu time), although that had somewhere
around 2000-2500 editparts. I suspect you have a lot more. If you only
create the first level children of any visible tree item, you might be able
to reduce the memory load.

"Keya" <keyanema@rediffmail.com> wrote in message
news:fc33aa21aaaeea882a1fa7b3176f6f2b$1@www.eclipse.org...
> Hi,
>
> Yes, the getModel*() methods will return the necessary children to be
> rendered on the graph. But these methods are not called again until the
> EditPart is repainted. I want to reset the children on events like
> Scrolling the graph in x / y direction. So depending on the area exposed
> the children located within that range should only be displayed. Rest of
> the children need not be rendered on the graph until the area occupied by
> them is exposed.
> I was trying to implement my own FigureCanvas class which is used in the
> GraphicalViewer. This class implements the methods "ScrolltoX" and
> "ScrollToY" which are called when the canvas is scrolled horizontally and
> vertically. I am trying to re-populate the children list here. Is it
> good enough and efficient? I am just worried it will slow down the entire
> rendering graph process.
> From the analysis of entire framework I also found that the views like
> Outline View [ TreeViewer ] which list down model children and are also
> synchronized with the graph causes major memory hog. What is your
> suggesstion here ? Have you experienced load delay and memory problem
> with TreeViewers?
>
> Let me know your opinion.
>
> Regards,
> Keya
>
>
>> In getModel*() methods of your EditPart, only return the children and
>> connections that you want created.
>
>
>> news:c349812e458f6ce266ab9597a7f90e3f$1@www.eclipse.org...
>>> Hi,
>>>
>>> I am drawing a graph using GEF and Draw2D components. The graph which I
>>> am trying to draw is quite huge carrying many widgets / figures. At the
>>> time of loading or refreshing the graph, considerable delay is observed.
>>> The whole application window seems to hang for a minute or two. If the
>>> graph is pretty big then OutOfMemory error is also observed. I was
>>> wondering if there is some way available with GEF which allows
>>> lazy-loading i.e. loading only a portion of the graph with limited data
>>> sets [ models ]. This will save considerable memory and loading time of
>>> the graph.
>>> Please update my knowledge regarding any such thing available with GEF.
>>>
>>> Thanks & Regards,
>>> Keya
>>>
>
Re: Lazy-loading while rendering the graph [message #228330 is a reply to message #228262] Tue, 19 December 2006 15:54 Go to previous message
Eclipse UserFriend
Originally posted by: keyanema.rediffmail.com

Pratik Shah wrote:

> How many editparts do you have in your diagram (including nodes and
> connections)? Does you graph represent a hierarchical structure?

The editParts required vary from 10 - lacs. Range is undefined. I am
expected to handle lacs of them.

> Doing it based on scrolling will not work. It certainly won't be very easy.
> Probably not reliable or fast either (when scrolling). Remember,
> adding/removing figures will affect the scrollbars, and cause layouts. If
> you still want to try out this option, you can just add a listener to the
> RangeModel. You don't need to create your own FigureCanvas. I wouldn't
> recommend this option though.

Yeah, I agree that scrolling is not at all efficient. But doesn't seem to
be any other option now. The graph is indeed hierarchial. It is somewhat
like a Gantt Chart. The way it is rendered is: I have certain valued
long Rectangles to be drawn. These long rectangles contain further
smaller rectangles. The smaller rectangles are the child editParts of the
larger one.

For instance, parent rectangle is of size (h = 50, w = 5000) and it
contains children to be drawn upon it at various locations. The child has
fixed size say (h=50 w=5) but the location of each child will be different
within the parent rectangle.

The mechanism which I was trying to implement is I draw the parent
rectangle [ This will be displayed all the while graph is alive].
Depending on the area visible populate the child editParts.

> Something more practical to do would be to have subgraphs that can be opened
> by some trigger (say, double-clicking), assuming you have a hierarchical
> structure. So, say in a UML Diagram, you show interface I, but not the
> classes that subclass that interface until you double-click on I to show
> them (note that these subclasses are not the child editparts of the editpart
> for interface I).

This will not be possible in this case I guess. Can you please suggesst
something for the case I mentioned above?

> The performance tests we had done a while back didn't reveal any problems
> with the outline tree (in terms of cpu time), although that had somewhere
> around 2000-2500 editparts. I suspect you have a lot more. If you only
> create the first level children of any visible tree item, you might be able
> to reduce the memory load.

Yup we have huge amount of editparts here. The Outline View is displaying
only the child editparts but since they are themselves many so problem is
arising while listing them down.

Let me know your opinion for the case.

Regards,
Keya
Previous Topic:diagram with root ToolbarLayout
Next Topic:DragAndDrop
Goto Forum:
  


Current Time: Sat Dec 20 10:29:34 GMT 2014

Powered by FUDForum. Page generated in 0.01984 seconds
.:: Contact :: Home ::.

Powered by: FUDforum 3.0.2.
Copyright ©2001-2010 FUDforum Bulletin Board Software