B C D G I M P R S T U

B

Barriers - class Barriers.
Class representing barriers in a grid.
Barriers(int, int, int, int, int, int, int) - Constructor for class Barriers
Creates a new instance of Barriers

C

Caterpillar - class Caterpillar.
Caterpillar class.
Caterpillar(int, int, int, int, Color, Grid, int, Graphics) - Constructor for class Caterpillar
Creates a new instance of Caterpillar
CaterpillarForm - class CaterpillarForm.
Main class for the game Caterpillar.
CaterpillarForm() - Constructor for class CaterpillarForm
 
cellSize - Static variable in class Grid
Width and height (cells are squares) of interior of a cell.
countCellPosition(int, int, int, int) - Static method in class Grid
Counts the upper-left corner point of a interior of a specific cell.

D

Delete(Graphics, Color) - Method in class Barriers
Clears barriers from a grid on a form.
Delete(Graphics) - Method in class Caterpillar
Call this method to remove caterpillar from grid correctly.

G

GetHeight() - Method in class Grid
Gets the height of a grid (number of cells).
GetHeightPixels() - Method in class Grid
Gets the height of a grid in pixels.
GetWidth() - Method in class Grid
Gets the width of a grid (number of cells).
GetWidthPixels() - Method in class Grid
Gets the width of a grid in pixels.
Grid - class Grid.
Class representing the grid where caterpillar is moving and where barriers are placed.
Grid(int, int) - Constructor for class Grid
Creates a new instance of grid

I

IsBarrier(int, int) - Method in class Barriers
Tests if there is a barrier at the specific point.
IsCorrectHeadPosition() - Method in class Caterpillar
Tests if caterpillar's head is on a barrier or not in a grid (incorrect position) or is somewhere else in a grid (correct position).
init() - Method in class CaterpillarForm
Initializes the applet caterpillar, overrides Applet.init()

M

Move(Graphics) - Method in class Caterpillar
Moves caterpillar's body one cell in direction that has been set by force of SetMoveDirection(int).

P

Paint(Color, Graphics, int, int) - Method in class Grid
Call this method to repaint the grid.
paint(Graphics) - Method in class Barriers
Paints barriers in a form.
paint(Graphics) - Method in class Caterpillar
Repaints whole caterpillar and all barriers.
paint(Graphics) - Method in class CaterpillarForm
Call this method if repainting the form is needed.

R

run() - Method in class CaterpillarForm
run() method of interface Runnable that is implemeted by this class.

S

SetHeight(int) - Method in class Grid
Sets the height of a grid.
SetMoveDirection(int) - Method in class Caterpillar
Sets future moving direction of caterpillar.
SetWidth(int) - Method in class Grid
Sets the width of a grid.

T

TO_DOWN - Static variable in class Caterpillar
Constant representing caterpillar moving direction downwards.
TO_LEFT - Static variable in class Caterpillar
Constant representing caterpillar moving direction from right to left.
TO_RIGHT - Static variable in class Caterpillar
Constant representing caterpillar moving direction from left to right.
TO_UP - Static variable in class Caterpillar
Constant representing caterpillar moving direction upwards.

U

update(Graphics) - Method in class CaterpillarForm
Called by environment if updating (here means only repainting) of applet form is needed.

B C D G I M P R S T U