
/* Genomic Comparison Tool
   Master Thesis of computer science

   Author: Yue Lu
   Version: 1.1

*/

//This class is the tableModel
//	for the ColorShapeTable Model

import java.awt.*;
import java.awt.event.*;
import java.util.*;
import javax.swing.*;
import javax.swing.event.*;
import javax.swing.table.*;


//inherit from the defaultTableModel in order to
//use the super class method like addRow(), removeRow()

public class ColorTableModel extends DefaultTableModel
{
	//constructor
   public ColorTableModel(Object[] columnName, int rowNumber)
   {
	   super(columnName,rowNumber );

	//input the default values to the table
	   value[0]="";
	   value[1]="";
	   value[2]=Color.white;
	   value[3]=new ImageIcon("");
	}

   public Class getColumnClass(int column)
   {
	   return value[column].getClass();
   }


	// only Color and Shape column can be modified
   public boolean isCellEditable(int row, int column)
   {
	   if(column==3 || column==2)
	   		return true;
	   	else
	   		return false;
   }

   private Object[] value=new Object[4];
}