|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectde.nidanet.dev.fun.winter.snow.Flake
public class Flake
Objects of this class move over the screen like snow flakes! Each runs as a
single thread until it is placed at "a point of no return". See run() method
for more information.
| Field Summary | |
|---|---|
private boolean[][] |
FixPoints
An array with all fixed points at the screen. |
private Graphics |
Graph
A reference to the screen. |
private Snow |
Parent
A reference to the displaying object. |
static long |
serialVersionUID
Unique Id of this class. |
private long |
tts
Time-To-Sleep between the single falling steps. |
private int |
x
Current x-position of this flake. |
private int |
y
Current y-position of this flake. |
| Constructor Summary | |
|---|---|
Flake(Snow p,
int x,
long t)
Creates and initializes a new flake at position (x;0). |
|
| Method Summary | |
|---|---|
void |
addFixPoint(int a,
int b)
Adds a new fixed point to the local array. |
int |
getX()
Reads the x-position. |
int |
getY()
Reads the y-position. |
void |
run()
Let the flake move over the screen. |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Field Detail |
|---|
public static final long serialVersionUID
private Snow Parent
private Graphics Graph
private boolean[][] FixPoints
private int x
private int y
private long tts
run().
| Constructor Detail |
|---|
public Flake(Snow p,
int x,
long t)
p - the parent object's referencex - the x-positiont - the Time-To-Sleep| Method Detail |
|---|
public void run()
run in interface Runnable
public void addFixPoint(int a,
int b)
the local array.
a - the x-position of the new fixed pointb - the y-position of the new fixed pointpublic int getX()
xpublic int getY()
y
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||