observing algorithm iterations

hello,

I'm building a graph display program and I have created a Layouter class that holds an iterative algorithm to move nodes.

My Layouter is an interface, and my question is: how (what structure, pattern, ...) should I use to allow:

- getting notification when an iteration is done, so that another class can draw the graph

- the drawing class pauses the algorithm for some time to let the user see the changes.

I tried an observer pattern but couldn't work out the pause thing.

Any ideas?

[539 byte] By [f1technicala] at [2007-10-2 15:08:53]
# 1
There are many way to do this must I would probably use a thread which can be controlled independently from the ui etc.
Gargoylea at 2007-7-13 14:02:50 > top of Java-index,Other Topics,Patterns & OO Design...