racket/teachpack/htdc/Docs/draw.thtml
Matthias Felleisen 2b4921291d addec docs for HtDC teachpacks
svn: r2215
2006-02-13 19:04:11 +00:00

50 lines
2.4 KiB
Plaintext

{ (define LIBNAME "A Functional Drawing Library (HtDC)")
(include "head.tinc") }
This `draw' package provides classes and methods for modeling in a visual
world. Here is its class diagram of public fields and methods:
<pre>
<code>
+-----------------------------------+
| abstract World |
+-----------------------------------+ +---------------------------------------+
| Canvas theCanvas |------>| Canvas |
+-----------------------------------+ +---------------------------------------+
| boolean bigBang(int,int,double) | +---------------------------------------+
| boolean endOfTime() | | boolean start(int,int) |
| boolean endOfWorld() | | boolean stop() |
| World lastWorld() | | boolean drawCircle(Posn,int,Color) |
| | | boolean drawDisk(Posn,int,Color) |
| abstract World onTick() | | boolean drawRect(Posn,int,int,Color) |
| abstract World onKeyEvent(String) | | boolean drawLine(Posn,Posn,Color) |
| abstract boolean draw() | | boolean drawString(Posn,String) |
| abstract boolean erase( | | boolean clearCircle(Posn,int,Color) |
+-----------------------------------+ | boolean clearDisk(Posn,int,Color) |
| boolean clearRect(Posn,int,int,Color) |
| boolean clearLine(Posn,Posn,Color) |
+---------------------------------------+
+----------+
| Posn |
+----------+
| int x |
| int y |
+----------+
+-------+
| Color |
+-------+
|
/ \
---
|
------------------------------------------
| | | | |
+-------+ +-------+ +-------+ +-------+ +-------+
| Blue | | Green | | Red | | White | | Yellow|
+-------+ +-------+ +-------+ +-------+ +-------+
</code>
</pre>
{(include "foot.tinc")}