Class HoleLattice.Basis

java.lang.Object
  |
  +--HoleLattice.Basis
Enclosing class:
HoleLattice

protected class HoleLattice.Basis
extends java.lang.Object

Represents a basis in the lattice, consisting of four holes/electrons around an atom.


Field Summary
protected  boolean[] holes
          Array indicating which of the states are filled (true), and which are empty (false).
 
Constructor Summary
HoleLattice.Basis()
          Creates a new basis, with every state filled.
 
Method Summary
 java.awt.Point getPosition(int pos)
          Calculates the position of the specified state, with respect to the top-left corner of the basis.
 void paint(java.awt.Graphics g)
          Paints this basis onto the specified Graphics surface.
 void paintElectron(java.awt.Graphics g, int x, int y, int w, int h, int which)
          Paints an electron.
 
Methods inherited from class java.lang.Object
, clone, equals, finalize, getClass, hashCode, notify, notifyAll, registerNatives, toString, wait, wait, wait
 

Field Detail

holes

protected boolean[] holes
Array indicating which of the states are filled (true), and which are empty (false).
Constructor Detail

HoleLattice.Basis

public HoleLattice.Basis()
Creates a new basis, with every state filled.
Method Detail

paint

public void paint(java.awt.Graphics g)
Paints this basis onto the specified Graphics surface.

paintElectron

public void paintElectron(java.awt.Graphics g,
                          int x,
                          int y,
                          int w,
                          int h,
                          int which)
Paints an electron.
Parameters:
g - The Graphics surface on which to paint
x - The x-coordinate (in pixels) at which to paint
y - The y-coordinate (in pixels) at which to paint
w - The width (in pixels) of the electron
h - The height (in pixels) of the electron
which - The state number for the electron/hole

getPosition

public java.awt.Point getPosition(int pos)
Calculates the position of the specified state, with respect to the top-left corner of the basis.