swarm-support
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [Swarm-Support] problems with control panel buttons


From: Steve Railsback
Subject: Re: [Swarm-Support] problems with control panel buttons
Date: Mon, 08 Nov 2004 07:57:23 -0800
User-agent: Mozilla/5.0 (Windows; U; Windows NT 5.1; en-US; rv:1.4) Gecko/20030624 Netscape/7.1 (ax)

Armano Srbljinović wrote:
Hello,
I am using SWARM tutorial as a basis for building my own SWARM application (using java-based SWARM 2.1.1). I succeeded in building an application that runs multiple experiments (the so-called "ExperimentSwarm"). However, while doing this, I lost the capability of controlling the "stop" and "next" buttons on the Control Panel. It seems to me that calls to doTkEvents work from within my ObserverSwarm but do not work from within my ModelSwarms. In other words, while running my ModelSwarms, "stop" and "next" buttons on the Control Panel are insensitive to pressing them. What's wrong?

(By the way, please avoid sending HTML messages to Swarm mail lists.)

I am not sure exactly what the problem is, but...

Here is some code that Glen Ropella wrote in our ExperimentSwarm, which opens a new, separate control panel for each experiment. It's in Obj-C but perhaps you can do the same thing in Java.

Steve Railsback

*****************************
- buildObjects
{

  [super buildObjects];

  [controlPanel setStateStopped];

  //
  // creates the controller for the subSwarm
  //
  subSwarmControl = [ActivityControl createBegin: [self getZone]];
  [subSwarmControl setDisplayName: "Model Run Controller"];
  subSwarmControl = [subSwarmControl createEnd];

...

  return self;
}


- buildModel {


  [subSwarm buildObjects];

  [subSwarm buildActions];

  [subSwarm activateIn: nil];

  [subSwarm setExperSwarm: self];

  // this if is an artefact of bad design for the ActivityControl class
  if (![probeLibrary isProbeMapDefinedFor: [ActivityControl class]]) {
    // now that the subSwarm is activated, attach the controller to it
    [subSwarmControl attachToActivity: [subSwarm getActivity]];
    CREATE_ARCHIVED_PROBE_DISPLAY (subSwarmControl);
  }
  else
    [subSwarmControl attachToActivity: [subSwarm getActivity]];

  return self;
}




--
Lang Railsback & Associates
250 California Ave.
Arcata CA 95521
707 822 0453



reply via email to

[Prev in Thread] Current Thread [Next in Thread]