Class QuotationsTableModel

All Implemented Interfaces:
IClearable, IQuotationsTableModel, PropertyChangeListener, Serializable, EventListener, TableModel
Direct Known Subclasses:
StudentQuotationsTableModel

public abstract class QuotationsTableModel extends DefaultTableModel implements IQuotationsTableModel
Since:
1.0 22 déc. 2008
Author:
Steph GAUDRY
See Also:
QuotationsTableModel(), Serialized Form
  • Field Details

    • course

      protected Course course
    • deletedQuotations

      protected List<Quotation> deletedQuotations
      List of the deleted quotations
  • Constructor Details

    • QuotationsTableModel

      public QuotationsTableModel()

      Supports multi-language, two ways available:
      • Register this class to the LanguageHelper
      • Call the update(Observable, Object) method with the LanguageHelper as Observable.
  • Method Details

    • getResourceBundle

      static ResourceBundle getResourceBundle()
      Returns:
      Since:
      1.0.1-SNAPSHOT (Feb 13 2009)
    • getColumnNames

      public static String[] getColumnNames()
    • getCourse

      public Course getCourse()
      Returns:
      the course
    • setCourse

      public void setCourse(Course course)
      Parameters:
      course - the course to set
    • propertyChange

      public void propertyChange(PropertyChangeEvent evt)
      Specified by:
      propertyChange in interface PropertyChangeListener
    • getQuotationMaximum

      public int getQuotationMaximum(int row)
      Description copied from interface: IQuotationsTableModel
      Returns the Examination maximum value (ie. to compute the average)
      Specified by:
      getQuotationMaximum in interface IQuotationsTableModel
      Parameters:
      row - index of the row containing the Quotation. This is required for quotations tables, but in some cases the implementation of this does not use the row (in the examination table, the maximum value is not stored into a row)
      Returns:
      the maximum possible value for a quotation (stored into examination)
    • hasDelatedQuotations

      public boolean hasDelatedQuotations()
      Description copied from interface: IQuotationsTableModel
      If we delete a Quotation from the table, it is not deleted from the persistent layer until the save operation is not performed.
      The hasDelatedQuotations 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 interface IQuotationsTableModel
      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 interface IClearable
    • removeRow

      public void removeRow(int row)
      Remove score matching for theses values : student, course, and date
      Overrides:
      removeRow in class DefaultTableModel
      See Also:
      DefaultTableModel.removeRow(int)
    • getColumnClass

      public Class<?> getColumnClass(int columnIndex)
      Specified by:
      getColumnClass in interface TableModel
      Overrides:
      getColumnClass in class AbstractTableModel
    • isCellEditable

      public boolean isCellEditable(int row, int column)
      Specified by:
      isCellEditable in interface TableModel
      Overrides:
      isCellEditable in class DefaultTableModel
    • add

      public void add(Quotation quotation)
    • add

      public void add(List<Quotation> quotations)
    • getQuotation

      public Quotation getQuotation(int rowIndex)
    • getQuotations

      public List<Quotation> getQuotations()