|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectorg.jdesktop.swingx.decorator.Filter
public abstract class Filter
A Filter
is used to filter the data presented in a
data-aware component such as a JXList
or a
JXTable
. Filtering involves interposing one or
more filters in a FilterPipeline
between
a data model and a view to change the apparent order and/or number of records
in the data model.
FilterPipeline
,
JXTable
Field Summary | |
---|---|
protected ComponentAdapter |
adapter
|
protected int[] |
fromPrevious
|
protected FilterPipeline |
pipeline
|
Constructor Summary | |
---|---|
Filter()
Constructs a new filter for the first column of a data model (in model coordinates). |
|
Filter(int col)
Constructs a new filter for the specified column of a data model (in model coordinates). |
Method Summary | |
---|---|
protected void |
assign(ComponentAdapter adapter)
Binds this filter to the specified ComponentAdapter . |
int |
convertRowIndexToModel(int row)
Convert row index from view coordinates to model coordinates accounting for the presence of sorters and filters. |
int |
convertRowIndexToView(int row)
Convert row index from model coordinates to view coordinates accounting for the presence of sorters and filters. |
protected abstract void |
filter()
Performs the filter operation defined by this filter. |
int |
getColumnIndex()
Returns the model index of the column that this filter has been bound to. |
java.lang.String |
getColumnName()
|
protected int |
getInputSize()
Returns the number of records that are processed by this filter. |
protected java.lang.Object |
getInputValue(int row,
int column)
Returns the value of the cell at the specified row and column (in model coordinates). |
protected FilterPipeline |
getPipeline()
|
abstract int |
getSize()
Returns the number of records that remain in this filter's "view" after the input records have been filtered. |
java.lang.Object |
getValueAt(int row,
int column)
Returns the value at the specified row and column. |
protected abstract void |
init()
Provides filter-specific initialization. |
boolean |
isCellEditable(int row,
int column)
returns editability of the cell identified by the specified row and column index. |
protected abstract int |
mapTowardModel(int row)
PRE: 0 <= row < getSize(); |
protected int |
mapTowardView(int row)
PRE: 0 <= row < getInputSize(); |
void |
refresh()
Refreshes the internal state of the filter, performs the filter
operation and regenerates row mappings from the previous filter. |
protected void |
refresh(boolean reset)
Refreshes the internal state of the filter, optionally resetting the cache of existing row mappings from this filter to the previous filter. |
protected abstract void |
reset()
Resets the internal row mappings from this filter to the previous filter. |
void |
setColumnIndex(int modelColumn)
PENDING: not tested! |
void |
setValueAt(java.lang.Object aValue,
int row,
int column)
Sets the specified value as the new value for the cell identified by the specified row and column index. |
protected int |
translateFromPreviousFilter(int row)
Deprecated. |
protected int |
translateToPreviousFilter(int row)
Deprecated. |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
---|
protected FilterPipeline pipeline
protected ComponentAdapter adapter
protected int[] fromPrevious
Constructor Detail |
---|
public Filter()
public Filter(int col)
col
- column index in model coordinatesMethod Detail |
---|
public void refresh()
filter
operation and regenerates row mappings from the previous filter. If this
filter is bound to a filter pipeline (as most filters are), it also triggers a
filterChanged
notification.
public int getColumnIndex()
public void setColumnIndex(int modelColumn)
modelColumn
- public java.lang.String getColumnName()
public int convertRowIndexToModel(int row)
row
- row index in this filters "view" coordinates -
public int convertRowIndexToView(int row)
row
- row index in model coordinates
public java.lang.Object getValueAt(int row, int column)
row
- row index in this filter's "view" coordinatescolumn
- column index in model coordinates
public void setValueAt(java.lang.Object aValue, int row, int column)
aValue
- new value for the specified cellrow
- row index in this filter's "view" coordinatescolumn
- column index in model coordinatespublic boolean isCellEditable(int row, int column)
row
- row index in this filter's "view" coordinatescolumn
-
public abstract int getSize()
protected int getInputSize()
protected java.lang.Object getInputValue(int row, int column)
row
- in the coordinates of what is the filter's "view" of the modelcolumn
- in model coordinates
protected abstract void init()
Filter
constructor.
protected abstract void reset()
protected abstract void filter()
protected abstract int mapTowardModel(int row)
row
-
protected int mapTowardView(int row)
row
-
@Deprecated protected int translateFromPreviousFilter(int row)
convertRowIndexToView
row
- a row index in the previous filter's "view" of the data model
@Deprecated protected int translateToPreviousFilter(int row)
convertRowIndexToModel
row
- a row index in this filter's "view" of the data model
protected void refresh(boolean reset)
filter
operation and regenerates
row mappings from the previous filter. If this filter is bound to a filter
pipeline (as most filters are), it also triggers a
filterChanged
notification.
reset
- true if existing row mappings from this filter to the previous
filter should be reset; false, if the existing row mappings should be preserved.protected void assign(ComponentAdapter adapter)
ComponentAdapter
.
Called by FilterPipeline.bind()
.
adapter
- adapter that this filter is bound toprotected FilterPipeline getPipeline()
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |