removed erase and clear from World & Canvas
svn: r7069
This commit is contained in:
parent
1d44d5765c
commit
4e2cb6d762
|
@ -94,23 +94,4 @@ public class Canvas {
|
||||||
*/
|
*/
|
||||||
public native boolean drawString(Posn p, String s);
|
public native boolean drawString(Posn p, String s);
|
||||||
|
|
||||||
/**
|
|
||||||
*@return true, if it can erase the specified circle from this canvas
|
|
||||||
*/
|
|
||||||
public native boolean clearCircle(Posn p, int r, AColor c);
|
|
||||||
|
|
||||||
/**
|
|
||||||
*@return true, if it can erase the specified disk from this canvas
|
|
||||||
*/
|
|
||||||
public native boolean clearDisk(Posn p, int r, AColor c);
|
|
||||||
|
|
||||||
/**
|
|
||||||
*@return true, if it can erase the specified rectangle from this canvas
|
|
||||||
*/
|
|
||||||
public native boolean clearRect(Posn p, int width, int height, AColor c);
|
|
||||||
|
|
||||||
/**
|
|
||||||
*@return true, if it can erase the specified string from this canvas
|
|
||||||
*/
|
|
||||||
public native boolean clearLine(Posn p0, Posn p1, AColor c);
|
|
||||||
}
|
}
|
||||||
|
|
|
@ -71,8 +71,4 @@ public abstract class World {
|
||||||
*/
|
*/
|
||||||
public abstract boolean draw();
|
public abstract boolean draw();
|
||||||
|
|
||||||
/**
|
|
||||||
*@return true, if the method succeeds in erasing this world ('s canvas)
|
|
||||||
*/
|
|
||||||
public abstract boolean erase();
|
|
||||||
}
|
}
|
||||||
|
|
|
@ -26,10 +26,7 @@
|
||||||
drawRect-geometry.Posn-int-int-colors.AColor-native
|
drawRect-geometry.Posn-int-int-colors.AColor-native
|
||||||
drawLine-geometry.Posn-geometry.Posn-colors.AColor-native
|
drawLine-geometry.Posn-geometry.Posn-colors.AColor-native
|
||||||
drawString-geometry.Posn-java.lang.String-native
|
drawString-geometry.Posn-java.lang.String-native
|
||||||
clearCircle-geometry.Posn-int-colors.AColor-native
|
))
|
||||||
clearDisk-geometry.Posn-int-colors.AColor-native
|
|
||||||
clearRect-geometry.Posn-int-int-colors.AColor-native
|
|
||||||
clearLine-geometry.Posn-geometry.Posn-colors.AColor-native))
|
|
||||||
|
|
||||||
(define-signature support^ (void-or-true imperative))
|
(define-signature support^ (void-or-true imperative))
|
||||||
|
|
||||||
|
@ -146,22 +143,26 @@
|
||||||
(wrap-start-check
|
(wrap-start-check
|
||||||
([hash-table-get privates '%draw-string] (build-posn p) s*)))
|
([hash-table-get privates '%draw-string] (build-posn p) s*)))
|
||||||
|
|
||||||
|
#;
|
||||||
(define (clearCircle-geometry.Posn-int-colors.AColor-native this accs gets privates p r c)
|
(define (clearCircle-geometry.Posn-int-colors.AColor-native this accs gets privates p r c)
|
||||||
(wrap-start-check
|
(wrap-start-check
|
||||||
(check-arg r "clearCircle(Posn, int, AColor)" "second")
|
(check-arg r "clearCircle(Posn, int, AColor)" "second")
|
||||||
([hash-table-get privates '%clear-circle] (build-posn p) r (color->symbol c))))
|
([hash-table-get privates '%clear-circle] (build-posn p) r (color->symbol c))))
|
||||||
|
|
||||||
|
#;
|
||||||
(define (clearDisk-geometry.Posn-int-colors.AColor-native this accs gets privates p r c)
|
(define (clearDisk-geometry.Posn-int-colors.AColor-native this accs gets privates p r c)
|
||||||
(wrap-start-check
|
(wrap-start-check
|
||||||
(check-arg r "clearDisk(Posn, int, AColor)" "second")
|
(check-arg r "clearDisk(Posn, int, AColor)" "second")
|
||||||
([hash-table-get privates '%clear-solid-disk] (build-posn p) r (color->symbol c))))
|
([hash-table-get privates '%clear-solid-disk] (build-posn p) r (color->symbol c))))
|
||||||
|
|
||||||
|
#;
|
||||||
(define (clearRect-geometry.Posn-int-int-colors.AColor-native this accs gets privates p w h c)
|
(define (clearRect-geometry.Posn-int-int-colors.AColor-native this accs gets privates p w h c)
|
||||||
(wrap-start-check
|
(wrap-start-check
|
||||||
(check-arg w "clearRect(Posn, int, int, AColor)" "second")
|
(check-arg w "clearRect(Posn, int, int, AColor)" "second")
|
||||||
(check-arg h "clearRect(Posn, int, int, AColor)" "third")
|
(check-arg h "clearRect(Posn, int, int, AColor)" "third")
|
||||||
([hash-table-get privates '%clear-solid-rect] (build-posn p) w h (color->symbol c))))
|
([hash-table-get privates '%clear-solid-rect] (build-posn p) w h (color->symbol c))))
|
||||||
|
|
||||||
|
#;
|
||||||
(define (clearLine-geometry.Posn-geometry.Posn-colors.AColor-native this accs gets privates p0 p1 c)
|
(define (clearLine-geometry.Posn-geometry.Posn-colors.AColor-native this accs gets privates p0 p1 c)
|
||||||
(wrap-start-check
|
(wrap-start-check
|
||||||
([hash-table-get privates '%clear-solid-line] (build-posn p0) (build-posn p1) (color->symbol c))))
|
([hash-table-get privates '%clear-solid-line] (build-posn p0) (build-posn p1) (color->symbol c))))
|
||||||
|
@ -181,7 +182,7 @@
|
||||||
(define (on-event world0 th)
|
(define (on-event world0 th)
|
||||||
(begin-draw-sequence)
|
(begin-draw-sequence)
|
||||||
(send theCanvas copy)
|
(send theCanvas copy)
|
||||||
(send world0 erase)
|
;(send world0 erase)
|
||||||
(let ([world (imperative (th) world0)])
|
(let ([world (imperative (th) world0)])
|
||||||
(unless (eq? world0 world)
|
(unless (eq? world0 world)
|
||||||
(setCanvas world theCanvas))
|
(setCanvas world theCanvas))
|
||||||
|
|
|
@ -40,8 +40,4 @@ public class Canvas {
|
||||||
public native void drawRect(Posn p, int width, int height, AColor c);
|
public native void drawRect(Posn p, int width, int height, AColor c);
|
||||||
public native void drawLine(Posn p0, Posn p1, AColor c);
|
public native void drawLine(Posn p0, Posn p1, AColor c);
|
||||||
public native void drawString(Posn p, String s);
|
public native void drawString(Posn p, String s);
|
||||||
public native void clearCircle(Posn p, int r, AColor c);
|
|
||||||
public native void clearDisk(Posn p, int r, AColor c);
|
|
||||||
public native void clearRect(Posn p, int width, int height, AColor c);
|
|
||||||
public native void clearLine(Posn p0, Posn p1, AColor c);
|
|
||||||
}
|
}
|
||||||
|
|
|
@ -31,5 +31,4 @@ public abstract class World {
|
||||||
public abstract void onTick();
|
public abstract void onTick();
|
||||||
public abstract void onKeyEvent(String ke);
|
public abstract void onKeyEvent(String ke);
|
||||||
public abstract void draw();
|
public abstract void draw();
|
||||||
public abstract void erase();
|
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue
Block a user