Package be.gaudry.swing.edu.student.avg
Class PeriodAVGTableModel
java.lang.Object
javax.swing.table.AbstractTableModel
javax.swing.table.DefaultTableModel
be.gaudry.swing.edu.student.avg.PeriodAVGTableModel
- All Implemented Interfaces:
IClearable,IAVGTableModel,IQuotationsTableModel,PropertyChangeListener,Serializable,EventListener,TableModel
public class PeriodAVGTableModel
extends DefaultTableModel
implements IAVGTableModel, PropertyChangeListener
- Since:
- 1.0 Dec 22, 2008
- Author:
- Steph GAUDRY
- See Also:
- Serialized Form
-
Field Summary
Fields inherited from class javax.swing.table.DefaultTableModel
columnIdentifiers, dataVectorFields inherited from class javax.swing.table.AbstractTableModel
listenerList -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionvoidclear()The expected behavior of the implementation is to put the informations into an uninitialized state.voidClass<?>getColumnClass(int columnIndex)intgetQuotationMaximum(int row)Returns theExaminationmaximum value (ie.booleanIf we delete aQuotationfrom the table, it is not deleted from the persistent layer until the save operation is not performed.
ThehasDelatedQuotationsmethods 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.booleanisCellEditable(int row, int column)voidvoidsaveAll()The general contract ofsaveAllis that each row is saved or updated into persistent layer.voidsetStudent(Student _student)The general contract ofsetStudentis storing thestudentinto 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, setValueAtMethods inherited from class javax.swing.table.AbstractTableModel
addTableModelListener, findColumn, fireTableCellUpdated, fireTableChanged, fireTableDataChanged, fireTableRowsDeleted, fireTableRowsInserted, fireTableRowsUpdated, fireTableStructureChanged, getListeners, getTableModelListeners, removeTableModelListener
-
Constructor Details
-
PeriodAVGTableModel
public PeriodAVGTableModel()
-
-
Method Details
-
getStudent
- Specified by:
getStudentin interfaceIAVGTableModel- Returns:
- the student
-
setStudent
Description copied from interface:IAVGTableModelThe general contract ofsetStudentis storing thestudentinto the model and calling thedisplayStudent()method after.- Specified by:
setStudentin interfaceIAVGTableModel- Parameters:
_student- the student to set
-
displayStudent
public void displayStudent()Description copied from interface:IAVGTableModelThe general contract ofdisplayStudentis feeding the model with averages for eachcoursefor eachperiodfor astudent.- Specified by:
displayStudentin interfaceIAVGTableModel
-
propertyChange
- Specified by:
propertyChangein interfacePropertyChangeListener
-
getQuotationMaximum
public int getQuotationMaximum(int row)Description copied from interface:IQuotationsTableModelReturns theExaminationmaximum value (ie. to compute the average)- Specified by:
getQuotationMaximumin 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:IQuotationsTableModelThe general contract ofsaveAllis that each row is saved or updated into persistent layer. If theIQuotationsTableModel.hasDelatedQuotations()method returns true, all deletedQuotationmust be deleted into persistent layer.
The list of deletedQuotations will be empty after this.- Specified by:
saveAllin interfaceIQuotationsTableModel
-
hasDelatedQuotations
public boolean hasDelatedQuotations()Description copied from interface:IQuotationsTableModelIf we delete aQuotationfrom the table, it is not deleted from the persistent layer until the save operation is not performed.
ThehasDelatedQuotationsmethods 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:
hasDelatedQuotationsin interfaceIQuotationsTableModel- Returns:
- true if there remains quotations to delete
-
clear
public void clear()Description copied from interface:IClearableThe 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:
clearin interfaceIClearable
-
getColumnClass
- Specified by:
getColumnClassin interfaceTableModel- Overrides:
getColumnClassin classAbstractTableModel
-
isCellEditable
public boolean isCellEditable(int row, int column)- Specified by:
isCellEditablein interfaceTableModel- Overrides:
isCellEditablein classDefaultTableModel
-