|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||
java.lang.ObjectallRectsTracker
public class allRectsTracker
AllRectsTracker is the monitor class and implements synchronization
| Field Summary | |
|---|---|
java.util.LinkedList<Rectangle> |
allRects
|
static int |
APPLICATION_HEIGHT
|
static int |
APPLICATION_WIDTH
|
private static int |
BRICK_HEIGHT
Height of a brick |
private static int |
BRICK_SEP
Separation between bricks |
private static int |
BRICK_WIDTH
Width of a brick |
private static int |
BRICK_Y_OFFSET
Offset of the top brick row from the top |
int |
capacity
|
(package private) Ball |
myBall
|
private static int |
NBRICKS_PER_ROW
Number of bricks per row |
(package private) Rectangle |
paddle
|
private static int |
WIDTH
Dimensions of game board (usually the same) |
| Constructor Summary | |
|---|---|
allRectsTracker()
|
|
| Method Summary | |
|---|---|
void |
brickConsumer()
Synchronized method that waits if the shared resource is empty and removes bricks from the applet on collision |
void |
createBricks()
Synchronized method that waits if the shared resource is full and creates new bricks on bullet fire |
Rectangle |
getCollidingObject()
Gets the method that collides with the ball so that it can be removed from the shared resource and the screen. |
Rectangle |
getElementAt(double x,
double y)
Checks if there is an object at a given (x,y) position |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Field Detail |
|---|
public static final int APPLICATION_WIDTH
public static final int APPLICATION_HEIGHT
private static final int WIDTH
private static final int NBRICKS_PER_ROW
private static final int BRICK_SEP
private static final int BRICK_WIDTH
private static final int BRICK_HEIGHT
private static final int BRICK_Y_OFFSET
Rectangle paddle
Ball myBall
public java.util.LinkedList<Rectangle> allRects
public int capacity
| Constructor Detail |
|---|
public allRectsTracker()
| Method Detail |
|---|
public void brickConsumer()
public void createBricks()
public Rectangle getCollidingObject()
public Rectangle getElementAt(double x,
double y)
x - : x co-ordinate of position where object's presence needs to be checkedy - : y co-ordinate of position where object's presence needs to be checked
|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||