gpdraw
Class SketchPad

java.lang.Object
  extended by DTFrame
      extended by gpdraw.SketchPad

public class SketchPad
extends DTFrame

A SketchPad is a top-level window for use with a DrawingTool object The center of the graphics window is at location 0,0. Positive X is to the right; positive Y is up. Headings (angles) are measured in degrees counterclockwise from the positive X axis.

Example: ======= // Create a 300 by 300 SketchPad with a 125ms drawing delay SketchPad paper = new SketchPad(300, 300, 125); DrawingTool pencil = new DrawingTool(paper);


Field Summary
protected  javax.swing.JMenuItem fastSpeedMI
           
protected  javax.swing.JMenuItem mediumSpeedMI
           
protected  javax.swing.JMenuItem noDelaySpeedMI
           
protected  SketchPadPanel pad
           
protected  javax.swing.JMenuItem quitFileMI
           
protected  javax.swing.JMenuItem slowSpeedMI
           
 
Constructor Summary
SketchPad(int width, int height)
          Constructor.
SketchPad(int width, int height, long delay)
          Constructor.
SketchPad(SketchPadPanel sPadPanel)
          Constructor.
 
Method Summary
protected  void menuItemSelected(javax.swing.JMenuItem mi)
          The application must implement this method in order to handle menu events.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

pad

protected SketchPadPanel pad

quitFileMI

protected javax.swing.JMenuItem quitFileMI

slowSpeedMI

protected javax.swing.JMenuItem slowSpeedMI

mediumSpeedMI

protected javax.swing.JMenuItem mediumSpeedMI

fastSpeedMI

protected javax.swing.JMenuItem fastSpeedMI

noDelaySpeedMI

protected javax.swing.JMenuItem noDelaySpeedMI
Constructor Detail

SketchPad

public SketchPad(SketchPadPanel sPadPanel)
Constructor. A new SketchPad window that is 250 pixels wide by 250 pixels high with a drawing delay of 125ms. Adds the SketchPadPanel sPadPanel to the SketchPad

Parameters:
sPadPanel - SketchPadPanel to be added to the SketchPad

SketchPad

public SketchPad(int width,
                 int height)
Constructor. A new SketchPad window that is widthheight pixels high with a drawing delay of 125ms.

Parameters:
width - width of this SketchPad
height - height of this SketchPad

SketchPad

public SketchPad(int width,
                 int height,
                 long delay)
Constructor. A new SketchPad window that is widthheight pixels high with a drawing delay of delay ms.

Parameters:
width - width of this SketchPad
height - height of this SketchPad
delay - drawing delay (ms)
Method Detail

menuItemSelected

protected void menuItemSelected(javax.swing.JMenuItem mi)
The application must implement this method in order to handle menu events. If no menus are added to the window, this method need not be implemented.

Parameters:
mi - The MenuItem in which the selection occurred.