racket/teachpack/htdc/Docs/idraw.thtml
2006-04-19 03:26:50 +00:00

53 lines
2.4 KiB
Plaintext

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