|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object | +--javax.swing.table.AbstractTableModel | +--InputModel | +--InputDistanceModel
This class is used to set the inpute distance table data in the distance based algorithms
Field Summary |
Fields inherited from class InputModel |
count, names |
Fields inherited from class javax.swing.table.AbstractTableModel |
listenerList |
Constructor Summary | |
InputDistanceModel(int inCount,
java.lang.String[] inNames)
Constructs the empty table for users' input in the distance based algorithms. |
|
InputDistanceModel(int inCount,
java.lang.String[] inNames,
java.lang.Object[][] inDistance)
Constructs the data with specified values in the distance based algorithms. |
Method Summary | |
boolean |
checkInput(javax.swing.JFrame frame)
Checks users' input data in the distance based algorithms |
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. |
double[][] |
getDistance()
Converts the users input to double array |
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. |
boolean |
isCellEditable(int row,
int col)
Overrides the method in the InputModel class and sets if the cell can be edited. |
void |
saveInputToFile(java.lang.String fileName)
Saves the input data to a file in the distance based algorithms |
void |
setDistance(java.lang.Object[][] inDistance)
Sets the distance data in the distance based algorithms |
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, 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 InputDistanceModel(int inCount, java.lang.String[] inNames, java.lang.Object[][] inDistance)
inCount
- the number of species in the distance based algorithmsinNames
- the species's names in the distance based algorithmsinDistance
- the distance in the distance based algorithmspublic InputDistanceModel(int inCount, java.lang.String[] inNames)
inCount
- the number of species in the distance based algorithmsinNames
- the species's names in the distance based algorithmsMethod 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 boolean isCellEditable(int row, int col)
isCellEditable
in interface javax.swing.table.TableModel
isCellEditable
in class InputModel
row
- the row whose value to be queriedcol
- the column whose value to be queriedpublic double[][] getDistance()
public void setDistance(java.lang.Object[][] inDistance)
inDistance
- the distance 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 |