Search in sources :

Example 1 with AttributeTableModel

use of dna.renderer.AttributeTableModel in project dna by leifeld.

the class AttributePanel method variableFilter.

private void variableFilter(String variable, int statementTypeId) {
    RowFilter<AttributeTableModel, Integer> attributeFilter = new RowFilter<AttributeTableModel, Integer>() {

        public boolean include(Entry<? extends AttributeTableModel, ? extends Integer> entry) {
            AttributeTableModel atm = entry.getModel();
            AttributeVector av = atm.get(entry.getIdentifier());
            int stId = av.getStatementTypeId();
            String var = av.getVariable();
            if (variable.equals(var) && stId == statementTypeId) {
                return true;
            } else {
                return false;
            }
        }
    };
    sorter.setRowFilter(attributeFilter);
}
Also used : AttributeVector(dna.dataStructures.AttributeVector) RowFilter(javax.swing.RowFilter) AttributeTableModel(dna.renderer.AttributeTableModel)

Aggregations

AttributeVector (dna.dataStructures.AttributeVector)1 AttributeTableModel (dna.renderer.AttributeTableModel)1 RowFilter (javax.swing.RowFilter)1