implementation of the gui coupling with AntView
commitd12af60b9a90e120a3d3f637715ab7168899c150
authorJochen Keil <jochen.keil@gmail.com>
Sat, 3 Jul 2010 08:01:49 +0000 (3 10:01 +0200)
committerJochen Keil <jochen.keil@gmail.com>
Sat, 3 Jul 2010 08:27:50 +0000 (3 10:27 +0200)
treea9f6af3093d623915a66fd2ef715120e12dc0752
parentb8eccd977caae279a6ca4de5de52f1506ca736ff
implementation of the gui coupling with AntView

The AntFactory class is basically the same as AntMain but the static
methods return a Mediator to a fully configured Ant Environment.
This Environment needs just to be started as thread.
It can be received from the Mediator (called acom here) with this:
acom.getEnvironment();
After the user presses the Start/Stop button this happens:
first we check if the mediator is not null
if it isn't we create a new antview if necessarry and start it as it's
own thread
else we update the existing applet with the new mediator object
then we add ourselves as observer to the antView object
add the antView as observer to the environment (so the applet can pull
the data for drawing the graph etc.)
create a new thread for running the Environment
start it and change the button text
src/aco/AntFactory.java [new file with mode: 0644]
src/aco/TspAcoGui.java