Package be.gaudry.swing.edu.examination
Class ExaminationQuotationsTableModel
java.lang.Object
javax.swing.table.AbstractTableModel
javax.swing.table.DefaultTableModel
be.gaudry.swing.edu.examination.ExaminationQuotationsTableModel
- All Implemented Interfaces:
IClearable,IQuotationsTableModel,PropertyChangeListener,Serializable,EventListener,TableModel
public class ExaminationQuotationsTableModel
extends DefaultTableModel
implements IQuotationsTableModel
- Since:
- 1.0 Dec 22, 2008
- Author:
- Steph GAUDRY
- See Also:
- Serialized Form
-
Nested Class Summary
Nested ClassesModifier and TypeClassDescriptionstatic class -
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)static String[]getQuotation(int rowIndex)intgetQuotationMaximum(int row)Returns theExaminationmaximum value (ie.(package private) static ResourceBundlegetStudent(int rowIndex)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)voidvoidremoveRow(int row)Remove score matching for theses values : student, course, and datevoidsaveAll()The general contract ofsaveAllis that each row is saved or updated into persistent layer.voidsetExamination(Examination examination)voidsetQuotationMaximum(int quotationMax)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, 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
-
ExaminationQuotationsTableModel
public ExaminationQuotationsTableModel()
-
-
Method Details
-
getResourceBundle
- Returns:
- Since:
- 1.0.1-SNAPSHOT (Feb 13 2009)
-
getColumnNames
-
getExamination
- Returns:
- the examination
-
setExamination
- Parameters:
examination- the examination to set
-
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)
-
setQuotationMaximum
public void setQuotationMaximum(int quotationMax)- Parameters:
quotationMax-- Since:
- 1.0.1-SNAPSHOT (Feb 13 2009)
-
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
-
removeRow
public void removeRow(int row)Remove score matching for theses values : student, course, and date- Overrides:
removeRowin classDefaultTableModel- See Also:
DefaultTableModel.removeRow(int)
-
getColumnClass
- Specified by:
getColumnClassin interfaceTableModel- Overrides:
getColumnClassin classAbstractTableModel
-
isCellEditable
public boolean isCellEditable(int row, int column)- Specified by:
isCellEditablein interfaceTableModel- Overrides:
isCellEditablein classDefaultTableModel
-
getQuotation
-
getStudent
-
displayExamination
public void displayExamination()
-