racket/collects/htdch/Examples/iblink-java.ss
Eli Barzilay 7d50e61c7f * Newlines at EOFs
* Another big chunk of v4-require-isms
* Allow `#lang framework/keybinding-lang' for keybinding files
* Move hierlist sources into "mrlib/hierlist", leave stub behind

svn: r10689
2008-07-09 07:18:06 +00:00

46 lines
757 B
Scheme

import geometry.*;
import colors.*;
import idraw.*;
class A extends World {
Posn O = new Posn(10,25);
Posn OO = new Posn(0,0);
IColor RED = new Red();
String s;
A(String s) {
this.s = s;
}
void go() {
bigBang(50,50,1);
}
public void onTick() {
if (s.equals("hello")) {
this.s = "world"; }
else {
this.s = "hello"; }
}
public void onKeyEvent(String key) {
if (key.equals("x")) {
this.s = "bye"; }
}
public void draw() {
this.theCanvas.drawRect(OO,50,50,RED);
this.theCanvas.drawString(O,s);
}
}
class Examples {
Posn p = new Posn(10,20);
IColor c = new Red();
boolean b = check this.p.x expect 10;
A a = new A("hello");
Examples() {
a.go();
}
}