// ======================================================
// Thermodynamics package in java
//sogutmacevrimiModel1 class to calculate properties of refrigerants
// requires by user interface refTable(JApplet)
// Dr. Turhan Coban
// Ege University, Engineering Department
// Mechanical Engineering, 
// phone :
// email : turhan.coban@ege.edu.tr
// File Name   : sogut1Table.java
// requires    : sogut1.java, sogut1Table.java, sogut1Model.java
// =====================================================

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

class refrigerationModel extends AbstractTableModel
{ private static final long serialVersionUID = 8957967L;
  Object[][] veri;
  String[] baslik={"Property ","Value ","Unit"};
  refrigerationcycle sc;

  public refrigerationModel(String s1, double Q_evap,
                          double Tevap,double dPevap,double dTevap,
                          double Tcond,double dPcond,double dTcond,
                          double dhexpansion,double Tkompout,double etam)
  {
  sc=new refrigerationcycle(s1,Q_evap,Tevap,dPevap,dTevap,Tcond,dPcond,dTcond,dhexpansion,Tkompout,etam); 
  veri=sc.toString(s1,Q_evap,Tevap,dPevap,dTevap,Tcond,dPcond,dTcond,dhexpansion,Tkompout,etam);
  }
  public int getRowCount() {return veri.length;}
  public int getColumnCount() {return baslik.length;}
  public Object getValueAt(int satir,int sutun) {return veri[satir][sutun];}
  public String getColumnName(int c) {return baslik[c];}
  public void setValueAt(Object val, int row, int col)
  {
    veri[row][col] = val;
   }

  public void setValues(String s1, double Q_evap,
                          double Tevap,double dPevap,double dTevap,
                          double Tcond,double dPcond,double dTcond,
                          double dhexpansion,double Tkompout,double etam)
  {
  veri=sc.toString(s1,Q_evap,Tevap,dPevap,dTevap,Tcond,dPcond,dTcond,dhexpansion,Tkompout,etam);  
  }
  
  public boolean isCellEditable(int row, int col) {return true;}
}


