[BACK]Return to graph.kk CVS log [TXT][DIR] Up to [local] / OpenXM / src / k097 / debug

Annotation of OpenXM/src/k097/debug/graph.kk, Revision 1.1.1.1

1.1       maekawa     1: /* graph.kk , 1997, 4/9? */
                      2: /*  see object.kk for pre-installed objects
                      3: */
                      4:
                      5: /* cf. p.70 Java reference マニュアル */
                      6: class Circle extends Object {
                      7:   local x,  /* 中心 */
                      8:         y,
                      9:         r;  /* 半径 */
                     10:   def new0(xx,yy,rr) {
                     11:     this = new();
                     12:     x = xx; y = yy; r = rr;
                     13:     return(this);
                     14:   }
                     15:   def void show() {
                     16:     Print(AddString([
                     17:      "x=", ToString(x), " y=", ToString(y), " r=", ToString(r)]));
                     18:     Ln();
                     19:   }
                     20:   def area() {
                     21:     return( (31415/10000)*r*r );
                     22:   }
                     23: }
                     24:
                     25: /* cf. p.89 Java reference マニュアル */
                     26: class GraphicCircle extends Circle {
                     27:   local outline, fill;
                     28:   def new0(xx,yy,rr) {
                     29:     this = new(super.new0(xx,yy,rr));
                     30:     outline = 1; /* default value */
                     31:     fill = 1; /* default value */
                     32:     return(this);
                     33:   }
                     34: }
                     35:

FreeBSD-CVSweb <freebsd-cvsweb@FreeBSD.org>