|
||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||
| SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||
java.lang.Object | +--HoleLattice
A simple model to describe the motion of holes through a lattice.
| Inner Class Summary | |
protected class |
HoleLattice.Basis
Represents a basis in the lattice, consisting of four holes/electrons around an atom. |
protected class |
HoleLattice.Hole
Represents a hole/electron in motion. |
| Field Summary | |
protected double |
advanceRate
The rate at which holes move across the lattice |
protected int |
atomH
|
protected int |
atomW
|
static int |
BOTTOM
|
protected int |
holeH
|
protected java.util.Vector |
holes
A list of all the holes currently in the lattice |
protected int |
holeW
|
protected int |
insetX
|
protected int |
insetY
|
protected HoleLattice.Basis[][] |
lattice
The lattice itself, represented as an array of bases |
static int |
LEFT
|
protected int |
lh
The height (in bases) of the lattice |
protected int |
lw
The width (in bases) of the lattice |
static int |
RIGHT
|
protected double |
slideRate
The rate at which holes "slide" diagonally instead of straight ahead |
protected boolean |
smooth
Set to false if electrons move instantly,
true if electrons move slowly. |
protected double |
spawnRate
The rate at which new holes are created |
static int |
TOP
|
| Constructor Summary | |
HoleLattice(int w,
int h)
Creates a new lattice. |
|
| Method Summary | |
void |
advanceHoles()
Executes one step for the model; each (stationary) hole will have a random chance to move to a nearby state. |
int |
getKeyHeight(java.awt.FontMetrics fm)
Calculates the height (in pixels) of the key. |
void |
paint(java.awt.Graphics g,
int w,
int h)
Paints the lattice (and associated displays) onto the specified Graphics surface. |
void |
paintHoles(java.awt.Graphics g,
int w,
int h)
Paints any holes/electrons currently in motion. |
void |
paintKey(java.awt.Graphics g,
int w,
int h)
Paints the key onto the specified Graphics surface. |
void |
setSmooth(boolean b)
Turns animation on or off. |
void |
spawnHoles()
Creates more holes at the far right-hand side of the lattice. |
| Methods inherited from class java.lang.Object |
|
| Field Detail |
protected boolean smooth
false if electrons move instantly,
true if electrons move slowly.protected java.util.Vector holes
protected HoleLattice.Basis[][] lattice
protected int lw
protected int lh
protected double spawnRate
protected double advanceRate
protected double slideRate
protected int atomW
protected int atomH
protected int holeW
protected int holeH
protected int insetX
protected int insetY
public static final int TOP
public static final int BOTTOM
public static final int LEFT
public static final int RIGHT
| Constructor Detail |
public HoleLattice(int w,
int h)
w - The width of the lattice (number of bases across)h - The width of the lattice (number of bases down)| Method Detail |
public void paint(java.awt.Graphics g,
int w,
int h)
w - The width to scale the display toh - The height to scale the display topublic void advanceHoles()
public void spawnHoles()
public void paintKey(java.awt.Graphics g,
int w,
int h)
w - The width to scale the display toh - The height to scale the display topublic int getKeyHeight(java.awt.FontMetrics fm)
fm - The FontMetrics with which the key will be rendered
public void paintHoles(java.awt.Graphics g,
int w,
int h)
w - The width to scale the display toh - The height to scale the display topublic void setSmooth(boolean b)
b - true if animation should be on, otherwise
false
|
||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||
| SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||