Class RmaTableSorter

All Implemented Interfaces:
Serializable, EventListener, TableModelListener, TableModel, RmaTableModelInterface

public class RmaTableSorter extends RmaTableMap
See Also:
  • Field Details

    • indexes

      protected int[] indexes
    • ASCENDING

      public static final int ASCENDING
      The constant for an ascending sort.
      See Also:
    • DESCENDING

      public static final int DESCENDING
      The constant for a descending sort.
      See Also:
    • FLIPFLOP

      public static final int FLIPFLOP
      The constant for a sort that flip-flops between ascending and descending.
      See Also:
  • Constructor Details

    • RmaTableSorter

      public RmaTableSorter()
    • RmaTableSorter

      public RmaTableSorter(TableModel model)
    • RmaTableSorter

      public RmaTableSorter(TableModel model, int sortType)
      Constructs a RmaTableSorter around the TableModel with a defined Sorting Type.
  • Method Details

    • setSortingType

      public void setSortingType(int sortingType)
      Sets the Sorting Type to the arg int. Use the class defined constants.
    • ascending

      public boolean ascending()
      Returns the boolean for ascending.
    • setModel

      public void setModel(TableModel model)
      Overrides:
      setModel in class RmaTableMap
    • compareRowsByColumn

      public int compareRowsByColumn(int row1, int row2, int column)
    • compare

      public int compare(int row1, int row2)
    • reallocateIndexes

      public void reallocateIndexes()
    • tableChanged

      public void tableChanged(TableModelEvent e)
      Specified by:
      tableChanged in interface TableModelListener
      Overrides:
      tableChanged in class RmaTableMap
    • checkModel

      public void checkModel()
    • sort

      public void sort(Object sender)
    • n2sort

      public void n2sort()
    • shuttlesort

      public void shuttlesort(int[] from, int[] to, int low, int high)
    • swap

      public void swap(int i, int j)
    • getMappedRow

      public int getMappedRow(int tableRow)
      Returns the mapped row for a specific table row.
      Parameters:
      tableRow -
      Returns:
    • getValueAt

      public Object getValueAt(int aRow, int aColumn)
      Description copied from class: AbstractRmaTableModel
      Returns the value at a given row/column location. The default method returns null. Needs to be overrridden
      Specified by:
      getValueAt in interface TableModel
      Overrides:
      getValueAt in class RmaTableMap
      Parameters:
      aRow - the row to look for the value in.
      aColumn - the column to look for the value in.
    • setValueAt

      public void setValueAt(Object aValue, int aRow, int aColumn)
      Specified by:
      setValueAt in interface TableModel
      Overrides:
      setValueAt in class RmaTableMap
    • isCellEditable

      public boolean isCellEditable(int aRow, int column)
      Specified by:
      isCellEditable in interface TableModel
      Overrides:
      isCellEditable in class RmaTableMap
    • sortByColumn

      public void sortByColumn(int column)
    • sortByColumn

      public void sortByColumn(int column, boolean ascending)
    • getSortingColumns

      public Vector<Integer> getSortingColumns()
    • addMouseListenerToHeaderInTable

      public void addMouseListenerToHeaderInTable(JTable table)