Copyright © 2005 Scientific Applications. All Rights Reserved.

com.sciapp.filter.tree
Class NodeTableFilter

java.lang.Object
  extended by com.sciapp.filter.TableFilter
      extended by com.sciapp.filter.tree.NodeTableFilter
All Implemented Interfaces:
Serializable

public class NodeTableFilter
extends TableFilter

NodeTableFilter is a table filter for filtering the rows of a TableModel based on a list of objects.

See Also:
Serialized Form

Field Summary
protected  Object[] nodes
          the 'accepted' object list
 
Fields inherited from class com.sciapp.filter.TableFilter
ALL_COLUMNS, column, filter
 
Constructor Summary
NodeTableFilter()
          Constructs a NodeTableFilter.
NodeTableFilter(Object[] nodes)
          Constructs a NodeTableFilter.
 
Method Summary
 boolean filter(ListTableModel model, Object row)
          Decides whether a particular row of a JTable will be filtered.
 boolean filter(TableModel model, int rowIndex)
          Decides whether a particular row of a JTable will be filtered.
 Object[] getNodes()
          Returns a list of accepted nodes.
 void setNodes(Object[] nodes)
          Assigns a new list of accepted nodes.
 
Methods inherited from class com.sciapp.filter.TableFilter
getColumn, getFilter, setColumn, setFilter
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

nodes

protected Object[] nodes
the 'accepted' object list

Constructor Detail

NodeTableFilter

public NodeTableFilter()
Constructs a NodeTableFilter.


NodeTableFilter

public NodeTableFilter(Object[] nodes)
Constructs a NodeTableFilter.

Method Detail

filter

public boolean filter(ListTableModel model,
                      Object row)
Decides whether a particular row of a JTable will be filtered. An alternative to this method is filter(TableModel m, int rowIndex).

Overrides:
filter in class TableFilter
Parameters:
model - the ListTableModel that holds a reference to the tabular row data
row - the row of the table to filter, represented as an object
Returns:
true if the row is to be filtered, false otherwise

filter

public boolean filter(TableModel model,
                      int rowIndex)
Decides whether a particular row of a JTable will be filtered. This method is presented as an alternative to filter(ListTableModel ltm, Object o).

Overrides:
filter in class TableFilter
Parameters:
model - the TableModel that holds the unfiltered row data
rowIndex - the index of the row of the table to filter
Returns:
true if the row is to be filtered, false otherwise

getNodes

public Object[] getNodes()
Returns a list of accepted nodes.

Returns:
an array containing the nodes that are accepted by the table filter

setNodes

public void setNodes(Object[] nodes)
Assigns a new list of accepted nodes.

Parameters:
nodes - an array containing the nodes that are accepted by the table filter

Copyright © 2005 Scientific Applications. All Rights Reserved.