package osa.attribute.atgrammar.gui.tables.attributes_table;

import javax.swing.*;
import javax.swing.table.*;

import osa.attribute.atgrammar.grammar.*;
import osa.attribute.atgrammar.grammar.symbols.*;

/**
 * <p>Title: </p>
 * <p>Description: </p>
 * <p>Copyright: </p>
 * <p>Company: </p>
 * @author not attributable
 * @version
 */

public class AttributesTM
  extends AbstractTableModel
  {

  Symbol symbol=null;


  public AttributesTM(Symbol symbol)
    {
    this.symbol=symbol;

    symbol.getAttrubutesCount();

    }

  public int getRowCount()
    {
    return symbol.getAttrubutesCount();
    }

  public int getColumnCount()
    {
    return 4;
    }

  public String getColumnName(int columnIndex)
    {
    String return_value;
    switch(columnIndex)
          {
          case 0:
            return_value="¹";
            break;
          case 1:
            return_value="Èìÿ";
            break;
          case 2:
            return_value="Òèï";
            break;
          case 3:
            return_value="Êëàññ";
            break;
          default:
            return_value="???";
          }
    return "column"+columnIndex;
    }

  public boolean isCellEditable(int rowIndex, int columnIndex)
    {
    if(columnIndex==0||columnIndex==3)
      {
      return false;
      }
    return true;
    }

  public Object getValueAt(int rowIndex, int columnIndex)
    {
    Attribute attribute;
    attribute=symbol.getAttributeAt(rowIndex);
    return attribute;
    }

  }