|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object | +--javax.swing.table.AbstractTableModel | +--InputModel | +--InputCharacterModel
This class is used to set the inpute character table data in the MP algorithm
Field Summary |
Fields inherited from class InputModel |
count, names |
Fields inherited from class javax.swing.table.AbstractTableModel |
listenerList |
Constructor Summary | |
InputCharacterModel(int inCount,
int inNumOfSites,
java.lang.String[] inNames)
Constructs the empty table for users' input in the MP algorithm. |
|
InputCharacterModel(int inCount,
int inNumOfSites,
java.lang.String[] inNames,
java.lang.Object[][] inCharacters)
Constructs the data with specified values in the MP algorithm. |
Method Summary | |
boolean |
checkInput(javax.swing.JFrame frame)
Checks users' input data in the MP algorithm. |
java.lang.String[][] |
getCharacters()
Converts the users input to characters array. |
int |
getColumnCount()
Overrides the method in the TableModel class and returns the column count of the table. |
java.lang.String |
getColumnName(int columnIndex)
Overrides the method in the TableModel class and returns the column names of the table. |
int |
getNumOfSites()
Gets the number of the sites in the MP algorithm. |
int |
getRowCount()
Overrides the method in the TableModel class and returns the row count of the table. |
java.lang.Object |
getValueAt(int row,
int col)
Overrides the method in the TableModel class and returns the value of each table cell. |
void |
saveInputToFile(java.lang.String fileName)
Saves the input data to a file in the MP algorithm. |
void |
setCharacters(java.lang.String[][] inCharacters)
Sets the character data in the MP algorithm. |
void |
setValueAt(java.lang.Object value,
int row,
int col)
Overrides the method in the TableModel class and sets the table cell values. |
Methods inherited from class InputModel |
getCount, getNames, isCellEditable, space |
Methods inherited from class javax.swing.table.AbstractTableModel |
addTableModelListener, findColumn, fireTableCellUpdated, fireTableChanged, fireTableDataChanged, fireTableRowsDeleted, fireTableRowsInserted, fireTableRowsUpdated, fireTableStructureChanged, getColumnClass, getListeners, getTableModelListeners, removeTableModelListener |
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
public InputCharacterModel(int inCount, int inNumOfSites, java.lang.String[] inNames, java.lang.Object[][] inCharacters)
inCount
- the number of species in the MP algorithminNumOfSites
- the number of sites in the MP algorithminNames
- the species's names in the MP algorithminCharacters
- the characters in the MP algorithmpublic InputCharacterModel(int inCount, int inNumOfSites, java.lang.String[] inNames)
inCount
- the number of species in the MP algorithminNumOfSites
- the number of sites in the MP algorithminNames
- the species's names in the MP algorithmMethod Detail |
public int getColumnCount()
public int getRowCount()
public java.lang.Object getValueAt(int row, int col)
row
- the row whose value is to be queriedcol
- the column whose value is to be queried
public java.lang.String getColumnName(int columnIndex)
getColumnName
in interface javax.swing.table.TableModel
getColumnName
in class javax.swing.table.AbstractTableModel
columnIndex
- the index of the column
public void setValueAt(java.lang.Object value, int row, int col)
setValueAt
in interface javax.swing.table.TableModel
setValueAt
in class javax.swing.table.AbstractTableModel
value
- the new valuerow
- the row whose value is to be changedcol
- the column whose value is to be changedpublic java.lang.String[][] getCharacters()
public int getNumOfSites()
public void setCharacters(java.lang.String[][] inCharacters)
inCharacters
- the character data to be setpublic boolean checkInput(javax.swing.JFrame frame)
checkInput
in class InputModel
true
- if the data do not contain errors
false
- if the data contain any errorspublic void saveInputToFile(java.lang.String fileName)
saveInputToFile
in class InputModel
fileName
- the name of the file to be saved
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |