Back to index

plt-scheme  4.2.1
World.java
Go to the documentation of this file.
00001 package draw;
00002 
00003 public abstract class World {
00004     protected Canvas theCanvas = new SillyCanvas(600,600); // can I do better than null here? 
00005     
00013     public boolean bigBang(int width, int height, double s) {
00014        if (width <= 0)
00015            throw new RuntimeException(
00016                      "The method bigBang(int,int,double) expects " +
00017                      "the first argument to be greather than 0, given " 
00018                      + width);
00019        if (height <= 0)
00020            throw new RuntimeException(
00021                        "The method bigBang(int,int,double) expects " +
00022                      "the second argument to be greather than 0, given " 
00023                      + height);
00024        if (s <= 0)
00025            throw new RuntimeException(
00026                        "The method bigBang(int,int,double) expects " +
00027                      "the third argument to be greather than 0, given " 
00028                      + s);
00029        theCanvas = new Canvas(width,height); 
00030        return bigBangO(s);
00031     };
00032     private native boolean bigBangO(double s);
00033 
00034     // --------------------------------------------------------    
00035 
00042     public native boolean endOfTime(String s);
00043 
00050     public native World endOfWorld(String s);
00051 
00058     public abstract World onTick();
00059 
00067     public abstract World onKeyEvent(String ke); 
00068 
00072     public abstract boolean draw();
00073 
00074 }