// ======================================================
// Thermodynamics package in java
// steamModel class to calculate properties of steam
// requires by user interface steamTable(JApplet)
// Dr. Turhan Coban
// University of Nebrasca
// Mechanical Engineering, N104 WSEC, Lincoln NE 68588-0656
// phone :
// email : MCOBAN2@netscape.net
//         MCOBAN2@unl.edu
// File Name   : steamTable.java
// requires    : steam.java, steamTable.java
// =====================================================
import java.awt.*;
import java.awt.event.*;
import javax.swing.*;
import javax.swing.table.*;
import javax.swing.event.*;

class steamModel extends AbstractTableModel
{
  Object[][] veri;
  String[] baslik={"Property ","Value ","Units"};
  steam st=new steam();

  public steamModel(String unit,String s,double v1,double v2)
  {
  st.setUnit(unit);
  veri=st.toString(s,v1,v2);
  }

  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 unit,String s,double v1,double v2)
  {
  st.setUnit(unit);
  veri=st.toString(s,v1,v2);
  }
  
  public boolean isCellEditable(int row, int col) {return true;}
}


