Back to index

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

List of all members.

Public Member Functions

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

Protected Member Functions

native boolean copy ()
native boolean stop ()

Package Functions

 SillyCanvas (int w, int h)

Private Member Functions

boolean warning ()

Private Attributes

int x = 20
int y = 20

Detailed Description

Definition at line 6 of file SillyCanvas.java.


Constructor & Destructor Documentation

draw.SillyCanvas.SillyCanvas ( int  w,
int  h 
) [inline, package]

Definition at line 14 of file SillyCanvas.java.

                            { 
    super(w,h); 
    if ((w < x) || (h < y)) 
    throw new RuntimeException("SillyCanvas: bad size");
  }

Member Function Documentation

boolean draw.Canvas.close ( ) [inline, inherited]
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, inherited]
boolean draw.SillyCanvas.drawCircle ( Posn  p,
int  r,
IColor  c 
) [inline]
Parameters:
pthe center of the circle
rits radius
cits outline color
Returns:
true, if it can draw the circle into this canvas

Reimplemented from draw.Canvas.

Definition at line 20 of file SillyCanvas.java.

                                                     {
    return super.drawCircle(p,r,c) && warning(); 
  }

Here is the call graph for this function:

boolean draw.SillyCanvas.drawDisk ( Posn  p,
int  r,
IColor  c 
) [inline]
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 from draw.Canvas.

Definition at line 24 of file SillyCanvas.java.

                                                   {
    return super.drawDisk(p,r,c) && warning(); 
  }

Here is the call graph for this function:

boolean draw.SillyCanvas.drawLine ( Posn  p0,
Posn  p1,
IColor  c 
) [inline]
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 from draw.Canvas.

Definition at line 32 of file SillyCanvas.java.

                                                      {
    return super.drawLine(p0,p1,c) && warning();
  }

Here is the call graph for this function:

boolean draw.SillyCanvas.drawRect ( Posn  p,
int  width,
int  height,
IColor  c 
) [inline]
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 from draw.Canvas.

Definition at line 28 of file SillyCanvas.java.

                                                                   {
    return super.drawRect(p,width,height,c) && warning(); 
  }

Here is the call graph for this function:

boolean draw.SillyCanvas.drawString ( Posn  p,
String  s 
) [inline]
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 from draw.Canvas.

Definition at line 36 of file SillyCanvas.java.

                                              { 
    return super.drawString(p,s) && warning(); 
  }

Here is the call graph for this function:

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 from draw.Canvas.

Definition at line 40 of file SillyCanvas.java.

                        {
    return super.show() && warning(); 
  }

Here is the call graph for this function:

native boolean draw.Canvas.stop ( ) [protected, inherited]
boolean draw.SillyCanvas.warning ( ) [inline, private]

Definition at line 10 of file SillyCanvas.java.

                            {
    return super.drawString(new Posn(x,y),"This is a Dummy Canvas.");
  }

Here is the caller graph for this function:

native boolean draw.Canvas.xclose ( ) [inherited]

Here is the caller graph for this function:

native boolean draw.Canvas.xshow ( ) [inherited]

Here is the caller graph for this function:


Member Data Documentation

int draw.SillyCanvas.x = 20 [private]

Definition at line 7 of file SillyCanvas.java.

int draw.SillyCanvas.y = 20 [private]

Definition at line 8 of file SillyCanvas.java.


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