Back to index

plt-scheme  4.2.1
Public Member Functions | Protected Attributes | Private Member Functions
draw.World Class Reference
Collaboration diagram for draw.World:
Collaboration graph
[legend]

List of all members.

Public Member Functions

boolean bigBang (int width, int height, double s)
native boolean endOfTime (String s)
native World endOfWorld (String s)
abstract World onTick ()
abstract World onKeyEvent (String ke)
abstract boolean draw ()

Protected Attributes

Canvas theCanvas = new SillyCanvas(600,600)

Private Member Functions

native boolean bigBangO (double s)

Detailed Description

Definition at line 3 of file World.java.


Member Function Documentation

boolean draw.World.bigBang ( int  width,
int  height,
double  s 
) [inline]
Author:
Matthias Felleisen, Kathy Gray
Parameters:
widthpositive int, the width of the visible canvas
heightpositive int, the height of the visible canvas
spositive double, the rate at which the clock ticks per second
Returns:
true if the world is created without obstacle

Definition at line 13 of file World.java.

                                                            {
       if (width <= 0)
           throw new RuntimeException(
                     "The method bigBang(int,int,double) expects " +
                     "the first argument to be greather than 0, given " 
                     + width);
       if (height <= 0)
           throw new RuntimeException(
                       "The method bigBang(int,int,double) expects " +
                     "the second argument to be greather than 0, given " 
                     + height);
       if (s <= 0)
           throw new RuntimeException(
                       "The method bigBang(int,int,double) expects " +
                     "the third argument to be greather than 0, given " 
                     + s);
       theCanvas = new Canvas(width,height); 
       return bigBangO(s);
    };

Here is the call graph for this function:

native boolean draw.World.bigBangO ( double  s) [private]

Here is the caller graph for this function:

abstract boolean draw.World.draw ( ) [pure virtual]
Returns:
true, if the method succeeds in printing this world ('s canvas)
native boolean draw.World.endOfTime ( String  s)
Parameters:
sis the message to be displayed
Returns:
true, if it succeeds in stopping the clock and displaying the message *After the end of time, events no longer trigger calls *to onTick or onKeyEvent (see below). The canvas remains visible.
native World draw.World.endOfWorld ( String  s)
Parameters:
sis the message to be displayed
Returns:
the last World, if it succeeds in stopping the clock and displaying the message *After the end of the world, events no longer trigger calls *to onTick or onKeyEvent (see below). The canvas remains visible.
abstract World draw.World.onKeyEvent ( String  ke) [pure virtual]
Parameters:
kethe String representing the key that was pressed
Returns:
the new world *The method is invoked for every keyboard event associated with the canvas. Its purposes is to create a World whose differences with this one represent what happens due to the user's use of the keyboard.
abstract World draw.World.onTick ( ) [pure virtual]
Returns:
the new world *The method is invoked for every tick of the clock. Its purpose is to create a World whose differences with this one represent what happened during the amount of time it takes the clock to tick.

Member Data Documentation

Canvas draw.World.theCanvas = new SillyCanvas(600,600) [protected]

Definition at line 4 of file World.java.


The documentation for this class was generated from the following file: