KickJava   Java API By Example, From Geeks To Geeks.

Java > Open Source Codes > prefuse > data > util > CascadedRowManager


1 package prefuse.data.util;
2
3 import prefuse.data.CascadedTable;
4 import prefuse.data.Table;
5
6 /**
7  * RowManager instance that additionally takes into account tables which
8  * inherit from a parent table but can also have their own, dedicated
9  * columns.
10  *
11  * @author <a HREF="http://jheer.org">jeffrey heer</a>
12  */

13 public class CascadedRowManager extends FilteredRowManager {
14     
15     /**
16      * Create a new CascadedRowManager.
17      * @param table the table to manage
18      */

19     public CascadedRowManager(Table table) {
20         super(table);
21     }
22     
23     /**
24      * @see prefuse.data.util.RowManager#getColumnRow(int, int)
25      */

26     public int getColumnRow(int row, int col) {
27         if ( !isValidRow(row) )
28             return -1;
29         else if ( col >= ((CascadedTable)getTable()).getLocalColumnCount() )
30             return ((CascadedTable)m_table).getParentTable()
31                         .getColumnRow(getParentRow(row), col);
32         else
33             return row;
34     }
35     
36     /**
37      * @see prefuse.data.util.RowManager#getTableRow(int, int)
38      */

39     public int getTableRow(int columnRow, int col) {
40         int row;
41         if ( col < ((CascadedTable)getTable()).getLocalColumnCount() ) {
42             row = columnRow;
43         } else {
44             row = getChildRow(columnRow);
45         }
46         return isValidRow(row) ? row : -1;
47     }
48     
49 } // end of class CascadedRowManager
50
Popular Tags