To Main Page

 



Package com.kinabaloo.turtle

Class TurtleFrame

Extends :

JFrame

Implements :

ActionListener


This class is designed to be extended. The child class should override method run() to specify the turtle(s) activity.



Fields

Protected

  Paper paper  
  Turtle turtle  

Private

private JPanel contentPane  
private TurtleMenuBar menuBar  
private TurtleStatusBar statusBar  
private TurtleToolBar toolBar  



Constructors

public TurtleFrame()



Methods

Public

public void actionPerformed(ActionEvent e)

NOTE : For internal use only.

public Turtle createTurtle()

@returns : a new turtle object

public int getPageHeight()

@returns : the page height (in pixels)

public int getPageWidth()

@returns : the page width (in pixels)

public static void main(String args[])

Child classes should override this method.

public void run()

Child classes should override this method
to specify the turtle(s) activity.
The default implementation does nothing.
This method is called automatically when
the frame's 'Run' button is clicked.

public void setDelay(int time)

@param time : the delay to use after each drawing operation.
The value of time should be between 0 and 10 inclusive.
The actual delay will be time*40 msec.
Set a value of 0 for no delay.

public void setGridSize(int size)

@param size : the size, in pixels, to set as the current
grid size (5 to 25 pixels).

public void setPageColor(Color color)

@param color : the color to set the page background.

public void setStatusText(String txt)

@param txt : the text to set as the current status bar message



Inner Classes

private class WinAdapter extends WindowAdapter



To Main Page