The Figure abstraction

Skip to first unread message

Baldvin Kovacs

Dec 17, 2015, 9:58:21 AM12/17/15
to kojo-user

could somebody explain to me what is the Figure abstraction (./scala/net/kogics/kojo/figure/Figure.scala)?

I am reading the source code with the intent to understand enough that I can write a little introduction and a reference in Hungarian for my children. I found that "animate{...}" is delegated to figure0, using its refresh method.

Then I found that the canvas implementation has a list of turtles and a list of figures. I kind of understand the reason to have a list of turtles. But other then a few builtins delegating to figure0, I don't see the figures being used for anything. The newFigure call seems to be called only at one call site, for example, when figure0 is instantiated.

I did read the source of Figure.scala, and I'll read it a few more times, yet if somebody could explain to me the thought behind it, it would be very appreciated.


Lalit Pant

Dec 17, 2015, 2:49:45 PM12/17/15
to Baldvin Kovacs, kojo-user
Hi Baldvin,

Figure was the core engine for the original Canvas API, and then the Staging API. At this point, Canvas is gone, and Staging is not used much (we instead have Pictures to do a lot of what Canvas and Staging did).

As of now, Figure is just an internal class that helps with Picture animation.

Hope this helps.

- Lalit


You received this message because you are subscribed to the Google Groups "kojo-user" group.
To unsubscribe from this group and stop receiving emails from it, send an email to
To post to this group, send email to
To view this discussion on the web visit
For more options, visit

Baldvin Kovacs

Dec 17, 2015, 4:27:02 PM12/17/15
to Lalit Pant, kojo-user
Thanks for the explanation, this really helps. I was able to guess that the weirdness is related to some transitional stage, I just didn't know if the code base was transitioning _to_ or _from_ using the Figure abstraction. (And the staging code sent me to the bushes for a few hours, I didn't realize at first read of the code that it is mostly an unused ballast.)

Reply all
Reply to author
0 new messages