001    package net.sourceforge.mp3dings;
002    
003    /*
004     *  Mp3dings - manage mp3 meta-information
005     *  Copyright (C) 2003 Moritz Ringler
006     *  $Id: FieldAssociatedTableModel.java 13 2007-07-27 09:52:39Z ringler $
007     *
008     *  This program is free software; you can redistribute it and/or
009     *  modify it under the terms of the GNU General Public License
010     *  as published by the Free Software Foundation; either version 2
011     *  of the License, or (at your option) any later version.
012     *
013     *  This program is distributed in the hope that it will be useful,
014     *  but WITHOUT ANY WARRANTY; without even the implied warranty of
015     *  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
016     *  GNU General Public License for more details.
017     *
018     *  You should have received a copy of the GNU General Public License
019     *  along with this program; if not, write to the Free Software
020     *  Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA  02111-1307, USA.
021     */
022    import javax.swing.table.TableModel;
023    
024    /**
025     * A TableModel whose columns are associated with data fields represented by
026     * unique int values.
027     *
028     * @author Moritz Ringler
029     * @version $Revision: 13 $ ($Date: 2007-07-27 11:52:39 +0200 (Fr, 27 Jul 2007) $)
030     */
031    public interface FieldAssociatedTableModel extends TableModel {
032        /**
033         * Returns the identifier of the field currently associated with the
034         * specified table column.
035         *
036         * @param col the column number for which to retrieve the field
037         * @return the field identifier or a value of -1 if col is invalid
038         */
039        public Field getField(int col);
040    
041    
042        /**
043         * Returns the column number of the column currently associated with the
044         * specified field.
045         *
046         * @param field Description of the Parameter
047         * @return the column number of the associated column or a value of -1 if no
048         *      column is associated with that field identifier.
049         */
050        public int getColumn(Field field);
051    
052    
053        /**
054         * Returns the fields that can be displayed in a table.
055         *
056         * @return An array of integer field identifiers.
057         */
058        public Field[] getAllowedFields();
059    
060    
061        /**
062         * Returns the fields that must always be displayed.
063         *
064         * @return An array of integer field identifiers.
065         */
066        public Field[] getPersistentFields();
067    
068    
069        /**
070         * Returns the fields that are displayed by default.
071         *
072         * @return An array of integer field identifiers.
073         */
074        public Field[] getDefaultFields();
075    
076    
077        /**
078         * Returns the editable property for an allowed field.
079         *
080         * @param field Description of the Parameter
081         * @return The editable value
082         */
083        public boolean getEditable(Field field);
084    
085    
086        /**
087         * Returns the fields that currently have table columns associated with
088         * them.
089         *
090         * @return An array of integer field identifiers.
091         */
092        public Field[] getFields();
093    }