/* Marcus Daniels Oct. 5, 1999 Here's a working GUISwarm test case.. maybe you can see something different between it and yours? */ import swarm.defobj.Zone; import swarm.activity.Schedule; import swarm.activity.ScheduleImpl; import swarm.activity.Activity; import swarm.objectbase.Swarm; import swarm.simtoolsgui.GUISwarm; import swarm.simtoolsgui.GUISwarmImpl; import swarm.Selector; import swarm.Globals; public class TestGUISwarm extends GUISwarmImpl { Schedule schedule; Schedule stopSchedule; TestGUISwarm () { super (Globals.env.globalZone); } public void move () { System.out.println ("Moving at: " + Globals.env.getCurrentTime ()); } public void stopRunning () { getControlPanel ().setStateStopped (); } public Object buildActions () { schedule = new ScheduleImpl (this, 5); stopSchedule = new ScheduleImpl (this, true); try { Selector moveSel = new Selector (getClass (), "move", false); Selector stopSel = new Selector (getClass (), "stopRunning", false); schedule.at$createActionTo$message (1, this, moveSel); stopSchedule.at$createActionTo$message (100, this, stopSel); } catch (Exception e) { e.printStackTrace (System.err); } return this; } public Activity activateIn (Swarm swarmContext) { super.activateIn (swarmContext); schedule.activateIn (this); stopSchedule.activateIn (this); return getActivity (); } public static void main (String[] args) { Globals.env.initSwarm ("TestGUISwarm", "2.0.1", "bug-swarm@santafe.edu", args); GUISwarm guiSwarm = new TestGUISwarm (); guiSwarm.buildObjects (); guiSwarm.buildActions (); guiSwarm.activateIn (null); guiSwarm.go (); } }