Class MeterAVGTableModel

All Implemented Interfaces:
IClearable, IAVGTableModel, Serializable, TableModel

public class MeterAVGTableModel extends DefaultTableModel implements IAVGTableModel
Since:
1.0 7 févr. 2009
Author:
Steph GAUDRY
See Also:
Serialized Form
  • Constructor Details

    • MeterAVGTableModel

      public MeterAVGTableModel()
  • Method Details

    • getMeter

      public Meter getMeter()
      Specified by:
      getMeter in interface IAVGTableModel
      Returns:
      the meter
    • setMeter

      public void setMeter(Meter meter)
      Description copied from interface: IAVGTableModel
      The general contract of setMeter is storing the meter into the model and calling the IAVGTableModel.displayMeter() method after.
      Specified by:
      setMeter in interface IAVGTableModel
      Parameters:
      meter - the Meter to set
    • displayMeter

      public void displayMeter()
      Description copied from interface: IAVGTableModel
      The general contract of displayMeter is feeding the model with measures for a meter.
      Specified by:
      displayMeter in interface IAVGTableModel
    • 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
    • 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
    • hasDelatedMeasures

      public boolean hasDelatedMeasures()
      Description copied from interface: IAVGTableModel
      If we delete a Measure from the table, it is not deleted from the persistent layer until the save operation is not performed.
      The hasDelatedMeasures 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 measures.
      Specified by:
      hasDelatedMeasures in interface IAVGTableModel
      Returns:
      true if there remains measures to delete
    • saveAll

      public void saveAll()
      Description copied from interface: IAVGTableModel
      The general contract of saveAll is that each row is saved or updated into persistent layer. If the IAVGTableModel.hasDelatedMeasures() method returns true, all deleted Measure must be deleted into persistent layer.
      The list of deletedMeasures will be empty after this.
      Specified by:
      saveAll in interface IAVGTableModel