TreeTableModel.java |
1 /* 2 * Copyright (c) 1998-2005, The University of Sheffield. 3 * 4 * This file is part of GATE (see http://gate.ac.uk/), and is free 5 * software, licenced under the GNU Library General Public License, 6 * Version 2, June 1991 (in the distribution as file licence.html, 7 * and also available at http://gate.ac.uk/gate/licence.html). 8 * 9 * Valentin Tablan 23/01/2001 10 * 11 * $Id: TreeTableModel.java,v 1.3 2005/01/11 13:51:37 ian Exp $ 12 * 13 */ 14 15 package gate.swing; 16 17 import javax.swing.tree.TreeModel; 18 19 /** 20 * TreeTableModel is the model used by a JTreeTable. It extends TreeModel 21 * to add methods for getting inforamtion about the set of columns each 22 * node in the TreeTableModel may have. Each column, like a column in 23 * a TableModel, has a name and a type associated with it. Each node in 24 * the TreeTableModel can return a value for each of the columns and 25 * set that value if isCellEditable() returns true. 26 * 27 * @version %I% %G% 28 * 29 * @author Philip Milne 30 * @author Scott Violet 31 */ 32 public interface TreeTableModel extends TreeModel 33 { 34 /** 35 * Returns the number ofs availible column. 36 */ 37 public int getColumnCount(); 38 39 /** 40 * Returns the name for column number <code>column</code>. 41 */ 42 public String getColumnName(int column); 43 44 /** 45 * Returns the type for column number <code>column</code>. 46 */ 47 public Class getColumnClass(int column); 48 49 /** 50 * Returns the value to be displayed for node <code>node</code>, 51 * at column number <code>column</code>. 52 */ 53 public Object getValueAt(Object node, int column); 54 55 /** 56 * Indicates whether the the value for node <code>node</code>, 57 * at column number <code>column</code> is editable. 58 */ 59 public boolean isCellEditable(Object node, int column); 60 61 /** 62 * Sets the value for node <code>node</code>, 63 * at column number <code>column</code>. 64 */ 65 public void setValueAt(Object aValue, Object node, int column); 66 } 67