gui
Class Grid
public class Grid
extends java.lang.Object
This class handles the values for the grid, displayed on the GUI.
Grid(int size) - The parameter sets the size of the grid.
|
CURRENT_SEARCH_POS
public static final byte CURRENT_SEARCH_POS
NUM_STAUS
private static final byte NUM_STAUS
OPTIMAL_POSITION
public static final byte OPTIMAL_POSITION
SEARCHED
public static final byte SEARCHED
SEARCH_CANDIDATE
public static final byte SEARCH_CANDIDATE
SELECTED
public static final byte SELECTED
UNSELECTED
public static final byte UNSELECTED
grid
private byte[][] grid
gridSize
private int gridSize
lastPos
private Point2D lastPos
maxLine
private int maxLine
minLine
private int minLine
optPosOld
private Point2D optPosOld
Grid
public Grid(int size)
throws GridException
The parameter sets the size of the grid. The size MUST be odd in order to
reserve the same amount of gridpositions greater ans smaller than zero.
getGridSize
public int getGridSize()
getMaxCol
public int getMaxCol()
getMaxLine
public int getMaxLine()
getMinCol
public int getMinCol()
getMinLine
public int getMinLine()
getStatus
public byte getStatus(int row,
int col)
Returns the status of the grid at the specified coordinate.
- byte Status at the coordinate
setStatus
public void setStatus(int col,
int row,
byte status)
throws GridException
Use this method to set the status of the grid at a certain position. Use the static variables inherited in
this class to set the status.
A GridException is thrown if the status or the coordinates are invalid.
updateOptPos
public void updateOptPos(Point2D optPos)
throws GridException