org.jdesktop.swingx.decorator
Class ShuttleSorter

java.lang.Object
  extended by org.jdesktop.swingx.decorator.Filter
      extended by org.jdesktop.swingx.decorator.Sorter
          extended by org.jdesktop.swingx.decorator.ShuttleSorter

public class ShuttleSorter
extends Sorter

Pluggable sorting filter.

Author:
Ramesh Gupta

Field Summary
 
Fields inherited from class org.jdesktop.swingx.decorator.Filter
adapter, fromPrevious, pipeline
 
Constructor Summary
ShuttleSorter()
           
ShuttleSorter(int col, boolean ascending)
           
 
Method Summary
protected  void adopt(Sorter oldSorter)
          Adopts the row mappings of the specified sorter by cloning the mappings.
protected  void filter()
          Performs the sort.
 int getSize()
          Returns the number of records that remain in this filter's "view" after the input records have been filtered.
protected  void init()
          Provides filter-specific initialization.
protected  int mapTowardModel(int row)
          PRE: 0 <= row < getSize();
protected  void reset()
          Resets the internal row mappings from this filter to the previous filter.
protected  void sort(int[] from, int[] to, int low, int high)
           
 
Methods inherited from class org.jdesktop.swingx.decorator.Sorter
compare, getCollator, getComparator, interpose, isAscending, refresh, refreshCollator, releasePipeline, setAscending, setComparator, toggle
 
Methods inherited from class org.jdesktop.swingx.decorator.Filter
assign, convertRowIndexToModel, convertRowIndexToView, getColumnIndex, getColumnName, getInputSize, getInputValue, getPipeline, getValueAt, isCellEditable, mapTowardView, refresh, setColumnIndex, setValueAt, translateFromPreviousFilter, translateToPreviousFilter
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

ShuttleSorter

public ShuttleSorter()

ShuttleSorter

public ShuttleSorter(int col,
                     boolean ascending)
Method Detail

init

protected void init()
Description copied from class: Filter
Provides filter-specific initialization. Called from the Filter constructor.

Specified by:
init in class Filter

adopt

protected void adopt(Sorter oldSorter)
Adopts the row mappings of the specified sorter by cloning the mappings.

Specified by:
adopt in class Sorter
Parameters:
oldSorter - Sorter whose mappings are to be cloned

reset

protected void reset()
Resets the internal row mappings from this filter to the previous filter.

Specified by:
reset in class Filter

filter

protected void filter()
Performs the sort.

Specified by:
filter in class Filter

getSize

public int getSize()
Description copied from class: Filter
Returns the number of records that remain in this filter's "view" after the input records have been filtered.

Specified by:
getSize in class Filter
Returns:
the number of records that remain in this filter's "view" after the input records have been filtered

mapTowardModel

protected int mapTowardModel(int row)
Description copied from class: Filter
PRE: 0 <= row < getSize();

Specified by:
mapTowardModel in class Filter
Returns:

sort

protected void sort(int[] from,
                    int[] to,
                    int low,
                    int high)


Copyright © 2005 Sun Microsystems All Rights Reserved.