swarm-support
[Top][All Lists]
Advanced

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

RE: drawSelfOn:


From: Fred Wan
Subject: RE: drawSelfOn:
Date: Wed, 13 Sep 2000 22:04:29 +0200

OK, but the heatbug class has a method that handles the drawing, while in
simpleObserverBug there is no change to the bug class. Where does the
message go?

-----Original Message-----
From: address@hidden
[mailto:address@hidden Behalf Of Marcus G. Daniels
Sent: Wednesday, September 13, 2000 10:00 PM
To: address@hidden
Subject: Re: drawSelfOn:


>>>>> "FW" == Fred Wan <address@hidden> writes:

FW> I have trouble understanding the following fragment in
FW> SimpleObserverBug and translating it to Java. Can someone help me
FW> out here? Especially the M(drawSelfOn) is puzzling. In jheatbugs a
FW> message is sent to a heatbug object that then draws itself, but
FW> what happens here is unclear.

It's the same idea.  The drawSelfOn: message gets sent to the Bug instances
in the world.  drawSelfOn: gets passed the raster that you specify
via setDisplayWidget:.  Without the argument, the Bug would not have any
info about where to draw itself.  (That's at the end of Bug.m.)

The setObjectCollection: is optional.  It makes it faster to send the
drawSelfOn: messages (otherwise it is necessary to look at all the points
on the grid).  The grid itself is specified by setDiscrete2dDisplay:, and
it is needed in order to track where Bugs are.


                  ==================================
   Swarm-Support is for discussion of the technical details of the day
   to day usage of Swarm.  For list administration needs (esp.
   [un]subscribing), please send a message to <address@hidden>
   with "help" in the body of the message.


                  ==================================
   Swarm-Support is for discussion of the technical details of the day
   to day usage of Swarm.  For list administration needs (esp.
   [un]subscribing), please send a message to <address@hidden>
   with "help" in the body of the message.



reply via email to

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