1 /*
2 * %W% %E%
3 *
4 * Copyright 1997, 1998 Sun Microsystems, Inc. All Rights Reserved.
5 *
6 * Redistribution and use in source and binary forms, with or
7 * without modification, are permitted provided that the following
8 * conditions are met:
9 *
10 * - Redistributions of source code must retain the above copyright
11 * notice, this list of conditions and the following disclaimer.
12 *
13 * - Redistribution in binary form must reproduce the above
14 * copyright notice, this list of conditions and the following
15 * disclaimer in the documentation and/or other materials
16 * provided with the distribution.
17 *
18 * Neither the name of Sun Microsystems, Inc. or the names of
19 * contributors may be used to endorse or promote products derived
20 * from this software without specific prior written permission.
21 *
22 * This software is provided "AS IS," without a warranty of any
23 * kind. ALL EXPRESS OR IMPLIED CONDITIONS, REPRESENTATIONS AND
24 * WARRANTIES, INCLUDING ANY IMPLIED WARRANTY OF MERCHANTABILITY,
25 * FITNESS FOR A PARTICULAR PURPOSE OR NON-INFRINGEMENT, ARE HEREBY
26 * EXCLUDED. SUN AND ITS LICENSORS SHALL NOT BE LIABLE FOR ANY
27 * DAMAGES OR LIABILITIES SUFFERED BY LICENSEE AS A RESULT OF OR
28 * RELATING TO USE, MODIFICATION OR DISTRIBUTION OF THIS SOFTWARE OR
29 * ITS DERIVATIVES. IN NO EVENT WILL SUN OR ITS LICENSORS BE LIABLE
30 * FOR ANY LOST REVENUE, PROFIT OR DATA, OR FOR DIRECT, INDIRECT,
31 * SPECIAL, CONSEQUENTIAL, INCIDENTAL OR PUNITIVE DAMAGES, HOWEVER
32 * CAUSED AND REGARDLESS OF THE THEORY OF LIABILITY, ARISING OUT OF
33 * THE USE OF OR INABILITY TO USE THIS SOFTWARE, EVEN IF SUN HAS
34 * BEEN ADVISED OF THE POSSIBILITY OF SUCH DAMAGES.
35 *
36 * You acknowledge that this software is not designed, licensed or
37 * intended for use in the design, construction, operation or
38 * maintenance of any nuclear facility.
39 */
40
41 package uk.ac.rdg.resc.jstyx.client.browser;
42
43 import javax.swing.tree.TreeModel;
44
45 /***
46 * TreeTableModel is the model used by a JTreeTable. It extends TreeModel
47 * to add methods for getting inforamtion about the set of columns each
48 * node in the TreeTableModel may have. Each column, like a column in
49 * a TableModel, has a name and a type associated with it. Each node in
50 * the TreeTableModel can return a value for each of the columns and
51 * set that value if isCellEditable() returns true.
52 *
53 * @version %I% %G%
54 *
55 * @author Philip Milne
56 * @author Scott Violet
57 */
58 public interface TreeTableModel extends TreeModel
59 {
60 /***
61 * Returns the number ofs availible column.
62 */
63 public int getColumnCount();
64
65 /***
66 * Returns the name for column number <code>column</code>.
67 */
68 public String getColumnName(int column);
69
70 /***
71 * Returns the type for column number <code>column</code>.
72 */
73 public Class getColumnClass(int column);
74
75 /***
76 * Returns the value to be displayed for node <code>node</code>,
77 * at column number <code>column</code>.
78 */
79 public Object getValueAt(Object node, int column);
80
81 /***
82 * Indicates whether the the value for node <code>node</code>,
83 * at column number <code>column</code> is editable.
84 */
85 public boolean isCellEditable(Object node, int column);
86
87 /***
88 * Sets the value for node <code>node</code>,
89 * at column number <code>column</code>.
90 */
91 public void setValueAt(Object aValue, Object node, int column);
92 }
93