001    package ui.model;
002    
003    import javax.swing.tree.TreeModel;
004    
005    /**
006     * Model used by a JTreeTable. Adds accessors for the set of columns each
007     * tree node may have. This interface 'borrows' three methods from
008     * TableModel :
009     * <ol>
010     * <li>getColumnClass(column)</li>
011     * <li>getColumnCount()</li>
012     * <li>getColumnName(column)</li>
013     * </ol>
014     * This interface differs from a true TableModel in that
015     * rows are indentified by their tree node rather than by a row number.
016     * Each tree node can return a value for each of the columns and
017     * set that value if isCellEditable() returns true.
018     * The following three methods are similar to TableModel methods
019     * except that row index is replaced by tree node.
020     * <ol>
021     * <li>getValueAt(node, column)</li>
022     * <li>setValueAt(value, node, column)</li>
023     * <li>isCellEditable(node, column)</li>
024     * </ol>
025     *
026     * @author Philip Milne
027     * @author Scott Violet
028     */
029    public interface TreeTableModel extends TreeModel
030    {
031        /**
032         * Returns the type for column number <code>column</code>.
033         */
034        public Class getColumnClass(int column);
035    
036        /**
037         * Returns the number of available column.
038         */
039        public int getColumnCount();
040    
041        /**
042         * Returns the name for column number <code>column</code>.
043         */
044        public String getColumnName(int column);
045    
046    
047        /**
048         * Returns the value to be displayed for node <code>node</code>,
049         * at column number <code>column</code>.
050         */
051        public Object getValueAt(Object node, int column);
052    
053        /**
054         * Sets the value for node <code>node</code>,
055         * at column number <code>column</code>.
056         */
057        public void setValueAt(Object aValue, Object node, int column);
058    
059        /**
060         * Indicates whether the the value for node <code>node</code>,
061         * at column number <code>column</code> is editable.
062         */
063        public boolean isCellEditable(Object node, int column);
064    
065    }