|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectorg.opensourcephysics.sip.ch07.Box
public class Box
Box contains data for articles in a partitioned box.
Field Summary | |
---|---|
int |
N
|
int |
nleft
|
int |
time
|
double[] |
x
|
double[] |
y
|
Constructor Summary | |
---|---|
Box()
|
Method Summary | |
---|---|
void |
draw(DrawingPanel panel,
java.awt.Graphics g)
Draws particles and partitioned box |
void |
initialize()
Initializes the box, places particles in random positions on left side. |
void |
step()
Moves one particle to the other side |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
---|
public double[] x
public double[] y
public int N
public int nleft
public int time
Constructor Detail |
---|
public Box()
Method Detail |
---|
public void initialize()
public void step()
public void draw(DrawingPanel panel, java.awt.Graphics g)
draw
in interface Drawable
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |