All Packages  Class Hierarchy

A B C D E F G H I J K L M N O P Q R S T U V W X Y Z

Index of all Fields and Methods

A

actionPerformed(ActionEvent). Method in class KnightsTour
Takes appropriate action when the user selects a button.
adjlist. Variable in class KnightBoard
anim. Variable in class KnightsTour
anim. Variable in class KnightThread
animCheckbox. Variable in class KnightsTour

B

board. Variable in class KnightsTour
board. Variable in class KnightThread
boardClicked(int, int). Method in interface BoardListener
Invoked when the user clicks on a square inside the board.
boardClicked(int, int). Method in class KnightsTour
Sets the start square that the user chose and starts the KnightThread threaed.
boardheight. Variable in class GraphicalBoard
boardResized(int, int). Method in interface BoardListener
Invoked after the user has dragged the board to a new size.
boardResized(int, int). Method in class KnightsTour
Creates a new board of the specified size and initializes a new thread for it.
boardwidth. Variable in class GraphicalBoard
BORDER. Static variable in class GraphicalBoard

C

changeAdjacentValues(int, int, int). Method in class KnightBoard
Changes the values of the squares adjacent to the specified one by the offset.
clearButton. Variable in class KnightsTour
clickable. Variable in class GraphicalBoard

D

DELAY. Static variable in class KnightThread
distance(int, int). Method in class KnightThread
Calculates the Pythagorean (x^2 + y^2) distance of the specified square from the start square, unless the board is smaller than 36 squares.
dragging. Variable in class GraphicalBoard
drawall. Variable in class GraphicalBoard

E

E_DRAG. Static variable in class GraphicalBoard

G

GAP. Static variable in class GraphicalBoard
getAdjacencyList(int, int). Method in class KnightBoard
Returns an adjacency list, or rather an array, of the squares reachable directly from the specified one.
getAppletInfo(). Method in class KnightsTour
Returns textual information of the applet.
getMinimumSize(). Method in class GraphicalBoard
getMove(int, int). Method in class KnightBoard
Returns the number of the move that visited the specified square.
getNumMoves(). Method in class KnightBoard
Returns the number of moves done thus far.
getParameterInfo(). Method in class KnightsTour
Returns information of acceptable applet parameters that can be specified in the HTML file.
getPreferredSize(). Method in class GraphicalBoard
getValue(int, int). Method in class KnightBoard
Returns the value of the specified square.
getValueAt(int, int). Method in class KnightBoard
Similar to getValue() but with range checking.
getWaysBack(). Method in class KnightBoard
Returns the number of unvisited squares reachable directly from the start square; in other words, the number of ways back to it.
GraphicalBoard(int, int, Image). Constructor for class GraphicalBoard
Constructs a new GraphicalBoard of the specified dimensions.

H

height. Variable in class KnightBoard
Height of the board in squares.
height. Variable in class KnightsTour

I

image. Variable in class GraphicalBoard
image. Variable in class KnightsTour
inBorder(int, int). Method in class GraphicalBoard
Checks if the specified coordinates are in the borders of the board.
init(). Method in class KnightsTour
Initializes the applet.
initBoard(). Method in class KnightBoard
Initializes the board, computing the adjacency list and value for each square in the board.
Invariant(). Method in class KnightBoard
A quite complete invariant test for the KnightBoard class.
isFinished(int, int). Method in class KnightBoard
Checks if the specified square is next-to-last in the tour.
itemStateChanged(ItemEvent). Method in class KnightsTour
Toggles animation on or off when the 'Animation' checkbox state changes.

K

KnightBoard(int, int). Constructor for class KnightBoard
Constructs a board of the specified size.
KnightsTour(). Constructor for class KnightsTour
KnightThread(GraphicalBoard, Label). Constructor for class KnightThread
Creates a new thread.

L

label. Variable in class KnightsTour
label. Variable in class KnightThread
listener. Variable in class GraphicalBoard

M

MAX_DIMENSION. Static variable in class GraphicalBoard
Maximum width and height of the board in squares.
MIN_DIMENSION. Static variable in class KnightBoard
Minimum width and height of the board in squares.
mouseClicked(MouseEvent). Method in class GraphicalBoard
mouseDragged(MouseEvent). Method in class GraphicalBoard
If a drag has started, draws a resizing grid as the user moves the mouse.
mouseEntered(MouseEvent). Method in class GraphicalBoard
mouseExited(MouseEvent). Method in class GraphicalBoard
mouseMoved(MouseEvent). Method in class GraphicalBoard
Catches mouseMoved events and changes the mouse cursor to an appropriate shape when moved over the right or bottom borders of the board.
mousePressed(MouseEvent). Method in class GraphicalBoard
Notices when a user presses the mouse button on a square inside the board, assuming that click events are enabled.
mouseReleased(MouseEvent). Method in class GraphicalBoard
move. Variable in class KnightBoard
moveKnight(int, int). Method in class KnightBoard
Moves the knight to the specified square, updating adjacent values.

N

new_height. Variable in class GraphicalBoard
new_width. Variable in class GraphicalBoard
NO_DRAG. Static variable in class GraphicalBoard
nummoves. Variable in class KnightBoard

O

oldcontent. Variable in class GraphicalBoard

P

paint(Graphics). Method in class GraphicalBoard
Re-draws the board completely.
panel. Variable in class KnightsTour
pause(). Method in class KnightThread
In animated mode, updates the board on screen and pauses for a while.
pauseButton. Variable in class KnightsTour
pressed. Variable in class GraphicalBoard

R

removeBoardListener(). Method in class GraphicalBoard
Removes the current listener.
resizable. Variable in class GraphicalBoard
run(). Method in class KnightThread
Solves the Knight's Tour problem.
running. Variable in class KnightsTour

S

S_DRAG. Static variable in class GraphicalBoard
SE_DRAG. Static variable in class GraphicalBoard
setAnimation(boolean). Method in class KnightThread
Sets animation on or off.
setBoardListener(BoardListener). Method in class GraphicalBoard
Sets the listener that will receive boardResized() and boardClicked() events (if enabled).
setClickable(boolean). Method in class GraphicalBoard
Enables or disables choosing a square by pointing and clicking.
setResizable(boolean). Method in class GraphicalBoard
Enables or disables resizing by mouse-dragging the borders.
setStartSquare(int, int). Method in class KnightBoard
Sets the first (and last) square of the tour.
setStartSquare(int, int). Method in class KnightThread
Sets the start square.
solution(int, int). Method in class KnightThread
A recursive function called for each new knight position tried.
squares. Variable in class KnightThread
squaresize. Variable in class GraphicalBoard
squarex. Variable in class GraphicalBoard
squarey. Variable in class GraphicalBoard
start(). Method in class KnightsTour
Frees applet resources.
STARTSQUARE. Static variable in class KnightBoard
Value of the starting square as returned by getValue().
startx. Variable in class KnightThread
starty. Variable in class KnightThread
steps. Variable in class KnightThread
stop(). Method in class KnightsTour
Suspends the KnightThread thread.

T

thread. Variable in class KnightsTour

U

undoMove(int, int). Method in class KnightBoard
Undoes the move to the specified square, updating adjacent values.
update(). Method in class KnightThread
Updates the board and the help text.
update(Graphics). Method in class GraphicalBoard
Updates the board on screen.

V

value. Variable in class KnightBoard

W

wayback. Variable in class KnightBoard
waysback. Variable in class KnightBoard
width. Variable in class KnightBoard
Width of the board in squares.
width. Variable in class KnightsTour