| 
 | ||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||
java.lang.Objectjavalib.worldcanvas.MyCanvas
public abstract class MyCanvas
Abstract Canvas - allows the drawing of shapes, lines, and text in the window of the given size, window closing and re-opening.
| Field Summary | |
|---|---|
| protected  int | heightthe height of the panel | 
| protected  int | widththe width of the panel | 
| Constructor Summary | |
|---|---|
| MyCanvas(int width,
         int height)Construct a MyCanvaswith the given
 width and height. | |
| Method Summary | |
|---|---|
| abstract  void | clear()Clear the canvas before painting the next scene | 
| abstract  boolean | drawImage(ImageMaker image,
          Posn nw)Draw the image provided by the on theat the given
 NW corner | 
| abstract  boolean | drawImage(String fileName,
          Posn nw)Draw the image in the specified file at the location of the given NW corner | 
| abstract  boolean | drawImage(WorldImage image)Draw the image on the at its
 pinhole location. | 
| abstract  Graphics2D | getBufferGraphics()Returns a Graphics2Dobject that permits
 painting to the internal buffered image for this canvas. | 
|  String | toIndentedString(String indent)Produce an indented Stringrepresentation of this Canvas | 
|  String | toString()Produce a Stringrepresentation of this Canvas | 
| Methods inherited from class java.lang.Object | 
|---|
| clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait | 
| Field Detail | 
|---|
protected int height
protected int width
| Constructor Detail | 
|---|
public MyCanvas(int width,
                int height)
Construct a MyCanvas with the given
 width and height.
width - the width of the panelheight - the height of the panel| Method Detail | 
|---|
public abstract void clear()
public abstract boolean drawImage(ImageMaker image,
                                  Posn nw)
ImageMakerCanvas
image - the image maker for the image filenw - the NW corner for the image placement
public abstract boolean drawImage(String fileName,
                                  Posn nw)
fileName - the name of the image filenw - the NW corner for the image placementpublic abstract boolean drawImage(WorldImage image)
Canvas
image - the image to be drawn
truepublic abstract Graphics2D getBufferGraphics()
Returns a Graphics2D object that permits
 painting to the internal buffered image for this canvas.
public String toIndentedString(String indent)
String representation of this Canvas
indent - the desired indentation: ignored, because we only produce
 one line of text.public String toString()
String representation of this Canvas
toString in class Object| 
 | ||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||