apply the observer pattern for the gui to get notifications from AntView
commitb8eccd977caae279a6ca4de5de52f1506ca736ff
authorJochen Keil <jochen.keil@gmail.com>
Sat, 3 Jul 2010 07:55:59 +0000 (3 09:55 +0200)
committerJochen Keil <jochen.keil@gmail.com>
Sat, 3 Jul 2010 07:55:59 +0000 (3 09:55 +0200)
tree973e0cf7ecac7285fc6a8c7b3cd638ac1117d63b
parent7632fa2632e7e88659b0bcae694840543bda3f7b
apply the observer pattern for the gui to get notifications from AntView

the update method does the following:
it removes the applet from the list of observers in the Environment
(which updates the graph etc.)
then it sets antView to null since it got disposed; we check somewhere
else for it being null;
if the Environment thread is not null and hasn't terminated yet we send
it an interrupt so it can return gracefully.
when this is done we set antThread to null so we can check for it later
finally we need to reset the button text
and after everything is done we run the gc since it might take a view
seconds before a user wants to start a new computation
src/aco/TspAcoGui.java