Back to index

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

List of all members.

Public Member Functions

 Canvas (int width, int height)
boolean show ()
boolean close ()
native boolean xshow ()
native boolean xclose ()
native boolean drawCircle (Posn p, int r, IColor c)
native boolean drawDisk (Posn p, int r, IColor c)
native boolean drawRect (Posn p, int width, int height, IColor c)
native boolean drawLine (Posn p0, Posn p1, IColor c)
native boolean drawString (Posn p, String s)

Protected Member Functions

native boolean copy ()
native boolean stop ()

Private Attributes

int width = 0
int height = 0
boolean showing = false

Detailed Description

Definition at line 6 of file Canvas.java.


Constructor & Destructor Documentation

draw.Canvas.Canvas ( int  width,
int  height 
) [inline]
Author:
Matthias Felleisen, Kathy Gray
Parameters:
widthpositive int, the width of the visible canvas
heightpositive int, the height of the visible canvas

Definition at line 15 of file Canvas.java.

                                         { 
       this.width = width; 
       this.height = height; 
    }

Member Function Documentation

boolean draw.Canvas.close ( ) [inline]
Returns:
true, if it can hide the canvas *The method hides the canvas and erases the current content.

Definition at line 48 of file Canvas.java.

                           { 
       xclose(); 
       showing = false; 
       return true; 
    }

Here is the call graph for this function:

native boolean draw.Canvas.copy ( ) [protected]
native boolean draw.Canvas.drawCircle ( Posn  p,
int  r,
IColor  c 
)
Parameters:
pthe center of the circle
rits radius
cits outline color
Returns:
true, if it can draw the circle into this canvas

Reimplemented in draw.SillyCanvas.

native boolean draw.Canvas.drawDisk ( Posn  p,
int  r,
IColor  c 
)
Parameters:
pthe center of the disk
rits radius
cits fill and outline color
Returns:
true, if it can draw the disk into this canvas

Reimplemented in draw.SillyCanvas.

native boolean draw.Canvas.drawLine ( Posn  p0,
Posn  p1,
IColor  c 
)
Parameters:
p0the first point on the line
p1the second point on the line
cits color
Returns:
true, if it can draw the line into this canvas

Reimplemented in draw.SillyCanvas.

native boolean draw.Canvas.drawRect ( Posn  p,
int  width,
int  height,
IColor  c 
)
Parameters:
pthe upper left of the rectangle
widthpositive int
heightpositive int
cits outline color
Returns:
true, if it can draw the rectangle into this canvas

Reimplemented in draw.SillyCanvas.

native boolean draw.Canvas.drawString ( Posn  p,
String  s 
)
Parameters:
pthe position of the baseline of the string
sthe message to be drawn
Returns:
true, if it can draw the string into this canvas

Reimplemented in draw.SillyCanvas.

boolean draw.Canvas.show ( ) [inline]
Returns:
true, if it can display a white canvas *The method initializes the canvas to a white area, *enables the drawing methods, and finally displays the canvas. If it *succeeds, it produces true. Invoking the method a second *time without calling close before has no effect.

Reimplemented in draw.SillyCanvas.

Definition at line 35 of file Canvas.java.

                          { 
       if (!showing) {
           xshow();
           showing = true; 
       }
       return true; 
    }

Here is the call graph for this function:

native boolean draw.Canvas.stop ( ) [protected]

Here is the caller graph for this function:

Here is the caller graph for this function:


Member Data Documentation

int draw.Canvas.height = 0 [private]

Definition at line 8 of file Canvas.java.

boolean draw.Canvas.showing = false [private]

Definition at line 26 of file Canvas.java.

int draw.Canvas.width = 0 [private]

Definition at line 7 of file Canvas.java.


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