Class BalkingStrategyEditor.LDStrategyTableModel

java.lang.Object
javax.swing.table.AbstractTableModel
common.editors.BalkingStrategyEditor.LDStrategyTableModel
All Implemented Interfaces:
Serializable, TableModel
Enclosing class:
BalkingStrategyEditor

protected class BalkingStrategyEditor.LDStrategyTableModel extends AbstractTableModel
Table data model to implement customized data editing
Author:
Bertoli Marco Date: 13-ott-2005 Time: 11.49.53
See Also:
  • Field Details

    • columnNames

      protected String[] columnNames
    • colClasses

      protected Class<?>[] colClasses
  • Constructor Details

    • LDStrategyTableModel

      public LDStrategyTableModel()
      Creates a new instance of class table model
  • Method Details

    • getRowCount

      public int getRowCount()
      returns number of rows to be displayed in the table. In this case, global number of ranges
    • getColumnCount

      public int getColumnCount()
      Returns total number of columns
    • getColumnName

      public String getColumnName(int columnIndex)
      Returns name for each column (given its index) to be displayed inside table header
      Specified by:
      getColumnName in interface TableModel
      Overrides:
      getColumnName in class AbstractTableModel
    • getColumnClass

      public Class<?> getColumnClass(int columnIndex)
      Returns class describing data contained in specific column.
      Specified by:
      getColumnClass in interface TableModel
      Overrides:
      getColumnClass in class AbstractTableModel
    • isCellEditable

      public boolean isCellEditable(int rowIndex, int columnIndex)
      Tells whether data contained in a specific cell(given row and column index) is editable or not. In this case distribution column is not editable, as editing functionality is implemented via edit button
      Specified by:
      isCellEditable in interface TableModel
      Overrides:
      isCellEditable in class AbstractTableModel
    • getValueAt

      public Object getValueAt(int rowIndex, int columnIndex)
      retrieves value to be displayed in table cell from the underlying model data structure implementation.
    • setValueAt

      public void setValueAt(Object aValue, int rowIndex, int columnIndex)
      Puts edited values to the underlying data structure for model implementation
      Specified by:
      setValueAt in interface TableModel
      Overrides:
      setValueAt in class AbstractTableModel
    • formatNumber

      protected String formatNumber(double d)
      Helper method used to formats given number into string according to default rules.
      Parameters:
      d - double to be converted
      Returns:
      string representation of given number