rendered paste bodyimport javax.swing.*; import java.awt.*;
public class CellPane extends JPanel{
private boolean actState = false;
private boolean lifeState = false;
private byte adjacency;
private int[] cords = new int[2];
private int neighborhood;
public int one = 1;
protected int two = 1;
public CellPane(int [] array){
cords = array;
}
public void setNeighborhood(int n){
neighborhood = n;
}
public int getNeighborhood(){
return neighborhood;
}
public int[] getCords(){
return cords;
}
public void setState(boolean st){
actState = st;
}
public boolean getState(){
return actState;
}
public byte getAdj(){
return adjacency;
}
public void setAdj(int pos){
adjacency = (byte) pos;
}
public void setColor(){
if(lifeState == false){
this.setBackground(Color.black);
lifeState = true;
}
else{
this.setBackground(Color.gray);
actState = false;
}
}
public boolean getLife(){
return lifeState;
}
public void setLife(boolean b){
lifeState = b;
}
public void killCell(){
lifeState = false;
this.setBackground(Color.gray);
}
}