Copyright © 2011 Citra Technologies. All Rights Reserved.

com.citra.filter.tree
Class NodeFilterMapper

java.lang.Object
  extended by com.citra.filter.tree.AbstractColumnFilterMapper
      extended by com.citra.filter.tree.NodeFilterMapper
All Implemented Interfaces:
ColumnFilterMapper
Direct Known Subclasses:
ColumnNodeFilterMapper

public class NodeFilterMapper
extends AbstractColumnFilterMapper

NodeFilterMapper is a ColumnFilterMapper that allows users to uniquely identify which nodes to include when filtering.


Nested Class Summary
 
Nested classes/interfaces inherited from class com.citra.filter.tree.AbstractColumnFilterMapper
AbstractColumnFilterMapper.ColumnFilterTreeTableModel
 
Field Summary
 
Fields inherited from class com.citra.filter.tree.AbstractColumnFilterMapper
ALL_STRING, columnFilterTreeTableModel
 
Constructor Summary
NodeFilterMapper()
          Constructs a NodeFilterMapper.
 
Method Summary
 void applyFilters(FilterTreeTableModel ftm, int[] excludedColumns)
          Applies the stored filters to the supplied filterTreeTableModel, excluding a list of column indexes defined by excludedModelIndexes.
 void commitFilters(FilterTreeTableModel filterTreeTableModel, Filter filter, int modelIndex)
          Stores and commits the filters for the column modelIndex for which filter expressions were previously made available to the user.
 void commitFilters(FilterTreeTableModel filterTreeTableModel, Filter filter, int modelIndex, Map filterMap)
          Stores and commits the filters for the column modelIndex for which filter expressions were previously made available to the user.
protected  TableFilter createNodeFilter(Object[] list)
          Creates the table filter to assign.
 void filterCancelled()
          Cancels the action of previously showing available filter expressions to the user.
 void filterVisible(int modelIndex, CheckBoxTree tree, TreeTableModel treeTableModel, TreeTable table)
          Method called when available filter expressions are made available to the user.
 int[] getFilteredColumns()
          Returns an array of the columns that have filters.
protected  Object[] getNodesFilter(TableFilter filter)
          Retrieves the nodes that have been assigned to the table filter.
 boolean hasFilter(int modelIndex)
          Determines whether filters for the column modelIndex exist.
 boolean removeFilters(FilterTreeTableModel ftm, int[] modelIndexes, boolean commit)
          Removes the stored filters for the supplied modelIndexes columns.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

NodeFilterMapper

public NodeFilterMapper()
Constructs a NodeFilterMapper.

Method Detail

applyFilters

public void applyFilters(FilterTreeTableModel ftm,
                         int[] excludedColumns)
Applies the stored filters to the supplied filterTreeTableModel, excluding a list of column indexes defined by excludedModelIndexes. If excludedModelIndexes is null, or is empty, all stored filters are applied.

Parameters:
ftm - the model to which the stored filters are applied
excludedColumns - an array of column indexes to exclude while filtering

createNodeFilter

protected TableFilter createNodeFilter(Object[] list)
Creates the table filter to assign.

Parameters:
list - the list of objects to use as filter
Returns:
the table filter created

getNodesFilter

protected Object[] getNodesFilter(TableFilter filter)
Retrieves the nodes that have been assigned to the table filter.

Parameters:
filter - the table filter that was assigned at the node
Returns:
the list of objects that were used as filter

commitFilters

public void commitFilters(FilterTreeTableModel filterTreeTableModel,
                          Filter filter,
                          int modelIndex)
Stores and commits the filters for the column modelIndex for which filter expressions were previously made available to the user.

Parameters:
filterTreeTableModel - the model to which the filters are commited
filter - the filter to use
modelIndex - the column

commitFilters

public void commitFilters(FilterTreeTableModel filterTreeTableModel,
                          Filter filter,
                          int modelIndex,
                          Map filterMap)
Stores and commits the filters for the column modelIndex for which filter expressions were previously made available to the user.

Parameters:
filterTreeTableModel - the model to which the filters are commited
filter - the filter to use
modelIndex - the column
filterMap - the map to commit

filterCancelled

public void filterCancelled()
Cancels the action of previously showing available filter expressions to the user.


filterVisible

public void filterVisible(int modelIndex,
                          CheckBoxTree tree,
                          TreeTableModel treeTableModel,
                          TreeTable table)
Method called when available filter expressions are made available to the user.

Parameters:
modelIndex - the column for which filter expressions are shown
tree - the tree that should be filled with a hierarchical filter expression structure
treeTableModel - the data model that holds a hierarchical filter expression structure
table - the treetable containing the structure

getFilteredColumns

public int[] getFilteredColumns()
Returns an array of the columns that have filters.

Returns:
a list of columns that have filters

hasFilter

public boolean hasFilter(int modelIndex)
Determines whether filters for the column modelIndex exist.

Parameters:
modelIndex - the column
Returns:
true if filters for the supplied are defined, false otherwise

removeFilters

public boolean removeFilters(FilterTreeTableModel ftm,
                             int[] modelIndexes,
                             boolean commit)
Removes the stored filters for the supplied modelIndexes columns.

Parameters:
ftm - the model from which the stored filters are removed
modelIndexes - a list of columns
commit - a flag indicating that the filter removal should be commited
Returns:
true, if at least one filter was removed, false otherwise

Copyright © 2011 Citra Technologies. All Rights Reserved.