Package be.gaudry.swing.edu.student.avg
Class StudentAVGTableModel
java.lang.Object
javax.swing.table.AbstractTableModel
javax.swing.table.DefaultTableModel
be.gaudry.swing.edu.student.avg.StudentAVGTableModel
- All Implemented Interfaces:
IClearable
,IAVGTableModel
,IQuotationsTableModel
,PropertyChangeListener
,Serializable
,EventListener
,TableModel
- Since:
- 1.0 22 déc. 2008
- Author:
- Steph GAUDRY
- See Also:
- Serialized Form
-
Nested Class Summary
-
Field Summary
Fields inherited from class javax.swing.table.DefaultTableModel
columnIdentifiers, dataVector
Fields inherited from class javax.swing.table.AbstractTableModel
listenerList
-
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptionvoid
clear()
The expected behavior of the implementation is to put the informations into an uninitialized state.void
Class<?>
getColumnClass(int columnIndex)
static String[]
int
getQuotationMaximum(int row)
Returns theExamination
maximum value (ie.(package private) static ResourceBundle
boolean
If we delete aQuotation
from the table, it is not deleted from the persistent layer until the save operation is not performed.
ThehasDelatedQuotations
methods may be called if we want to set the enable state of a save button, or to inform the client than it remains not deleted quotations.boolean
isCellEditable(int row, int column)
void
void
saveAll()
The general contract ofsaveAll
is that each row is saved or updated into persistent layer.void
setStudent(Student student)
The general contract ofsetStudent
is storing thestudent
into the model and calling thedisplayStudent()
method after.Methods inherited from class javax.swing.table.DefaultTableModel
addColumn, addColumn, addColumn, addRow, addRow, convertToVector, convertToVector, getColumnCount, getColumnName, getDataVector, getRowCount, getValueAt, insertRow, insertRow, moveRow, newDataAvailable, newRowsAdded, removeRow, rowsRemoved, setColumnCount, setColumnIdentifiers, setColumnIdentifiers, setDataVector, setDataVector, setNumRows, setRowCount, setValueAt
Methods inherited from class javax.swing.table.AbstractTableModel
addTableModelListener, findColumn, fireTableCellUpdated, fireTableChanged, fireTableDataChanged, fireTableRowsDeleted, fireTableRowsInserted, fireTableRowsUpdated, fireTableStructureChanged, getListeners, getTableModelListeners, removeTableModelListener
-
Constructor Details
-
StudentAVGTableModel
public StudentAVGTableModel()
-
-
Method Details
-
getResourceBundle
- Returns:
- Since:
- 1.0.1-SNAPSHOT (Feb 13 2009)
-
getColumnNames
-
getStudent
- Specified by:
getStudent
in interfaceIAVGTableModel
- Returns:
- the student
-
setStudent
Description copied from interface:IAVGTableModel
The general contract ofsetStudent
is storing thestudent
into the model and calling thedisplayStudent()
method after.- Specified by:
setStudent
in interfaceIAVGTableModel
- Parameters:
student
- the student to set
-
propertyChange
- Specified by:
propertyChange
in interfacePropertyChangeListener
-
displayStudent
public void displayStudent()Description copied from interface:IAVGTableModel
The general contract ofdisplayStudent
is feeding the model with averages for eachcourse
for eachperiod
for astudent
.- Specified by:
displayStudent
in interfaceIAVGTableModel
-
getQuotationMaximum
public int getQuotationMaximum(int row)Description copied from interface:IQuotationsTableModel
Returns theExamination
maximum value (ie. to compute the average)- Specified by:
getQuotationMaximum
in interfaceIQuotationsTableModel
- Parameters:
row
- index of the row containing theQuotation
. This is required for quotations tables, but in some cases the implementation of this does not use the row (in theexamination table
, the maximum value is not stored into a row)- Returns:
- the maximum possible value for a quotation (stored into examination)
-
saveAll
public void saveAll()Description copied from interface:IQuotationsTableModel
The general contract ofsaveAll
is that each row is saved or updated into persistent layer. If theIQuotationsTableModel.hasDelatedQuotations()
method returns true, all deletedQuotation
must be deleted into persistent layer.
The list of deletedQuotations will be empty after this.- Specified by:
saveAll
in interfaceIQuotationsTableModel
-
hasDelatedQuotations
public boolean hasDelatedQuotations()Description copied from interface:IQuotationsTableModel
If we delete aQuotation
from the table, it is not deleted from the persistent layer until the save operation is not performed.
ThehasDelatedQuotations
methods may be called if we want to set the enable state of a save button, or to inform the client than it remains not deleted quotations.- Specified by:
hasDelatedQuotations
in interfaceIQuotationsTableModel
- Returns:
- true if there remains quotations to delete
-
clear
public void clear()Description copied from interface:IClearable
The expected behavior of the implementation is to put the informations into an uninitialized state. See the implementation to know the fields affected by this method.- Specified by:
clear
in interfaceIClearable
-
getColumnClass
- Specified by:
getColumnClass
in interfaceTableModel
- Overrides:
getColumnClass
in classAbstractTableModel
-
isCellEditable
public boolean isCellEditable(int row, int column)- Specified by:
isCellEditable
in interfaceTableModel
- Overrides:
isCellEditable
in classDefaultTableModel
-