org.pdfsam.guiclient.commons.models
Class SortablePdfSelectionTableModel

java.lang.Object
  extended by javax.swing.table.AbstractTableModel
      extended by org.pdfsam.guiclient.commons.models.AbstractPdfSelectionTableModel
          extended by org.pdfsam.guiclient.commons.models.SimplePdfSelectionTableModel
              extended by org.pdfsam.guiclient.commons.models.SortablePdfSelectionTableModel
All Implemented Interfaces:
java.io.Serializable, javax.swing.table.TableModel

public class SortablePdfSelectionTableModel
extends SimplePdfSelectionTableModel

Model for the JPdfSelectionTable with sort features

Author:
Andrea Vacondio
See Also:
Serialized Form

Nested Class Summary
 class SortablePdfSelectionTableModel.PdfSelectionTableItemComparator
          comparator for the PdfSelectionTableItem
 
Nested classes/interfaces inherited from class org.pdfsam.guiclient.commons.models.AbstractPdfSelectionTableModel
AbstractPdfSelectionTableModel.SortingState
 
Field Summary
 SortablePdfSelectionTableModel.PdfSelectionTableItemComparator comparator
           
 
Fields inherited from class org.pdfsam.guiclient.commons.models.SimplePdfSelectionTableModel
config, data
 
Fields inherited from class org.pdfsam.guiclient.commons.models.AbstractPdfSelectionTableModel
ASCENDING, DEFAULT_SHOWED_COLUMNS_NUMBER, DESCENDING, FILENAME, MAX_COLUMNS_NUMBER, NOT_SORTED, PAGES, PAGESELECTION, PASSWORD, PATH, PDF_DOCUMENT_VERSION, ROW_NUM
 
Fields inherited from class javax.swing.table.AbstractTableModel
listenerList
 
Constructor Summary
SortablePdfSelectionTableModel()
           
SortablePdfSelectionTableModel(int showedColumns, int maxRowsNumber)
           
 
Method Summary
 void addRow(PdfSelectionTableItem inputData)
          Add a row to the table data source if maxRowsNumber is not reached and fire to Listeners
 void addRowAt(int index, PdfSelectionTableItem inputData)
          Add a row to the table data source if maxRowsNumber is not reached and fire to Listeners
 void clearSortingState()
          set the sorting state to NOT_SORTING
 AbstractPdfSelectionTableModel.SortingState getSortingState()
           
 void moveDownRow(int row)
          Moves down a row to the table data source and fire to Listeners
 void moveDownRows(int[] rows)
          Moves down a set of rows to the table data source and fire to Listeners
 void moveUpRow(int row)
          Moves up a row to the table data source and fire to Listeners
 void moveUpRows(int[] rows)
          Moves up a set of rows to the table data source and fire to Listeners
 void setSortingState(AbstractPdfSelectionTableModel.SortingState sortingState)
          sets the sorting states and sort
 void setSortingState(int col, int sortType)
          sets the sorting states and sort
 void sort()
          Sort the data
 
Methods inherited from class org.pdfsam.guiclient.commons.models.SimplePdfSelectionTableModel
clearData, deleteRow, deleteRows, getRow, getRowCount, getRows, getValueAt, setData, setValueAt, updateRowAt
 
Methods inherited from class org.pdfsam.guiclient.commons.models.AbstractPdfSelectionTableModel
getColumnClass, getColumnCount, getColumnName, getColumnNames, getMaxRowsNumber, getShowedColumns, getToolTips, isCellEditable, isSortable, setColumnNames, setMaxRowsNumber, setShowedColumns, setSortable, setToolTips
 
Methods inherited from class javax.swing.table.AbstractTableModel
addTableModelListener, findColumn, fireTableCellUpdated, fireTableChanged, fireTableDataChanged, fireTableRowsDeleted, fireTableRowsInserted, fireTableRowsUpdated, fireTableStructureChanged, getListeners, getTableModelListeners, removeTableModelListener
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

comparator

public final SortablePdfSelectionTableModel.PdfSelectionTableItemComparator comparator
Constructor Detail

SortablePdfSelectionTableModel

public SortablePdfSelectionTableModel()

SortablePdfSelectionTableModel

public SortablePdfSelectionTableModel(int showedColumns,
                                      int maxRowsNumber)
Parameters:
showedColumns -
maxRowsNumber -
Method Detail

getSortingState

public AbstractPdfSelectionTableModel.SortingState getSortingState()
Overrides:
getSortingState in class SimplePdfSelectionTableModel
Returns:
the sortingState

setSortingState

public void setSortingState(AbstractPdfSelectionTableModel.SortingState sortingState)
sets the sorting states and sort

Overrides:
setSortingState in class SimplePdfSelectionTableModel
Parameters:
sortingState - the sortingState to set

setSortingState

public void setSortingState(int col,
                            int sortType)
sets the sorting states and sort

Parameters:
col - column
sortType - sortType

clearSortingState

public void clearSortingState()
set the sorting state to NOT_SORTING


sort

public void sort()
Sort the data

Overrides:
sort in class SimplePdfSelectionTableModel

addRow

public void addRow(PdfSelectionTableItem inputData)
Description copied from class: SimplePdfSelectionTableModel
Add a row to the table data source if maxRowsNumber is not reached and fire to Listeners

Overrides:
addRow in class SimplePdfSelectionTableModel
Parameters:
inputData - PdfSelectionTableItem to add to the data source

addRowAt

public void addRowAt(int index,
                     PdfSelectionTableItem inputData)
Description copied from class: SimplePdfSelectionTableModel
Add a row to the table data source if maxRowsNumber is not reached and fire to Listeners

Overrides:
addRowAt in class SimplePdfSelectionTableModel
Parameters:
index - index to add to
inputData - PdfSelectionTableItem to add to the data source

moveUpRow

public void moveUpRow(int row)
               throws java.lang.IndexOutOfBoundsException
Description copied from class: SimplePdfSelectionTableModel
Moves up a row to the table data source and fire to Listeners

Overrides:
moveUpRow in class SimplePdfSelectionTableModel
Parameters:
row - Row number to move from the data source
Throws:
java.lang.IndexOutOfBoundsException

moveUpRows

public void moveUpRows(int[] rows)
                throws java.lang.IndexOutOfBoundsException
Description copied from class: SimplePdfSelectionTableModel
Moves up a set of rows to the table data source and fire to Listeners

Overrides:
moveUpRows in class SimplePdfSelectionTableModel
Parameters:
rows - Row numbers to move from the data source
Throws:
java.lang.IndexOutOfBoundsException

moveDownRow

public void moveDownRow(int row)
                 throws java.lang.IndexOutOfBoundsException
Description copied from class: SimplePdfSelectionTableModel
Moves down a row to the table data source and fire to Listeners

Overrides:
moveDownRow in class SimplePdfSelectionTableModel
Parameters:
row - Row number to remove from the data source
Throws:
java.lang.IndexOutOfBoundsException

moveDownRows

public void moveDownRows(int[] rows)
                  throws java.lang.IndexOutOfBoundsException
Description copied from class: SimplePdfSelectionTableModel
Moves down a set of rows to the table data source and fire to Listeners

Overrides:
moveDownRows in class SimplePdfSelectionTableModel
Parameters:
rows - Row numbers to move from the data source
Throws:
java.lang.IndexOutOfBoundsException