swarm.simtoolsgui
Class GUISwarmImpl
java.lang.Object
|
+--swarm.BaseImpl
|
+--swarm.simtoolsgui.GUISwarmImpl
- public class GUISwarmImpl
- extends BaseImpl
- implements Swarm, SwarmS, WindowGeometryRecordName, WindowGeometryRecordNameS, GUISwarmS, GUISwarm
A version of the Swarm class which is graphics aware. .
GUISwarm is a subclass of Swarm that is used as a toplevel Swarm for simulations running with a graphical user interface. The GUISwarm creates a ControlPanel automatically for you and defines a -go method that interprets the state of the ControlPanel to keep things running in response to user input. Users subclass GUISwarm much like they subclass a normal Swarm, implementing the same kind of buildObjects, buildActions, and activateIn methods. When you are done building your Observer Swarm, start it as a toplevel via [myGUISwarm go]. The control panel places a few responsibilities on the GUISwarm subclass author. In particular, a message to [controlPanel doTkEvents] should be scheduled fairly frequently - only when that method is executed will the user interface update (and the stop button be checked). Also, it is often useful to use [controlPanel setStateStopped] to wait for the user to indicate they're ready for execution to proceed.
Methods implemented by this class for interface swarm.defobj.Zone |
allocIVars,
allocIVarsComponent,
copyIVars,
copyIVarsComponent,
describeForEach,
describeForEachID,
freeIVars,
freeIVarsComponent,
getComponentZone,
getPageSize,
getPopulation |
Methods implemented by this class for interface swarm.defobj.Drop |
drop |
Methods implemented by this class for interface swarm.defobj.DefinedObject |
compare,
describe,
describeID,
getDisplayName,
getTypeName,
getZone,
perform,
perform$with,
perform$with$with,
perform$with$with$with,
respondsTo,
setDisplayName,
xfprint,
xfprintid,
xprint,
xprintid |
Methods implemented by this class for interface swarm.defobj.GetName |
getName |
Methods inherited from class java.lang.Object |
equals,
getClass,
hashCode,
notify,
notifyAll,
toString,
wait,
wait,
wait |
controlPanel
public ControlPanel controlPanel
actionCache
public ActionCache actionCache
GUISwarmImpl
public GUISwarmImpl()
GUISwarmImpl
public GUISwarmImpl(Zone aZone)
- The create: message creates a new instance of a type with default options. The zone argument specifies the source of storage for the new object. The receiving object of this message is a previously defined type object. The message is declared as a class message (with a + declaration tag) to indicate that the message is accepted only by the type object itself rather than an already created instance of the type (which a - declaration tag otherwise defines). The create: message returns the new object just created. This object is an instance of some class selected to implement the type. The class which a type selects to implement an object may be obtained by the getClass message, but is not otherwise visible to the calling program. A caller never refers to any class name when creating objects using these messages, only to type names, which are automatically published as global constants from any @protocol declaration.