|
||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||
java.lang.ObjectSquare
public class Square
This class holds is used with Board to maintain squares for a checker or chess board
| Field Summary | |
|---|---|
protected java.awt.Color |
color
|
protected Piece |
contents
|
protected java.awt.Point |
coord
|
protected boolean |
hasChecker
|
protected boolean |
isOccupiable
|
protected java.awt.Point |
pos
|
protected int |
width
|
| Constructor Summary | |
|---|---|
Square(int x,
int y,
int w)
This method constructs the square variables |
|
| Method Summary | |
|---|---|
void |
drawSquare(java.awt.Graphics g)
This method draws the squares on the board (JPanel) public |
int |
getCol()
This method gets protected information from the square class. |
java.awt.Color |
getColor()
This method gets protected information from the square class. |
boolean |
getHasChecker()
This method gets protected information from the square class. |
boolean |
getIsOccupiable()
This method gets protected information from the square class. |
int |
getRow()
This method gets protected information from the square class. |
int |
getWidth()
This method gets protected information from the square class. |
int |
getXpos()
This method gets protected information from the square class. |
int |
getYpos()
This method gets protected information from the square class. |
void |
setCol(int c)
This method sets col. |
void |
setColor(java.awt.Color c)
This method sets color. |
void |
setHasChecker(boolean has)
This method sets hasChecker. |
void |
setIsOccupiable(boolean is)
This method sets isOccupiable. |
void |
setRow(int r)
This method sets row. |
void |
setWidth(int w)
This method sets width. |
void |
setXpos(int x)
This method sets xpos. |
void |
setYpos(int y)
This method sets ypos. |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Field Detail |
|---|
protected java.awt.Point pos
protected java.awt.Point coord
protected int width
protected java.awt.Color color
protected boolean isOccupiable
protected boolean hasChecker
protected Piece contents
| Constructor Detail |
|---|
public Square(int x,
int y,
int w)
x - x coordinatey - y coordinatew - width| Method Detail |
|---|
public int getRow()
public void setRow(int r)
r - setting the row valuepublic int getCol()
public void setCol(int c)
c - setting the row valuepublic int getXpos()
public void setXpos(int x)
x - position in pixelspublic int getYpos()
public void setYpos(int y)
y - Setting the y position in pixelspublic int getWidth()
public void setWidth(int w)
w - setting the widthpublic java.awt.Color getColor()
public void setColor(java.awt.Color c)
c - setting the colorpublic boolean getIsOccupiable()
public void setIsOccupiable(boolean is)
is - setting if the square is occupiablepublic boolean getHasChecker()
public void setHasChecker(boolean has)
has - setting the square to having a pawn or kingpublic void drawSquare(java.awt.Graphics g)
g - passed Graphics object to use in paint
|
||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||