Hiding the actual paint action until all items are painted

How can I make sure the painting of e.g. symbols on the view will not be shown until all symbols are painted? I build the diagram dynamically meaning the user can interact with a specific symbol by clicking on it and one or more child symbols will appear. (more or less like the expander sample in the sample browser)

Now (with the DirectedTreeLayoutManager) the child symbol will appear in the left corner of the the model. It will stay there until the link is created and a connection with the parent symbol is established. Then the child node is set to its correct location e.g. when the rotation degree is 0, beneath the parent symbol.
How can I avoid that the user will see all these actions? I just want to show the result, the child symbol(s) nicely positioned beneath the parent symbol.

Are there any other paint performance tips that can be helpful when building a diagram with several symbols?

Thanks in advance. Let me know if you have any questions regarding the situation of the problem.

Kind regards

Hanne

1 Reply

HA Hanne February 6, 2007 01:27 PM UTC

I found the solution. I knew about this method but I forgot about it:

* MyDiagram.Model.BeginUpdate();
Disables any redrawing of the Model until the following line is executed:

* MyDiagram.Model.EndUpdate(bool);
Enables the redrawing of the Model. Set bool to true if the attached Views have to be redrawn.

Enjoy for those who might need it!

Kind regards

Hanne

Loader.
Up arrow icon