OldJTable.java revision 0
0N/A * Copyright 1997-1998 Sun Microsystems, Inc. All Rights Reserved. 0N/A * Redistribution and use in source and binary forms, with or without 0N/A * modification, are permitted provided that the following conditions 0N/A * - Redistributions of source code must retain the above copyright 0N/A * notice, this list of conditions and the following disclaimer. 0N/A * - Redistributions in binary form must reproduce the above copyright 0N/A * notice, this list of conditions and the following disclaimer in the 0N/A * documentation and/or other materials provided with the distribution. 0N/A * - Neither the name of Sun Microsystems nor the names of its 0N/A * contributors may be used to endorse or promote products derived 0N/A * from this software without specific prior written permission. 0N/A * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS 0N/A * IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, 0N/A * THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR 0N/A * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR 0N/A * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, 0N/A * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, 0N/A * PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR 0N/A * PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF 0N/A * LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING 0N/A * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS 0N/A * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 0N/A * The OldJTable is an unsupported class containing some methods that were 0N/A * deleted from the JTable between releases 0.6 and 0.7 0N/A * A new convenience method returning the index of the column in the co-ordinate 0N/A * space of the view. 0N/A// Methods deleted from the JTable because they only work with the 0N/A// DefaultTableModel. 0N/A // Override the new JTable implementation - it will not add a column to the 0N/A // DefaultTableModel. 0N/A // Set up the model side first 0N/A // The column will have been added to the end, so the index of the 0N/A // column in the model is the last element. 0N/A // Not possilble to make this work the same way ... change it so that 0N/A // it does not delete columns from the model. 0N/A throw new InternalError(
"In order to use this method, the data model must be an instance of DefaultTableModel.");
0N/A// Methods removed from JTable in the move from identifiers to ints. 0N/A * Creates a new column with <I>modelColumn</I>, <I>width</I>, 0N/A * <I>renderer</I>, and <I>editor</I> and adds it to the end of 0N/A * the JTable's array of columns. This method also retrieves the 0N/A * name of the column using the model's <I>getColumnName(modelColumn)</I> 0N/A * method, and sets the both the header value and the identifier 0N/A * for this TableColumn accordingly. 0N/A * The <I>modelColumn</I> is the index of the column in the model which 0N/A * will supply the data for this column in the table. This, like the 0N/A * <I>columnIdentifier</I> in previous releases, does not change as the 0N/A * columns are moved in the view. 0N/A * For the rest of the JTable API, and all of its associated classes, 0N/A * columns are referred to in the co-ordinate system of the view, the 0N/A * index of the column in the model is kept inside the TableColumn 0N/A * and is used only to retrieve the information from the appropraite 0N/A * column in the model. 0N/A * @param modelColumn The index of the column in the model 0N/A * @param width The new column's width. Or -1 to use 0N/A * @param renderer The renderer used with the new column. 0N/A * Or null to use the default renderer. 0N/A * @param editor The editor used with the new column. 0N/A * Or null to use the default editor. 0N/A// Methods that had their arguments switched. 0N/A// These won't work with the new table package. 0N/A public Object getValueAt(int columnIndex, int rowIndex) { 0N/A return super.getValueAt(rowIndex, columnIndex); 0N/A public boolean isCellEditable(int columnIndex, int rowIndex) { 0N/A return super.isCellEditable(rowIndex, columnIndex); 0N/A public void setValueAt(Object aValue, int columnIndex, int rowIndex) { 0N/A super.setValueAt(aValue, rowIndex, columnIndex); 0N/A}
// End Of Class OldJTable