ex1
Class OpDetailTableModel

java.lang.Object
  extended byjavax.swing.table.AbstractTableModel
      extended byex1.OpDetailTableModel
All Implemented Interfaces:
java.io.Serializable, javax.swing.table.TableModel

public class OpDetailTableModel
extends javax.swing.table.AbstractTableModel

This table model handles the operation tables for the indivdual processes. Each of these appears as a seperate tab. The main view is handled by the OprnTableModel. Each process has its own instance of this table model. Each process view will have a different number of columns depending on how many parameters the process contains.

See Also:
Serialized Form

Field Summary
 
Fields inherited from class javax.swing.table.AbstractTableModel
listenerList
 
Constructor Summary
OpDetailTableModel(int tab, OprnTableModel ops, DefnFileParser p)
          Creates a new instance of OpDetailTableModel
 
Method Summary
 java.lang.String getChoice(int col, int ind)
          Get a specific choice string from a column.
 int getChoiceCount(int col)
          Get number of choices a dropdown list would have for a column
 java.lang.Class getColumnClass(int c)
          Class of the column, will be either JComboBox or String
 int getColumnCount()
          Returns the number of columns for this particular group
 java.lang.String getColumnName(int col)
          Get the prompt(header) for a particular detail column.
 int getColumnType(int col)
          Get the type of data in this column
 int getRowCount()
          Return the number of rows this view has.
 java.lang.Object getValueAt(int row, int col)
          Get the value at a specific row and column.
 boolean isCellEditable(int row, int col)
          Check if this cell can be modified, for files that don't have a particular action false (readonly) will be returned.
 void setAltUnits(boolean val)
          Set whether alternate units are used which cause conversions.
 void setValueAt(java.lang.Object o, int row, int col)
          Stores a value into the table
 void sort(int col, int status)
          This sorts the rows based on the contents of a specific column.
 
Methods inherited from class javax.swing.table.AbstractTableModel
addTableModelListener, findColumn, fireTableCellUpdated, fireTableChanged, fireTableDataChanged, fireTableRowsDeleted, fireTableRowsInserted, fireTableRowsUpdated, fireTableStructureChanged, getListeners, getTableModelListeners, removeTableModelListener
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

OpDetailTableModel

public OpDetailTableModel(int tab,
                          OprnTableModel ops,
                          DefnFileParser p)
Creates a new instance of OpDetailTableModel

Method Detail

getColumnCount

public int getColumnCount()
Returns the number of columns for this particular group

Returns:
the number of columns/parameters in this process with 3 additional columns for NUM,NAME,DIRECTORY

getColumnClass

public java.lang.Class getColumnClass(int c)
Class of the column, will be either JComboBox or String

Returns:
class for column

isCellEditable

public boolean isCellEditable(int row,
                              int col)
Check if this cell can be modified, for files that don't have a particular action false (readonly) will be returned.

Parameters:
row - row to check
col - column to check
Returns:
true if cell can be changed, false otherwise

getRowCount

public int getRowCount()
Return the number of rows this view has. This may be different between the table tabs if a file has a process that appears more than once.

Returns:
the number of rows this process needs in the table

setAltUnits

public void setAltUnits(boolean val)
Set whether alternate units are used which cause conversions.

Parameters:
val - True if alternate (English) units.

getColumnType

public int getColumnType(int col)
Get the type of data in this column

Parameters:
col - column number to get
Returns:
type of data

getChoiceCount

public int getChoiceCount(int col)
Get number of choices a dropdown list would have for a column

Parameters:
col - column number to get
Returns:
number of choices

getChoice

public java.lang.String getChoice(int col,
                                  int ind)
Get a specific choice string from a column.

Parameters:
col - column number to get
ind - index in choice array to return.
Returns:
choice string at the specific index.

getColumnName

public java.lang.String getColumnName(int col)
Get the prompt(header) for a particular detail column.

Parameters:
col - the column number to get
Returns:
the header for the column

getValueAt

public java.lang.Object getValueAt(int row,
                                   int col)
Get the value at a specific row and column.

Parameters:
row - the row to get
col - the column to get
Returns:
the string of the value

setValueAt

public void setValueAt(java.lang.Object o,
                       int row,
                       int col)
Stores a value into the table

Parameters:
o - Object to store
row - row where object came from
col - column where object came from

sort

public void sort(int col,
                 int status)
This sorts the rows based on the contents of a specific column.

Parameters:
col - column to sort
status - ascending, descending or nothing