All pastes #986592 Raw Edit

Someone

public text v1 · immutable
·published 2008-04-15 22:07 UTC
rendered paste body
import 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);
			lifeState = false;
			}
	}
	public void setLife(){
		this.setBackground(Color.black);
		lifeState = true;
	}
	
	public boolean getLife(){
		return lifeState;
	}
	
//	public void setLife(boolean b){
//		lifeState = b; 
//	}
	
	public void killCell(){
		lifeState = false;
		this.setBackground(Color.gray);
	}
}