diff options
Diffstat (limited to 'libjava/classpath/javax/swing/table')
10 files changed, 506 insertions, 506 deletions
diff --git a/libjava/classpath/javax/swing/table/AbstractTableModel.java b/libjava/classpath/javax/swing/table/AbstractTableModel.java index 743e5d4..7e9886d 100644 --- a/libjava/classpath/javax/swing/table/AbstractTableModel.java +++ b/libjava/classpath/javax/swing/table/AbstractTableModel.java @@ -48,9 +48,9 @@ import javax.swing.event.TableModelEvent; import javax.swing.event.TableModelListener; /** - * A base class that can be used to create implementations of the + * A base class that can be used to create implementations of the * {@link TableModel} interface. - * + * * @author Andrew Selkirk */ public abstract class AbstractTableModel implements TableModel, Serializable @@ -71,10 +71,10 @@ public abstract class AbstractTableModel implements TableModel, Serializable } /** - * Returns the name of the specified column. This method generates default - * names in a sequence (starting with column 0): A, B, C, ..., Z, AA, AB, + * Returns the name of the specified column. This method generates default + * names in a sequence (starting with column 0): A, B, C, ..., Z, AA, AB, * AC, ..., AZ, BA, BB, BC, and so on. Subclasses may override this method - * to allow column names to be specified on some other basis. + * to allow column names to be specified on some other basis. * * @param columnIndex the column index. * @@ -98,19 +98,19 @@ public abstract class AbstractTableModel implements TableModel, Serializable * @param columnName the name of the column (<code>null</code> not permitted). * * @return The index of the column, -1 if not found. - * + * * @see #getColumnName(int) - * @throws NullPointerException if <code>columnName</code> is + * @throws NullPointerException if <code>columnName</code> is * <code>null</code>. */ public int findColumn(String columnName) { int count = getColumnCount(); - + for (int index = 0; index < count; index++) { String name = getColumnName(index); - + if (columnName.equals(name)) return index; } @@ -121,10 +121,10 @@ public abstract class AbstractTableModel implements TableModel, Serializable /** * Returns the <code>Class</code> for all <code>Object</code> instances - * in the specified column. - * + * in the specified column. + * * @param columnIndex the column index. - * + * * @return The class. */ public Class<?> getColumnClass(int columnIndex) @@ -133,9 +133,9 @@ public abstract class AbstractTableModel implements TableModel, Serializable } /** - * Returns <code>true</code> if the specified cell is editable, and - * <code>false</code> if it is not. This implementation returns - * <code>false</code> for all arguments, subclasses should override the + * Returns <code>true</code> if the specified cell is editable, and + * <code>false</code> if it is not. This implementation returns + * <code>false</code> for all arguments, subclasses should override the * method if necessary. * * @param rowIndex the row index of the cell. @@ -149,8 +149,8 @@ public abstract class AbstractTableModel implements TableModel, Serializable } /** - * Sets the value of the given cell. This implementation ignores all - * arguments and does nothing, subclasses should override the + * Sets the value of the given cell. This implementation ignores all + * arguments and does nothing, subclasses should override the * method if necessary. * * @param value the new value (<code>null</code> permitted). @@ -219,7 +219,7 @@ public abstract class AbstractTableModel implements TableModel, Serializable /** * Sends a {@link TableModelEvent} to all registered listeners to inform * them that some rows have been inserted into the model. - * + * * @param firstRow the index of the first row. * @param lastRow the index of the last row. */ @@ -233,7 +233,7 @@ public abstract class AbstractTableModel implements TableModel, Serializable /** * Sends a {@link TableModelEvent} to all registered listeners to inform * them that some rows have been updated. - * + * * @param firstRow the index of the first row. * @param lastRow the index of the last row. */ @@ -247,7 +247,7 @@ public abstract class AbstractTableModel implements TableModel, Serializable /** * Sends a {@link TableModelEvent} to all registered listeners to inform * them that some rows have been deleted from the model. - * + * * @param firstRow the index of the first row. * @param lastRow the index of the last row. */ @@ -261,7 +261,7 @@ public abstract class AbstractTableModel implements TableModel, Serializable /** * Sends a {@link TableModelEvent} to all registered listeners to inform * them that a single cell has been updated. - * + * * @param row the row index. * @param column the column index. */ @@ -272,15 +272,15 @@ public abstract class AbstractTableModel implements TableModel, Serializable /** * Sends the specified event to all registered listeners. - * + * * @param event the event to send. */ public void fireTableChanged(TableModelEvent event) { - int index; + int index; TableModelListener listener; Object[] list = listenerList.getListenerList(); - + for (index = 0; index < list.length; index += 2) { listener = (TableModelListener) list [index + 1]; @@ -291,9 +291,9 @@ public abstract class AbstractTableModel implements TableModel, Serializable /** * Returns an array of listeners of the given type that are registered with * this model. - * + * * @param listenerType the listener class. - * + * * @return An array of listeners (possibly empty). */ public <T extends EventListener> T[] getListeners(Class<T> listenerType) diff --git a/libjava/classpath/javax/swing/table/DefaultTableCellRenderer.java b/libjava/classpath/javax/swing/table/DefaultTableCellRenderer.java index 7fecefe..5d4a160 100644 --- a/libjava/classpath/javax/swing/table/DefaultTableCellRenderer.java +++ b/libjava/classpath/javax/swing/table/DefaultTableCellRenderer.java @@ -131,7 +131,7 @@ public class DefaultTableCellRenderer extends JLabel * @param hasFocus has the cell the focus? * @param row the row to render * @param column the cell to render - * + * * @return this component (the default table cell renderer) */ public Component getTableCellRendererComponent(JTable table, Object value, @@ -180,8 +180,8 @@ public class DefaultTableCellRenderer extends JLabel // can avoid filling the background by setting the renderer opaque. Color back = getBackground(); setOpaque(back != null && back.equals(table.getBackground())); - - return this; + + return this; } /** @@ -254,14 +254,14 @@ public class DefaultTableCellRenderer extends JLabel * do something.</p> */ public void firePropertyChange(String propertyName, boolean oldValue, - boolean newValue) + boolean newValue) { // Does nothing. } /** * Sets the String for this cell. - * + * * @param value the string value for this cell; if value is null it * sets the text value to an empty string */ diff --git a/libjava/classpath/javax/swing/table/DefaultTableColumnModel.java b/libjava/classpath/javax/swing/table/DefaultTableColumnModel.java index 717ea98..532b513 100644 --- a/libjava/classpath/javax/swing/table/DefaultTableColumnModel.java +++ b/libjava/classpath/javax/swing/table/DefaultTableColumnModel.java @@ -57,10 +57,10 @@ import javax.swing.event.TableColumnModelListener; /** * A model that stores information about the columns used in a {@link JTable}. - * + * * @see JTable#setColumnModel(TableColumnModel) - * - * @author Andrew Selkirk + * + * @author Andrew Selkirk */ public class DefaultTableColumnModel implements TableColumnModel, PropertyChangeListener, ListSelectionListener, @@ -89,15 +89,15 @@ public class DefaultTableColumnModel protected EventListenerList listenerList = new EventListenerList(); /** - * A change event used when notifying listeners of a change to the + * A change event used when notifying listeners of a change to the * <code>columnMargin</code> field. This single event is reused for all - * notifications (it is lazily instantiated within the + * notifications (it is lazily instantiated within the * {@link #fireColumnMarginChanged()} method). */ protected transient ChangeEvent changeEvent; /** - * A flag that indicates whether or not columns can be selected. + * A flag that indicates whether or not columns can be selected. */ protected boolean columnSelectionAllowed; @@ -107,10 +107,10 @@ public class DefaultTableColumnModel protected int totalColumnWidth; /** - * Creates a new table column model with zero columns. A default column + * Creates a new table column model with zero columns. A default column * selection model is created by calling {@link #createSelectionModel()}. * The default value for <code>columnMargin</code> is <code>1</code> and - * the default value for <code>columnSelectionAllowed</code> is + * the default value for <code>columnSelectionAllowed</code> is * <code>false</code>. */ public DefaultTableColumnModel() @@ -123,17 +123,17 @@ public class DefaultTableColumnModel } /** - * Adds a column to the model then calls + * Adds a column to the model then calls * {@link #fireColumnAdded(TableColumnModelEvent)} to notify the registered * listeners. The model registers itself with the column as a * {@link PropertyChangeListener} so that changes to the column width will * invalidate the cached {@link #totalColumnWidth} value. * * @param column the column (<code>null</code> not permitted). - * - * @throws IllegalArgumentException if <code>column</code> is + * + * @throws IllegalArgumentException if <code>column</code> is * <code>null</code>. - * + * * @see #removeColumn(TableColumn) */ public void addColumn(TableColumn column) @@ -143,18 +143,18 @@ public class DefaultTableColumnModel tableColumns.add(column); column.addPropertyChangeListener(this); invalidateWidthCache(); - fireColumnAdded(new TableColumnModelEvent(this, 0, + fireColumnAdded(new TableColumnModelEvent(this, 0, tableColumns.size() - 1)); } /** * Removes a column from the model then calls * {@link #fireColumnRemoved(TableColumnModelEvent)} to notify the registered - * listeners. If the specified column does not belong to the model, or is + * listeners. If the specified column does not belong to the model, or is * <code>null</code>, this method does nothing. * * @param column the column to be removed (<code>null</code> permitted). - * + * * @see #addColumn(TableColumn) */ public void removeColumn(TableColumn column) @@ -163,21 +163,21 @@ public class DefaultTableColumnModel if (index < 0) return; tableColumns.remove(column); - fireColumnRemoved(new TableColumnModelEvent(this, index, 0)); + fireColumnRemoved(new TableColumnModelEvent(this, index, 0)); column.removePropertyChangeListener(this); invalidateWidthCache(); } /** - * Moves the column at index i to the position specified by index j, then + * Moves the column at index i to the position specified by index j, then * calls {@link #fireColumnMoved(TableColumnModelEvent)} to notify registered * listeners. * * @param i index of the column that will be moved. * @param j index of the column's new location. - * + * * @throws IllegalArgumentException if <code>i</code> or <code>j</code> are - * outside the range <code>0</code> to <code>N-1</code>, where + * outside the range <code>0</code> to <code>N-1</code>, where * <code>N</code> is the column count. */ public void moveColumn(int i, int j) @@ -195,9 +195,9 @@ public class DefaultTableColumnModel /** * Sets the column margin then calls {@link #fireColumnMarginChanged()} to * notify the registered listeners. - * + * * @param margin the column margin. - * + * * @see #getColumnMargin() */ public void setColumnMargin(int margin) @@ -208,7 +208,7 @@ public class DefaultTableColumnModel /** * Returns the number of columns in the model. - * + * * @return The column count. */ public int getColumnCount() @@ -218,7 +218,7 @@ public class DefaultTableColumnModel /** * Returns an enumeration of the columns in the model. - * + * * @return An enumeration of the columns in the model. */ public Enumeration<TableColumn> getColumns() @@ -230,10 +230,10 @@ public class DefaultTableColumnModel * Returns the index of the {@link TableColumn} with the given identifier. * * @param identifier the identifier (<code>null</code> not permitted). - * + * * @return The index of the {@link TableColumn} with the given identifier. - * - * @throws IllegalArgumentException if <code>identifier</code> is + * + * @throws IllegalArgumentException if <code>identifier</code> is * <code>null</code> or there is no column with that identifier. */ public int getColumnIndex(Object identifier) @@ -241,7 +241,7 @@ public class DefaultTableColumnModel if (identifier == null) throw new IllegalArgumentException("Null identifier."); int columnCount = tableColumns.size(); - for (int i = 0; i < columnCount; i++) + for (int i = 0; i < columnCount; i++) { TableColumn tc = tableColumns.get(i); if (identifier.equals(tc.getIdentifier())) @@ -252,13 +252,13 @@ public class DefaultTableColumnModel /** * Returns the column at the specified index. - * - * @param columnIndex the column index (in the range from <code>0</code> to - * <code>N-1</code>, where <code>N</code> is the number of columns in + * + * @param columnIndex the column index (in the range from <code>0</code> to + * <code>N-1</code>, where <code>N</code> is the number of columns in * the model). - * + * * @return The column at the specified index. - * + * * @throws ArrayIndexOutOfBoundsException if <code>i</code> is not within * the specified range. */ @@ -269,9 +269,9 @@ public class DefaultTableColumnModel /** * Returns the column margin. - * + * * @return The column margin. - * + * * @see #setColumnMargin(int) */ public int getColumnMargin() @@ -288,15 +288,15 @@ public class DefaultTableColumnModel * <li>individual column widths are taken into account, but the column margin * is ignored.</li> * </ul> - * If no column contains the specified position, this method returns + * If no column contains the specified position, this method returns * <code>-1</code>. - * + * * @param x the x-position. - * + * * @return The column index, or <code>-1</code>. */ public int getColumnIndexAtX(int x) - { + { for (int i = 0; i < tableColumns.size(); ++i) { int w = (tableColumns.get(i)).getWidth(); @@ -322,21 +322,21 @@ public class DefaultTableColumnModel } /** - * Sets the selection model that will be used to keep track of the selected + * Sets the selection model that will be used to keep track of the selected * columns. * * @param model the selection model (<code>null</code> not permitted). - * - * @throws IllegalArgumentException if <code>model</code> is + * + * @throws IllegalArgumentException if <code>model</code> is * <code>null</code>. - * + * * @see #getSelectionModel() */ public void setSelectionModel(ListSelectionModel model) { if (model == null) throw new IllegalArgumentException(); - + selectionModel.removeListSelectionListener(this); selectionModel = model; selectionModel.addListSelectionListener(this); @@ -344,9 +344,9 @@ public class DefaultTableColumnModel /** * Returns the selection model used to track table column selections. - * + * * @return The selection model. - * + * * @see #setSelectionModel(ListSelectionModel) */ public ListSelectionModel getSelectionModel() @@ -358,7 +358,7 @@ public class DefaultTableColumnModel * Sets the flag that indicates whether or not column selection is allowed. * * @param flag the new flag value. - * + * * @see #getColumnSelectionAllowed() */ public void setColumnSelectionAllowed(boolean flag) @@ -367,11 +367,11 @@ public class DefaultTableColumnModel } /** - * Returns <code>true</code> if column selection is allowed, and + * Returns <code>true</code> if column selection is allowed, and * <code>false</code> if column selection is not allowed. * * @return A boolean. - * + * * @see #setColumnSelectionAllowed(boolean) */ public boolean getColumnSelectionAllowed() @@ -386,12 +386,12 @@ public class DefaultTableColumnModel */ public int[] getSelectedColumns() { - // FIXME: Implementation of this method was taken from private method + // FIXME: Implementation of this method was taken from private method // JTable.getSelections(), which is used in various places in JTable // including selected row calculations and cannot be simply removed. // This design should be improved to illuminate duplication of code. - - ListSelectionModel lsm = this.selectionModel; + + ListSelectionModel lsm = this.selectionModel; int sz = getSelectedColumnCount(); int [] ret = new int[sz]; @@ -405,16 +405,16 @@ public class DefaultTableColumnModel { case ListSelectionModel.SINGLE_SELECTION: ret[0] = lo; - break; - - case ListSelectionModel.SINGLE_INTERVAL_SELECTION: + break; + + case ListSelectionModel.SINGLE_INTERVAL_SELECTION: for (int i = lo; i <= hi; ++i) ret[j++] = i; break; - - case ListSelectionModel.MULTIPLE_INTERVAL_SELECTION: + + case ListSelectionModel.MULTIPLE_INTERVAL_SELECTION: for (int i = lo; i <= hi; ++i) - if (lsm.isSelectedIndex(i)) + if (lsm.isSelectedIndex(i)) ret[j++] = i; break; } @@ -424,23 +424,23 @@ public class DefaultTableColumnModel /** * Returns the number of selected columns in the model. - * + * * @return The selected column count. - * + * * @see #getSelectionModel() */ public int getSelectedColumnCount() { - // FIXME: Implementation of this method was taken from private method + // FIXME: Implementation of this method was taken from private method // JTable.countSelections(), which is used in various places in JTable // including selected row calculations and cannot be simply removed. // This design should be improved to illuminate duplication of code. - + ListSelectionModel lsm = this.selectionModel; int lo = lsm.getMinSelectionIndex(); int hi = lsm.getMaxSelectionIndex(); int sum = 0; - + if (lo != -1 && hi != -1) { switch (lsm.getSelectionMode()) @@ -448,19 +448,19 @@ public class DefaultTableColumnModel case ListSelectionModel.SINGLE_SELECTION: sum = 1; break; - + case ListSelectionModel.SINGLE_INTERVAL_SELECTION: sum = hi - lo + 1; break; - - case ListSelectionModel.MULTIPLE_INTERVAL_SELECTION: + + case ListSelectionModel.MULTIPLE_INTERVAL_SELECTION: for (int i = lo; i <= hi; ++i) - if (lsm.isSelectedIndex(i)) + if (lsm.isSelectedIndex(i)) ++sum; break; } } - + return sum; } @@ -476,7 +476,7 @@ public class DefaultTableColumnModel } /** - * Deregisters a listener so that it no longer receives notification of + * Deregisters a listener so that it no longer receives notification of * changes to this model. * * @param listener the listener to remove @@ -489,10 +489,10 @@ public class DefaultTableColumnModel /** * Returns an array containing the listeners that are registered with the * model. If there are no listeners, an empty array is returned. - * + * * @return An array containing the listeners that are registered with the * model. - * + * * @see #addColumnModelListener(TableColumnModelListener) * @since 1.4 */ @@ -500,34 +500,34 @@ public class DefaultTableColumnModel { return (TableColumnModelListener[]) listenerList.getListeners(TableColumnModelListener.class); - } + } /** - * Sends the specified {@link TableColumnModelEvent} to all registered + * Sends the specified {@link TableColumnModelEvent} to all registered * listeners, to indicate that a column has been added to the model. The * event's <code>toIndex</code> attribute should contain the index of the - * added column. - * + * added column. + * * @param e the event. - * + * * @see #addColumn(TableColumn) */ protected void fireColumnAdded(TableColumnModelEvent e) - { + { TableColumnModelListener[] listeners = getColumnModelListeners(); for (int i = 0; i < listeners.length; i++) - listeners[i].columnAdded(e); + listeners[i].columnAdded(e); } /** - * Sends the specified {@link TableColumnModelEvent} to all registered + * Sends the specified {@link TableColumnModelEvent} to all registered * listeners, to indicate that a column has been removed from the model. The * event's <code>fromIndex</code> attribute should contain the index of the - * removed column. - * + * removed column. + * * @param e the event. - * + * * @see #removeColumn(TableColumn) */ protected void fireColumnRemoved(TableColumnModelEvent e) @@ -535,18 +535,18 @@ public class DefaultTableColumnModel TableColumnModelListener[] listeners = getColumnModelListeners(); for (int i = 0; i < listeners.length; i++) - listeners[i].columnRemoved(e); + listeners[i].columnRemoved(e); } /** - * Sends the specified {@link TableColumnModelEvent} to all registered + * Sends the specified {@link TableColumnModelEvent} to all registered * listeners, to indicate that a column in the model has been moved. The * event's <code>fromIndex</code> attribute should contain the old column * index, and the <code>toIndex</code> attribute should contain the new - * column index. - * + * column index. + * * @param e the event. - * + * * @see #moveColumn(int, int) */ protected void fireColumnMoved(TableColumnModelEvent e) @@ -554,7 +554,7 @@ public class DefaultTableColumnModel TableColumnModelListener[] listeners = getColumnModelListeners(); for (int i = 0; i < listeners.length; i++) - listeners[i].columnMoved(e); + listeners[i].columnMoved(e); } /** @@ -562,7 +562,7 @@ public class DefaultTableColumnModel * to indicate that the column selections have changed. * * @param e the event. - * + * * @see #valueChanged(ListSelectionEvent) */ protected void fireColumnSelectionChanged(ListSelectionEvent e) @@ -573,9 +573,9 @@ public class DefaultTableColumnModel } /** - * Sends a {@link ChangeEvent} to the model's registered listeners to - * indicate that the column margin was changed. - * + * Sends a {@link ChangeEvent} to the model's registered listeners to + * indicate that the column margin was changed. + * * @see #setColumnMargin(int) */ protected void fireColumnMarginChanged() @@ -588,13 +588,13 @@ public class DefaultTableColumnModel } /** - * Returns an array containing the listeners (of the specified type) that + * Returns an array containing the listeners (of the specified type) that * are registered with this model. - * - * @param listenerType the listener type (must indicate a subclass of + * + * @param listenerType the listener type (must indicate a subclass of * {@link EventListener}, <code>null</code> not permitted). * - * @return An array containing the listeners (of the specified type) that + * @return An array containing the listeners (of the specified type) that * are registered with this model. */ public <T extends EventListener> T[] getListeners(Class<T> listenerType) @@ -605,23 +605,23 @@ public class DefaultTableColumnModel /** * Receives notification of property changes for the columns in the model. * If the <code>width</code> property for any column changes, we invalidate - * the {@link #totalColumnWidth} value here. + * the {@link #totalColumnWidth} value here. * * @param event the event. */ public void propertyChange(PropertyChangeEvent event) { if (event.getPropertyName().equals("width")) - invalidateWidthCache(); + invalidateWidthCache(); } /** - * Receives notification of the change to the list selection model, and - * responds by calling + * Receives notification of the change to the list selection model, and + * responds by calling * {@link #fireColumnSelectionChanged(ListSelectionEvent)}. - * + * * @param e the list selection event. - * + * * @see #getSelectionModel() */ public void valueChanged(ListSelectionEvent e) @@ -630,21 +630,21 @@ public class DefaultTableColumnModel } /** - * Creates a default selection model to track the currently selected + * Creates a default selection model to track the currently selected * column(s). This method is called by the constructor and returns a new * instance of {@link DefaultListSelectionModel}. * * @return A new default column selection model. */ protected ListSelectionModel createSelectionModel() - { + { return new DefaultListSelectionModel(); } /** * Recalculates the total width of the columns, if the cached value is * <code>-1</code>. Otherwise this method does nothing. - * + * * @see #getTotalColumnWidth() */ protected void recalcWidthCache() @@ -661,7 +661,7 @@ public class DefaultTableColumnModel /** * Sets the {@link #totalColumnWidth} field to <code>-1</code>. - * + * * @see #recalcWidthCache() */ private void invalidateWidthCache() diff --git a/libjava/classpath/javax/swing/table/DefaultTableModel.java b/libjava/classpath/javax/swing/table/DefaultTableModel.java index 1b68ce2..e1d5e68 100644 --- a/libjava/classpath/javax/swing/table/DefaultTableModel.java +++ b/libjava/classpath/javax/swing/table/DefaultTableModel.java @@ -44,10 +44,10 @@ import java.util.Vector; import javax.swing.event.TableModelEvent; /** - * A two dimensional data structure used to store <code>Object</code> + * A two dimensional data structure used to store <code>Object</code> * instances, usually for display in a <code>JTable</code> component. - * - * @author Andrew Selkirk + * + * @author Andrew Selkirk */ public class DefaultTableModel extends AbstractTableModel implements Serializable @@ -55,7 +55,7 @@ public class DefaultTableModel extends AbstractTableModel static final long serialVersionUID = 6680042567037222321L; /** - * Storage for the rows in the table (each row is itself + * Storage for the rows in the table (each row is itself * a <code>Vector</code>). */ protected Vector dataVector; @@ -68,27 +68,27 @@ public class DefaultTableModel extends AbstractTableModel /** * Creates an empty table with zero rows and zero columns. */ - public DefaultTableModel() + public DefaultTableModel() { this(0, 0); } - + /** * Creates a new table with the specified number of rows and columns. * All cells in the table are initially empty (set to <code>null</code>). - * + * * @param numRows the number of rows. * @param numColumns the number of columns. */ - public DefaultTableModel(int numRows, int numColumns) + public DefaultTableModel(int numRows, int numColumns) { Vector defaultNames = new Vector(numColumns); Vector data = new Vector(numRows); - for (int i = 0; i < numColumns; i++) + for (int i = 0; i < numColumns; i++) { defaultNames.add(super.getColumnName(i)); - } - for (int r = 0; r < numRows; r++) + } + for (int r = 0; r < numRows; r++) { Vector tmp = new Vector(numColumns); tmp.setSize(numColumns); @@ -96,16 +96,16 @@ public class DefaultTableModel extends AbstractTableModel } setDataVector(data, defaultNames); } - + /** * Creates a new table with the specified column names and number of * rows. The number of columns is determined by the number of column * names supplied. - * + * * @param columnNames the column names. * @param numRows the number of rows. */ - public DefaultTableModel(Vector columnNames, int numRows) + public DefaultTableModel(Vector columnNames, int numRows) { if (numRows < 0) throw new IllegalArgumentException("numRows < 0"); @@ -114,8 +114,8 @@ public class DefaultTableModel extends AbstractTableModel if (columnNames != null) numColumns = columnNames.size(); - - while (0 < numRows--) + + while (0 < numRows--) { Vector rowData = new Vector(); rowData.setSize(numColumns); @@ -126,43 +126,43 @@ public class DefaultTableModel extends AbstractTableModel /** * Creates a new table with the specified column names and row count. - * + * * @param columnNames the column names. * @param numRows the number of rows. */ - public DefaultTableModel(Object[] columnNames, int numRows) + public DefaultTableModel(Object[] columnNames, int numRows) { this(convertToVector(columnNames), numRows); } - + /** * Creates a new table with the specified data values and column names. - * + * * @param data the data values. * @param columnNames the column names. */ - public DefaultTableModel(Vector data, Vector columnNames) + public DefaultTableModel(Vector data, Vector columnNames) { setDataVector(data, columnNames); } /** * Creates a new table with the specified data values and column names. - * + * * @param data the data values. * @param columnNames the column names. */ - public DefaultTableModel(Object[][] data, Object[] columnNames) + public DefaultTableModel(Object[][] data, Object[] columnNames) { this(convertToVector(data), convertToVector(columnNames)); } /** * Returns the vector containing the row data for the table. - * + * * @return The data vector. */ - public Vector getDataVector() + public Vector getDataVector() { return dataVector; } @@ -173,13 +173,13 @@ public class DefaultTableModel extends AbstractTableModel * number of objects in each row does not match the number of column * names specified, the row data is truncated or expanded (by adding * <code>null</code> values) as required. - * + * * @param data the data for the table (a vector of row vectors). * @param columnNames the column names. - * + * * @throws NullPointerException if either argument is <code>null</code>. */ - public void setDataVector(Vector data, Vector columnNames) + public void setDataVector(Vector data, Vector columnNames) { if (data == null) dataVector = new Vector(); @@ -190,87 +190,87 @@ public class DefaultTableModel extends AbstractTableModel /** * Sets the data and column identifiers for the table. - * + * * @param data the data for the table. * @param columnNames the column names. - * + * * @throws NullPointerException if either argument is <code>null</code>. */ - public void setDataVector(Object[][] data, Object[] columnNames) + public void setDataVector(Object[][] data, Object[] columnNames) { - setDataVector(convertToVector(data), + setDataVector(convertToVector(data), convertToVector(columnNames)); } - + /** * Sends the specified <code>event</code> to all registered listeners. - * This method is equivalent to + * This method is equivalent to * {@link AbstractTableModel#fireTableChanged(TableModelEvent)}. - * + * * @param event the event. */ - public void newDataAvailable(TableModelEvent event) + public void newDataAvailable(TableModelEvent event) { fireTableChanged(event); } /** * Sends the specified <code>event</code> to all registered listeners. - * This method is equivalent to + * This method is equivalent to * {@link AbstractTableModel#fireTableChanged(TableModelEvent)}. - * + * * @param event the event. */ - public void newRowsAdded(TableModelEvent event) + public void newRowsAdded(TableModelEvent event) { fireTableChanged(event); } /** * Sends the specified <code>event</code> to all registered listeners. - * This method is equivalent to + * This method is equivalent to * {@link AbstractTableModel#fireTableChanged(TableModelEvent)}. - * + * * @param event the event. */ - public void rowsRemoved(TableModelEvent event) + public void rowsRemoved(TableModelEvent event) { fireTableChanged(event); } /** * Sets the column identifiers, updates the data rows (truncating - * or padding each row with <code>null</code> values) to match the + * or padding each row with <code>null</code> values) to match the * number of columns, and sends a {@link TableModelEvent} to all * registered listeners. - * + * * @param columnIdentifiers the column identifiers. */ - public void setColumnIdentifiers(Vector columnIdentifiers) + public void setColumnIdentifiers(Vector columnIdentifiers) { this.columnIdentifiers = columnIdentifiers; setColumnCount(columnIdentifiers == null ? 0 : columnIdentifiers.size()); } - + /** * Sets the column identifiers, updates the data rows (truncating - * or padding each row with <code>null</code> values) to match the + * or padding each row with <code>null</code> values) to match the * number of columns, and sends a {@link TableModelEvent} to all * registered listeners. - * + * * @param columnIdentifiers the column identifiers. */ - public void setColumnIdentifiers(Object[] columnIdentifiers) + public void setColumnIdentifiers(Object[] columnIdentifiers) { setColumnIdentifiers(convertToVector(columnIdentifiers)); } /** * This method is obsolete, use {@link #setRowCount(int)} instead. - * + * * @param numRows the number of rows. */ - public void setNumRows(int numRows) + public void setNumRows(int numRows) { setRowCount(numRows); } @@ -280,18 +280,18 @@ public class DefaultTableModel extends AbstractTableModel * than the current number of rows in the table, rows are discarded. * If <code>rowCount</code> is greater than the current number of rows in * the table, new (empty) rows are added. - * + * * @param rowCount the row count. */ - public void setRowCount(int rowCount) + public void setRowCount(int rowCount) { int existingRowCount = dataVector.size(); - if (rowCount < existingRowCount) + if (rowCount < existingRowCount) { dataVector.setSize(rowCount); - fireTableRowsDeleted(rowCount, existingRowCount - 1); + fireTableRowsDeleted(rowCount, existingRowCount - 1); } - else + else { int rowsToAdd = rowCount - existingRowCount; addExtraRows(rowsToAdd, columnIdentifiers.size()); @@ -303,16 +303,16 @@ public class DefaultTableModel extends AbstractTableModel * Sets the number of columns in the table. Existing rows are truncated * or padded with <code>null</code> values to match the new column count. * A {@link TableModelEvent} is sent to all registered listeners. - * + * * @param columnCount the column count. */ - public void setColumnCount(int columnCount) + public void setColumnCount(int columnCount) { for (int i = 0; i < dataVector.size(); ++i) { ((Vector) dataVector.get(i)).setSize(columnCount); } - if (columnIdentifiers != null) + if (columnIdentifiers != null) columnIdentifiers.setSize(columnCount); fireTableStructureChanged(); } @@ -320,24 +320,24 @@ public class DefaultTableModel extends AbstractTableModel /** * Adds a column with the specified name to the table. All cell values * for the column are initially set to <code>null</code>. - * + * * @param columnName the column name (<code>null</code> permitted). */ - public void addColumn(Object columnName) + public void addColumn(Object columnName) { addColumn(columnName, (Object[]) null); } /** - * Adds a column with the specified name and data values to the table. - * + * Adds a column with the specified name and data values to the table. + * * @param columnName the column name (<code>null</code> permitted). * @param columnData the column data. */ - public void addColumn(Object columnName, Vector columnData) + public void addColumn(Object columnName, Vector columnData) { Object[] dataArray = null; - if (columnData != null) + if (columnData != null) { int rowCount = dataVector.size(); if (columnData.size() < rowCount) @@ -349,17 +349,17 @@ public class DefaultTableModel extends AbstractTableModel /** * Adds a column with the specified name and data values to the table. - * + * * @param columnName the column name (<code>null</code> permitted). * @param columnData the column data. */ - public void addColumn(Object columnName, Object[] columnData) + public void addColumn(Object columnName, Object[] columnData) { if (columnData != null) { // check columnData array for cases where the number of items // doesn't match the number of rows in the existing table - if (columnData.length > dataVector.size()) + if (columnData.length > dataVector.size()) { int rowsToAdd = columnData.length - dataVector.size(); addExtraRows(rowsToAdd, columnIdentifiers.size()); @@ -382,10 +382,10 @@ public class DefaultTableModel extends AbstractTableModel /** * Adds a new row containing the specified data to the table and sends a * {@link TableModelEvent} to all registered listeners. - * + * * @param rowData the row data (<code>null</code> permitted). */ - public void addRow(Vector rowData) + public void addRow(Vector rowData) { int rowIndex = dataVector.size(); dataVector.add(rowData); @@ -397,21 +397,21 @@ public class DefaultTableModel extends AbstractTableModel /** * Adds a new row containing the specified data to the table and sends a * {@link TableModelEvent} to all registered listeners. - * + * * @param rowData the row data (<code>null</code> permitted). */ - public void addRow(Object[] rowData) + public void addRow(Object[] rowData) { addRow(convertToVector(rowData)); } /** * Inserts a new row into the table. - * + * * @param row the row index. * @param rowData the row data. */ - public void insertRow(int row, Vector rowData) + public void insertRow(int row, Vector rowData) { dataVector.add(row, rowData); fireTableRowsInserted(row, row); @@ -419,11 +419,11 @@ public class DefaultTableModel extends AbstractTableModel /** * Inserts a new row into the table. - * + * * @param row the row index. * @param rowData the row data. */ - public void insertRow(int row, Object[] rowData) + public void insertRow(int row, Object[] rowData) { insertRow(row, convertToVector(rowData)); } @@ -431,21 +431,21 @@ public class DefaultTableModel extends AbstractTableModel /** * Moves the rows from <code>startIndex</code> to <code>endIndex</code> * (inclusive) to the specified row. - * + * * @param startIndex the start row. * @param endIndex the end row. * @param toIndex the row to move to. */ - public void moveRow(int startIndex, int endIndex, int toIndex) + public void moveRow(int startIndex, int endIndex, int toIndex) { Vector removed = new Vector(); for (int i = endIndex; i >= startIndex; i--) { removed.add(this.dataVector.remove(i)); } - for (int i = 0; i <= endIndex - startIndex; i++) + for (int i = 0; i <= endIndex - startIndex; i++) { - dataVector.insertElementAt(removed.get(i), toIndex); + dataVector.insertElementAt(removed.get(i), toIndex); } int firstRow = Math.min(startIndex, toIndex); int lastRow = Math.max(endIndex, toIndex + (endIndex - startIndex)); @@ -455,10 +455,10 @@ public class DefaultTableModel extends AbstractTableModel /** * Removes a row from the table and sends a {@link TableModelEvent} to * all registered listeners. - * + * * @param row the row index. */ - public void removeRow(int row) + public void removeRow(int row) { dataVector.remove(row); fireTableRowsDeleted(row, row); @@ -466,20 +466,20 @@ public class DefaultTableModel extends AbstractTableModel /** * Returns the number of rows in the model. - * + * * @return The row count. */ - public int getRowCount() + public int getRowCount() { return dataVector.size(); } /** * Returns the number of columns in the model. - * + * * @return The column count. */ - public int getColumnCount() + public int getColumnCount() { return columnIdentifiers == null ? 0 : columnIdentifiers.size(); } @@ -489,23 +489,23 @@ public class DefaultTableModel extends AbstractTableModel * the return value is the result of the .toString() method call on that * identifier. If the identifier is not explicitly set, the returned value * is calculated by {@link AbstractTableModel#getColumnName(int)}. - * + * * @param column the column index. - * + * * @return The column name. */ public String getColumnName(int column) { String result = ""; - if (columnIdentifiers == null) + if (columnIdentifiers == null) result = super.getColumnName(column); - else + else { if (column < getColumnCount()) { checkSize(); Object id = columnIdentifiers.get(column); - if (id != null) + if (id != null) result = id.toString(); else result = super.getColumnName(column); @@ -520,40 +520,40 @@ public class DefaultTableModel extends AbstractTableModel * Returns <code>true</code> if the specified cell can be modified, and * <code>false</code> otherwise. For this implementation, the method * always returns <code>true</code>. - * + * * @param row the row index. * @param column the column index. - * + * * @return <code>true</code> in all cases. */ - public boolean isCellEditable(int row, int column) + public boolean isCellEditable(int row, int column) { return true; } /** * Returns the value at the specified cell in the table. - * + * * @param row the row index. * @param column the column index. - * - * @return The value (<code>Object</code>, possibly <code>null</code>) at + * + * @return The value (<code>Object</code>, possibly <code>null</code>) at * the specified cell in the table. */ - public Object getValueAt(int row, int column) + public Object getValueAt(int row, int column) { return ((Vector) dataVector.get(row)).get(column); } /** - * Sets the value for the specified cell in the table and sends a + * Sets the value for the specified cell in the table and sends a * {@link TableModelEvent} to all registered listeners. - * + * * @param value the value (<code>Object</code>, <code>null</code> permitted). * @param row the row index. * @param column the column index. */ - public void setValueAt(Object value, int row, int column) + public void setValueAt(Object value, int row, int column) { ((Vector) dataVector.get(row)).set(column, value); fireTableCellUpdated(row, column); @@ -561,31 +561,31 @@ public class DefaultTableModel extends AbstractTableModel /** * Converts the data array to a <code>Vector</code>. - * + * * @param data the data array (<code>null</code> permitted). - * - * @return A vector (or <code>null</code> if the data array + * + * @return A vector (or <code>null</code> if the data array * is <code>null</code>). */ - protected static Vector convertToVector(Object[] data) + protected static Vector convertToVector(Object[] data) { if (data == null) return null; Vector vector = new Vector(data.length); - for (int i = 0; i < data.length; i++) + for (int i = 0; i < data.length; i++) vector.add(data[i]); - return vector; + return vector; } - + /** * Converts the data array to a <code>Vector</code> of rows. - * + * * @param data the data array (<code>null</code> permitted). - * - * @return A vector (or <code>null</code> if the data array + * + * @return A vector (or <code>null</code> if the data array * is <code>null</code>. */ - protected static Vector convertToVector(Object[][] data) + protected static Vector convertToVector(Object[][] data) { if (data == null) return null; @@ -603,12 +603,12 @@ public class DefaultTableModel extends AbstractTableModel */ private void addExtraRows(int rowsToAdd, int nbColumns) { - for (int i = 0; i < rowsToAdd; i++) + for (int i = 0; i < rowsToAdd; i++) { Vector tmp = new Vector(); tmp.setSize(columnIdentifiers.size()); dataVector.add(tmp); - } + } } /** @@ -621,10 +621,10 @@ public class DefaultTableModel extends AbstractTableModel { int columnCount = getColumnCount(); int rowCount = getRowCount(); - + if (columnCount > columnIdentifiers.size()) columnIdentifiers.setSize(columnCount); - + if (dataVector != null && rowCount > dataVector.size()) { int rowsToAdd = rowCount - dataVector.size(); diff --git a/libjava/classpath/javax/swing/table/JTableHeader.java b/libjava/classpath/javax/swing/table/JTableHeader.java index 4661748..4eb9115 100644 --- a/libjava/classpath/javax/swing/table/JTableHeader.java +++ b/libjava/classpath/javax/swing/table/JTableHeader.java @@ -81,23 +81,23 @@ public class JTableHeader extends JComponent protected class AccessibleJTableHeaderEntry extends AccessibleContext implements Accessible, AccessibleComponent { - + private int columnIndex; - + private JTableHeader parent; - + private JTable table; - + public AccessibleJTableHeaderEntry(int c, JTableHeader p, JTable t) { columnIndex = c; parent = p; table = t; } - + /** * Returns the column header renderer. - * + * * @return The column header renderer. */ Component getColumnHeaderRenderer() @@ -106,14 +106,14 @@ public class JTableHeader extends JComponent TableCellRenderer r = tc.getHeaderRenderer(); if (r == null) r = parent.getDefaultRenderer(); - return r.getTableCellRendererComponent(table, tc.headerValue, + return r.getTableCellRendererComponent(table, tc.headerValue, false, false, -1, columnIndex); } - + /** - * Returns the accessible context for the column header renderer, or + * Returns the accessible context for the column header renderer, or * <code>null</code>. - * + * * @return The accessible context. */ AccessibleContext getAccessibleColumnHeaderRenderer() @@ -123,7 +123,7 @@ public class JTableHeader extends JComponent return c.getAccessibleContext(); return null; } - + /** * @see #removeFocusListener(FocusListener) */ @@ -134,7 +134,7 @@ public class JTableHeader extends JComponent if (c != null) c.addFocusListener(l); } - + /** * @see #removePropertyChangeListener(PropertyChangeListener) */ @@ -146,26 +146,26 @@ public class JTableHeader extends JComponent if (ac != null) ac.addPropertyChangeListener(l); } - + public boolean contains(Point p) { AccessibleContext ac = getAccessibleColumnHeaderRenderer(); AccessibleComponent c = ac.getAccessibleComponent(); if (c != null) return c.contains(p); - else + else return false; } - + public AccessibleAction getAccessibleAction() { AccessibleContext ac = getAccessibleColumnHeaderRenderer(); if (ac instanceof AccessibleAction) return (AccessibleAction) ac; - else + else return null; } - + public Accessible getAccessibleAt(Point p) { AccessibleContext ac = getAccessibleColumnHeaderRenderer(); @@ -175,53 +175,53 @@ public class JTableHeader extends JComponent else return null; } - + /** * Returns <code>null</code> as the header entry has no accessible * children. - * + * * @return <code>null</code>. */ public Accessible getAccessibleChild(int i) { return null; } - + /** * Returns the number of accessible children, zero in this case. - * + * * @return 0 */ public int getAccessibleChildrenCount() { return 0; } - + /** * Returns the accessible component for this header entry. - * + * * @return <code>this</code>. */ public AccessibleComponent getAccessibleComponent() { return this; } - + /** * Returns the accessible context for this header entry. - * + * * @return <code>this</code>. */ public AccessibleContext getAccessibleContext() { return this; } - + /** * Returns the accessible description. - * + * * @return The accessible description. - * + * * @see #setAccessibleDescription(String) */ public String getAccessibleDescription() @@ -231,22 +231,22 @@ public class JTableHeader extends JComponent return ac.getAccessibleDescription(); return accessibleDescription; } - + /** * Returns the index of this header entry. - * + * * @return The index of this header entry. */ public int getAccessibleIndexInParent() { return columnIndex; } - + /** * Returns the accessible name. - * + * * @return The accessible name. - * + * * @see #setAccessibleName(String) */ public String getAccessibleName() @@ -256,10 +256,10 @@ public class JTableHeader extends JComponent return ac.getAccessibleName(); return accessibleName; } - + /** * Returns the accessible role for the header entry. - * + * * @return The accessible role. */ public AccessibleRole getAccessibleRole() @@ -270,43 +270,43 @@ public class JTableHeader extends JComponent else return null; } - + public AccessibleSelection getAccessibleSelection() { AccessibleContext ac = getAccessibleColumnHeaderRenderer(); if (ac instanceof AccessibleValue) return (AccessibleSelection) ac; - else + else return null; } - + public AccessibleStateSet getAccessibleStateSet() { AccessibleContext ac = getAccessibleColumnHeaderRenderer(); if (ac != null) return ac.getAccessibleStateSet(); - else + else return null; } - + public AccessibleText getAccessibleText() { AccessibleContext ac = getAccessibleColumnHeaderRenderer(); if (ac != null) return ac.getAccessibleText(); - else + else return null; } - + public AccessibleValue getAccessibleValue() { AccessibleContext ac = getAccessibleColumnHeaderRenderer(); if (ac instanceof AccessibleValue) return (AccessibleValue) ac; - else + else return null; } - + public Color getBackground() { AccessibleContext ac = getAccessibleColumnHeaderRenderer(); @@ -316,7 +316,7 @@ public class JTableHeader extends JComponent else return null; } - + public Rectangle getBounds() { AccessibleContext ac = getAccessibleColumnHeaderRenderer(); @@ -326,7 +326,7 @@ public class JTableHeader extends JComponent else return null; } - + public Cursor getCursor() { AccessibleContext ac = getAccessibleColumnHeaderRenderer(); @@ -336,7 +336,7 @@ public class JTableHeader extends JComponent else return null; } - + public Font getFont() { AccessibleContext ac = getAccessibleColumnHeaderRenderer(); @@ -346,7 +346,7 @@ public class JTableHeader extends JComponent else return null; } - + public FontMetrics getFontMetrics(Font f) { AccessibleContext ac = getAccessibleColumnHeaderRenderer(); @@ -356,7 +356,7 @@ public class JTableHeader extends JComponent else return null; } - + public Color getForeground() { AccessibleContext ac = getAccessibleColumnHeaderRenderer(); @@ -366,7 +366,7 @@ public class JTableHeader extends JComponent else return null; } - + public Locale getLocale() { Component c = getColumnHeaderRenderer(); @@ -374,7 +374,7 @@ public class JTableHeader extends JComponent return c.getLocale(); return null; } - + public Point getLocation() { AccessibleContext ac = getAccessibleColumnHeaderRenderer(); @@ -384,7 +384,7 @@ public class JTableHeader extends JComponent else return null; } - + public Point getLocationOnScreen() { AccessibleContext ac = getAccessibleColumnHeaderRenderer(); @@ -394,7 +394,7 @@ public class JTableHeader extends JComponent else return null; } - + public Dimension getSize() { AccessibleContext ac = getAccessibleColumnHeaderRenderer(); @@ -404,7 +404,7 @@ public class JTableHeader extends JComponent else return null; } - + public boolean isEnabled() { AccessibleContext ac = getAccessibleColumnHeaderRenderer(); @@ -414,7 +414,7 @@ public class JTableHeader extends JComponent else return false; } - + public boolean isFocusTraversable() { AccessibleContext ac = getAccessibleColumnHeaderRenderer(); @@ -424,7 +424,7 @@ public class JTableHeader extends JComponent else return false; } - + public boolean isShowing() { AccessibleContext ac = getAccessibleColumnHeaderRenderer(); @@ -434,7 +434,7 @@ public class JTableHeader extends JComponent else return false; } - + public boolean isVisible() { AccessibleContext ac = getAccessibleColumnHeaderRenderer(); @@ -444,7 +444,7 @@ public class JTableHeader extends JComponent else return false; } - + /** * @see #addFocusListener(FocusListener) */ @@ -455,7 +455,7 @@ public class JTableHeader extends JComponent if (c != null) c.removeFocusListener(l); } - + /** * @see #addPropertyChangeListener(PropertyChangeListener) */ @@ -465,7 +465,7 @@ public class JTableHeader extends JComponent if (ac != null) ac.removePropertyChangeListener(l); } - + /** * @see #addFocusListener(FocusListener) */ @@ -476,7 +476,7 @@ public class JTableHeader extends JComponent if (c != null) c.requestFocus(); } - + /** * @see #getAccessibleDescription() */ @@ -488,7 +488,7 @@ public class JTableHeader extends JComponent else accessibleDescription = s; } - + /** * @see #getAccessibleName() */ @@ -498,7 +498,7 @@ public class JTableHeader extends JComponent if (ac != null) ac.setAccessibleName(s); } - + public void setBackground(Color c) { AccessibleContext ac = getAccessibleColumnHeaderRenderer(); @@ -506,7 +506,7 @@ public class JTableHeader extends JComponent if (comp != null) comp.setBackground(c); } - + public void setBounds(Rectangle r) { AccessibleContext ac = getAccessibleColumnHeaderRenderer(); @@ -514,7 +514,7 @@ public class JTableHeader extends JComponent if (comp != null) comp.setBounds(r); } - + public void setCursor(Cursor c) { AccessibleContext ac = getAccessibleColumnHeaderRenderer(); @@ -522,7 +522,7 @@ public class JTableHeader extends JComponent if (comp != null) comp.setCursor(c); } - + public void setEnabled(boolean b) { AccessibleContext ac = getAccessibleColumnHeaderRenderer(); @@ -530,7 +530,7 @@ public class JTableHeader extends JComponent if (comp != null) comp.setEnabled(b); } - + public void setFont(Font f) { AccessibleContext ac = getAccessibleColumnHeaderRenderer(); @@ -538,7 +538,7 @@ public class JTableHeader extends JComponent if (comp != null) comp.setFont(f); } - + public void setForeground(Color c) { AccessibleContext ac = getAccessibleColumnHeaderRenderer(); @@ -546,7 +546,7 @@ public class JTableHeader extends JComponent if (comp != null) comp.setForeground(c); } - + public void setLocation(Point p) { AccessibleContext ac = getAccessibleColumnHeaderRenderer(); @@ -554,7 +554,7 @@ public class JTableHeader extends JComponent if (comp != null) comp.setLocation(p); } - + public void setSize(Dimension d) { AccessibleContext ac = getAccessibleColumnHeaderRenderer(); @@ -562,7 +562,7 @@ public class JTableHeader extends JComponent if (comp != null) comp.setSize(d); } - + public void setVisible(boolean b) { AccessibleContext ac = getAccessibleColumnHeaderRenderer(); @@ -571,28 +571,28 @@ public class JTableHeader extends JComponent comp.setVisible(b); } } - + public AccessibleRole getAccessibleRole() { return AccessibleRole.PANEL; } - + public int getAccessibleChildrenCount() { return table.getColumnCount(); } - + public Accessible getAccessibleChild(int i) { return new AccessibleJTableHeaderEntry(i, JTableHeader.this, table); } - + public Accessible getAccessibleAt(Point p) { return getAccessibleChild(columnAtPoint(p)); } } - + /** * Use serialVersionUid for interoperability. */ @@ -643,7 +643,7 @@ public class JTableHeader extends JComponent */ protected boolean updateTableInRealTime; - TableCellRenderer cellRenderer; + TableCellRenderer cellRenderer; /** * Creates a new default instance. @@ -655,21 +655,21 @@ public class JTableHeader extends JComponent /** * Creates a new header. If <code>cm</code> is <code>null</code>, a new - * table column model is created by calling + * table column model is created by calling * {@link #createDefaultColumnModel()}. - * + * * @param cm the table column model (<code>null</code> permitted). */ public JTableHeader(TableColumnModel cm) { - columnModel = cm == null ? createDefaultColumnModel() : cm; + columnModel = cm == null ? createDefaultColumnModel() : cm; initializeLocalVars(); updateUI(); } /** * Creates a default table column model. - * + * * @return A default table column model. */ protected TableColumnModel createDefaultColumnModel() @@ -724,7 +724,7 @@ public class JTableHeader extends JComponent * disabled with {@link #setReorderingAllowed(boolean)}. * * @return true if reordering is allowed, false otherwise. - */ + */ public boolean getReorderingAllowed() { return reorderingAllowed; @@ -736,7 +736,7 @@ public class JTableHeader extends JComponent * by default, but can be disabled with {@link #setResizingAllowed(boolean)}. * * @return true if resizing is allowed, false otherwise. - */ + */ public boolean getResizingAllowed() { return resizingAllowed; @@ -787,7 +787,7 @@ public class JTableHeader extends JComponent * Set the value of the {@link #columnModel} property. * * @param c The new value of the property - */ + */ public void setColumnModel(TableColumnModel c) { columnModel.removeColumnModelListener(this); @@ -797,11 +797,11 @@ public class JTableHeader extends JComponent /** * Set the column that is currently being dragged. This is used when - * dragging the column with mouse. Setting to null will stop the + * dragging the column with mouse. Setting to null will stop the * dragging session immediately. * * @param draggingIt the column being currently dragged, null if none. - */ + */ public void setDraggedColumn(TableColumn draggingIt) { draggedColumn = draggingIt; @@ -811,7 +811,7 @@ public class JTableHeader extends JComponent * Set the value of the {@link #draggedDistance} property. * * @param d The new value of the property - */ + */ public void setDraggedDistance(int d) { draggedDistance = d; @@ -821,7 +821,7 @@ public class JTableHeader extends JComponent * Set the value of the {@link #opaque} property. * * @param o The new value of the property - */ + */ public void setOpaque(boolean o) { opaque = o; @@ -833,7 +833,7 @@ public class JTableHeader extends JComponent * disabled with this method. * * @param allowed true if reordering is allowed, false otherwise. - */ + */ public void setReorderingAllowed(boolean allowed) { reorderingAllowed = allowed; @@ -845,7 +845,7 @@ public class JTableHeader extends JComponent * by default, but can be disabled using this method. * * @param allowed true if resizing is allowed, false otherwise. - */ + */ public void setResizingAllowed(boolean allowed) { resizingAllowed = allowed; @@ -857,7 +857,7 @@ public class JTableHeader extends JComponent * the resizing session immediately. * * @param resizingIt the column being currently resized - */ + */ public void setResizingColumn(TableColumn resizingIt) { resizingColumn = resizingIt; @@ -867,7 +867,7 @@ public class JTableHeader extends JComponent * Set the value of the {@link #table} property. * * @param t The new value of the property - */ + */ public void setTable(JTable t) { table = t; @@ -877,7 +877,7 @@ public class JTableHeader extends JComponent * Set the value of the {@link #updateTableInRealTime} property. * * @param u The new value of the property - */ + */ public void setUpdateTableInRealTime(boolean u) { updateTableInRealTime = u; @@ -885,17 +885,17 @@ public class JTableHeader extends JComponent /** * Creates a default renderer. - * + * * @return A default renderer. */ protected TableCellRenderer createDefaultRenderer() { return new DefaultTableCellRenderer(); } - + /** * Returns the default table cell renderer. - * + * * @return The default table cell renderer. */ public TableCellRenderer getDefaultRenderer() @@ -905,19 +905,19 @@ public class JTableHeader extends JComponent /** * Sets the default table cell renderer. - * + * * @param cellRenderer the renderer. */ public void setDefaultRenderer(TableCellRenderer cellRenderer) { this.cellRenderer = cellRenderer; } - + /** * Get the rectangle, occupied by the header of the given column. - * + * * @param column the column, for that the header area is requested. - * + * * @return the column header area. */ public Rectangle getHeaderRect(int column) @@ -956,16 +956,16 @@ public class JTableHeader extends JComponent /** * Returns the index of the column at the specified point. - * + * * @param point the point. - * + * * @return The column index, or -1. */ public int columnAtPoint(Point point) { if (getBounds().contains(point)) return columnModel.getColumnIndexAtX(point.x); - + return -1; } diff --git a/libjava/classpath/javax/swing/table/TableCellEditor.java b/libjava/classpath/javax/swing/table/TableCellEditor.java index 15070a7..933eb9e 100644 --- a/libjava/classpath/javax/swing/table/TableCellEditor.java +++ b/libjava/classpath/javax/swing/table/TableCellEditor.java @@ -47,7 +47,7 @@ import javax.swing.JTable; * TableCellEditor public interface * @author Andrew Selkirk */ -public interface TableCellEditor extends CellEditor +public interface TableCellEditor extends CellEditor { /** @@ -59,7 +59,7 @@ public interface TableCellEditor extends CellEditor * @param column Column of cell * @return Component */ - Component getTableCellEditorComponent(JTable table, Object value, + Component getTableCellEditorComponent(JTable table, Object value, boolean isSelected, int row, int column); } diff --git a/libjava/classpath/javax/swing/table/TableCellRenderer.java b/libjava/classpath/javax/swing/table/TableCellRenderer.java index 6c1fecf..da7296d 100644 --- a/libjava/classpath/javax/swing/table/TableCellRenderer.java +++ b/libjava/classpath/javax/swing/table/TableCellRenderer.java @@ -46,7 +46,7 @@ import javax.swing.JTable; * TableCellRenderer public interface * @author Andrew Selkirk */ -public interface TableCellRenderer +public interface TableCellRenderer { /** @@ -59,7 +59,7 @@ public interface TableCellRenderer * @param column Column of cell * @return Component */ - Component getTableCellRendererComponent(JTable table, Object value, + Component getTableCellRendererComponent(JTable table, Object value, boolean isSelected, boolean hasFocus, int row, int column); diff --git a/libjava/classpath/javax/swing/table/TableColumn.java b/libjava/classpath/javax/swing/table/TableColumn.java index fbb877d..8db4bf6 100644 --- a/libjava/classpath/javax/swing/table/TableColumn.java +++ b/libjava/classpath/javax/swing/table/TableColumn.java @@ -49,8 +49,8 @@ import javax.swing.event.SwingPropertyChangeSupport; /** * Represents the attributes of a column in a table, including the column index, * width, minimum width, preferred width and maximum width. - * - * @author Andrew Selkirk + * + * @author Andrew Selkirk */ public class TableColumn implements Serializable @@ -59,7 +59,7 @@ public class TableColumn /** * The name for the <code>columnWidth</code> property (this field is - * obsolete and no longer used). Note also that the typo in the value + * obsolete and no longer used). Note also that the typo in the value * string is deliberate, to match the specification. */ public static final String COLUMN_WIDTH_PROPERTY = "columWidth"; @@ -158,9 +158,9 @@ public class TableColumn } /** - * Creates a new <code>TableColumn</code> that maps to the specified column + * Creates a new <code>TableColumn</code> that maps to the specified column * in the related table model. The default width is <code>75</code> units. - * + * * @param modelIndex the index of the column in the model */ public TableColumn(int modelIndex) @@ -169,9 +169,9 @@ public class TableColumn } /** - * Creates a new <code>TableColumn</code> that maps to the specified column + * Creates a new <code>TableColumn</code> that maps to the specified column * in the related table model, and has the specified <code>width</code>. - * + * * @param modelIndex the index of the column in the model * @param width the width */ @@ -181,10 +181,10 @@ public class TableColumn } /** - * Creates a new <code>TableColumn</code> that maps to the specified column + * Creates a new <code>TableColumn</code> that maps to the specified column * in the related table model, and has the specified <code>width</code>, * <code>cellRenderer</code> and <code>cellEditor</code>. - * + * * @param modelIndex the index of the column in the model * @param width the width * @param cellRenderer the cell renderer (<code>null</code> permitted). @@ -206,9 +206,9 @@ public class TableColumn * Sets the index of the column in the related {@link TableModel} that this * <code>TableColumn</code> maps to, and sends a {@link PropertyChangeEvent} * (with the property name 'modelIndex') to all registered listeners. - * + * * @param modelIndex the column index in the model. - * + * * @see #getModelIndex() */ public void setModelIndex(int modelIndex) @@ -224,9 +224,9 @@ public class TableColumn /** * Returns the index of the column in the related {@link TableModel} that * this <code>TableColumn</code> maps to. - * + * * @return the model index. - * + * * @see #setModelIndex(int) */ public int getModelIndex() @@ -237,15 +237,15 @@ public class TableColumn /** * Sets the identifier for the column and sends a {@link PropertyChangeEvent} * (with the property name 'identifier') to all registered listeners. - * + * * @param identifier the identifier (<code>null</code> permitted). - * + * * @see #getIdentifier() */ public void setIdentifier(Object identifier) { if (this.identifier != identifier) - { + { Object oldValue = this.identifier; this.identifier = identifier; changeSupport.firePropertyChange("identifier", oldValue, identifier); @@ -253,10 +253,10 @@ public class TableColumn } /** - * Returns the identifier for the column, or {@link #getHeaderValue()} if the + * Returns the identifier for the column, or {@link #getHeaderValue()} if the * identifier is <code>null</code>. - * - * @return The identifier (or {@link #getHeaderValue()} if the identifier is + * + * @return The identifier (or {@link #getHeaderValue()} if the identifier is * <code>null</code>). */ public Object getIdentifier() @@ -267,29 +267,29 @@ public class TableColumn } /** - * Sets the header value and sends a {@link PropertyChangeEvent} (with the + * Sets the header value and sends a {@link PropertyChangeEvent} (with the * property name {@link #HEADER_VALUE_PROPERTY}) to all registered listeners. - * + * * @param headerValue the value of the header (<code>null</code> permitted). - * + * * @see #getHeaderValue() */ public void setHeaderValue(Object headerValue) { if (this.headerValue == headerValue) return; - + Object oldValue = this.headerValue; this.headerValue = headerValue; - changeSupport.firePropertyChange(HEADER_VALUE_PROPERTY, oldValue, + changeSupport.firePropertyChange(HEADER_VALUE_PROPERTY, oldValue, headerValue); } /** * Returns the header value. - * + * * @return the value of the header. - * + * * @see #getHeaderValue() */ public Object getHeaderValue() @@ -298,30 +298,30 @@ public class TableColumn } /** - * Sets the renderer for the column header and sends a - * {@link PropertyChangeEvent} (with the property name + * Sets the renderer for the column header and sends a + * {@link PropertyChangeEvent} (with the property name * {@link #HEADER_RENDERER_PROPERTY}) to all registered listeners. - * + * * @param renderer the header renderer (<code>null</code> permitted). - * + * * @see #getHeaderRenderer() */ public void setHeaderRenderer(TableCellRenderer renderer) { if (headerRenderer == renderer) return; - + TableCellRenderer oldRenderer = headerRenderer; headerRenderer = renderer; - changeSupport.firePropertyChange(HEADER_RENDERER_PROPERTY, oldRenderer, + changeSupport.firePropertyChange(HEADER_RENDERER_PROPERTY, oldRenderer, headerRenderer); } /** * Returns the renderer for the column header. - * + * * @return The renderer for the column header (possibly <code>null</code>). - * + * * @see #setHeaderRenderer(TableCellRenderer) */ public TableCellRenderer getHeaderRenderer() @@ -330,30 +330,30 @@ public class TableColumn } /** - * Sets the renderer for cells in this column and sends a - * {@link PropertyChangeEvent} (with the property name + * Sets the renderer for cells in this column and sends a + * {@link PropertyChangeEvent} (with the property name * {@link #CELL_RENDERER_PROPERTY}) to all registered listeners. - * + * * @param renderer the cell renderer (<code>null</code> permitted). - * + * * @see #getCellRenderer() */ public void setCellRenderer(TableCellRenderer renderer) { if (cellRenderer == renderer) return; - + TableCellRenderer oldRenderer = cellRenderer; cellRenderer = renderer; - changeSupport.firePropertyChange(CELL_RENDERER_PROPERTY, oldRenderer, + changeSupport.firePropertyChange(CELL_RENDERER_PROPERTY, oldRenderer, cellRenderer); } /** * Returns the renderer for the table cells in this column. - * + * * @return The cell renderer (possibly <code>null</code>). - * + * * @see #setCellRenderer(TableCellRenderer) */ public TableCellRenderer getCellRenderer() @@ -364,9 +364,9 @@ public class TableColumn /** * Sets the cell editor for the column and sends a {@link PropertyChangeEvent} * (with the property name 'cellEditor') to all registered listeners. - * + * * @param cellEditor the cell editor (<code>null</code> permitted). - * + * * @see #getCellEditor() */ public void setCellEditor(TableCellEditor cellEditor) @@ -380,11 +380,11 @@ public class TableColumn } /** - * Returns the cell editor for the column (the default value is + * Returns the cell editor for the column (the default value is * <code>null</code>). - * + * * @return The cell editor (possibly <code>null</code>). - * + * * @see #setCellEditor(TableCellEditor) */ public TableCellEditor getCellEditor() @@ -393,18 +393,18 @@ public class TableColumn } /** - * Sets the width for the column and sends a {@link PropertyChangeEvent} + * Sets the width for the column and sends a {@link PropertyChangeEvent} * (with the property name 'width') to all registered listeners. If the new - * width falls outside the range getMinWidth() to getMaxWidth() it is + * width falls outside the range getMinWidth() to getMaxWidth() it is * adjusted to the appropriate boundary value. - * + * * @param newWidth the width. - * + * * @see #getWidth() */ public void setWidth(int newWidth) { - int oldWidth = width; + int oldWidth = width; if (newWidth < minWidth) width = minWidth; @@ -425,7 +425,7 @@ public class TableColumn /** * Returns the width for the column (the default value is <code>75</code>). - * + * * @return The width. * * @see #setWidth(int) @@ -436,14 +436,14 @@ public class TableColumn } /** - * Sets the preferred width for the column and sends a - * {@link PropertyChangeEvent} (with the property name 'preferredWidth') to - * all registered listeners. If necessary, the supplied value will be - * adjusted to fit in the range {@link #getMinWidth()} to + * Sets the preferred width for the column and sends a + * {@link PropertyChangeEvent} (with the property name 'preferredWidth') to + * all registered listeners. If necessary, the supplied value will be + * adjusted to fit in the range {@link #getMinWidth()} to * {@link #getMaxWidth()}. - * + * * @param preferredWidth the preferred width. - * + * * @see #getPreferredWidth() */ public void setPreferredWidth(int preferredWidth) @@ -457,16 +457,16 @@ public class TableColumn else this.preferredWidth = preferredWidth; - changeSupport.firePropertyChange("preferredWidth", oldPrefWidth, + changeSupport.firePropertyChange("preferredWidth", oldPrefWidth, this.preferredWidth); } /** - * Returns the preferred width for the column (the default value is + * Returns the preferred width for the column (the default value is * <code>75</code>). - * + * * @return The preferred width. - * + * * @see #setPreferredWidth(int) */ public int getPreferredWidth() @@ -475,14 +475,14 @@ public class TableColumn } /** - * Sets the minimum width for the column and sends a + * Sets the minimum width for the column and sends a * {@link PropertyChangeEvent} (with the property name 'minWidth') to all - * registered listeners. If the current <code>width</code> and/or + * registered listeners. If the current <code>width</code> and/or * <code>preferredWidth</code> are less than the new minimum width, they are * adjusted accordingly. - * + * * @param minWidth the minimum width (negative values are treated as 0). - * + * * @see #getMinWidth() */ public void setMinWidth(int minWidth) @@ -504,9 +504,9 @@ public class TableColumn /** * Returns the <code>TableColumn</code>'s minimum width (the default value * is <code>15</code>). - * + * * @return The minimum width. - * + * * @see #setMinWidth(int) */ public int getMinWidth() @@ -515,14 +515,14 @@ public class TableColumn } /** - * Sets the maximum width for the column and sends a + * Sets the maximum width for the column and sends a * {@link PropertyChangeEvent} (with the property name 'maxWidth') to all - * registered listeners. If the current <code>width</code> and/or - * <code>preferredWidth</code> are greater than the new maximum width, they + * registered listeners. If the current <code>width</code> and/or + * <code>preferredWidth</code> are greater than the new maximum width, they * are adjusted accordingly. - * + * * @param maxWidth the maximum width. - * + * * @see #getMaxWidth() */ public void setMaxWidth(int maxWidth) @@ -542,9 +542,9 @@ public class TableColumn /** * Returns the maximum width for the column (the default value is * {@link Integer#MAX_VALUE}). - * + * * @return The maximum width for the column. - * + * * @see #setMaxWidth(int) */ public int getMaxWidth() @@ -556,10 +556,10 @@ public class TableColumn * Sets the flag that controls whether or not the column is resizable, and * sends a {@link PropertyChangeEvent} (with the property name 'isResizable') * to all registered listeners. - * + * * @param isResizable <code>true</code> if this column is resizable, * <code>false</code> otherwise. - * + * * @see #getResizable() */ public void setResizable(boolean isResizable) @@ -567,17 +567,17 @@ public class TableColumn if (this.isResizable != isResizable) { this.isResizable = isResizable; - changeSupport.firePropertyChange("isResizable", !this.isResizable, + changeSupport.firePropertyChange("isResizable", !this.isResizable, isResizable); } } /** * Returns the flag that controls whether or not the column is resizable. - * + * * @return <code>true</code> if this column is resizable, * <code>false</code> otherwise. - * + * * @see #setResizable(boolean) */ public boolean getResizable() @@ -594,7 +594,7 @@ public class TableColumn { if (headerRenderer == null) return; - Component c = headerRenderer.getTableCellRendererComponent(null, + Component c = headerRenderer.getTableCellRendererComponent(null, getHeaderValue(), false, false, 0, 0); Dimension min = c.getMinimumSize(); Dimension max = c.getMaximumSize(); @@ -624,27 +624,27 @@ public class TableColumn } /** - * Adds a listener so that it receives {@link PropertyChangeEvent} + * Adds a listener so that it receives {@link PropertyChangeEvent} * notifications from this column. The properties defined by the column are: * <ul> * <li><code>width</code> - see {@link #setWidth(int)};</li> * <li><code>preferredWidth</code> - see {@link #setPreferredWidth(int)};</li> - * <li><code>minWidth</code> - see {@link #setMinWidth(int)};</li> + * <li><code>minWidth</code> - see {@link #setMinWidth(int)};</li> * <li><code>maxWidth</code> - see {@link #setMaxWidth(int)};</li> * <li><code>modelIndex</code> - see {@link #setModelIndex(int)};</li> * <li><code>isResizable</code> - see {@link #setResizable(boolean)};</li> - * <li><code>cellRenderer</code> - see + * <li><code>cellRenderer</code> - see * {@link #setCellRenderer(TableCellRenderer)};</li> - * <li><code>cellEditor</code> - see + * <li><code>cellEditor</code> - see * {@link #setCellEditor(TableCellEditor)};</li> - * <li><code>headerRenderer</code> - see + * <li><code>headerRenderer</code> - see * {@link #setHeaderRenderer(TableCellRenderer)};</li> * <li><code>headerValue</code> - see {@link #setHeaderValue(Object)};</li> * <li><code>identifier</code> - see {@link #setIdentifier(Object)}.</li> * </ul> - * + * * @param listener the listener to add (<code>null</code> is ignored). - * + * * @see #removePropertyChangeListener(PropertyChangeListener) */ public synchronized void addPropertyChangeListener( @@ -654,11 +654,11 @@ public class TableColumn } /** - * Removes a listener so that it no longer receives - * {@link PropertyChangeEvent} notifications from this column. If - * <code>listener</code> is not registered with the column, or is + * Removes a listener so that it no longer receives + * {@link PropertyChangeEvent} notifications from this column. If + * <code>listener</code> is not registered with the column, or is * <code>null</code>, this method does nothing. - * + * * @param listener the listener to remove (<code>null</code> is ignored). */ public synchronized void removePropertyChangeListener( @@ -670,9 +670,9 @@ public class TableColumn /** * Returns the property change listeners for this <code>TableColumn</code>. * An empty array is returned if there are currently no listeners registered. - * + * * @return The property change listeners registered with this column. - * + * * @since 1.4 */ public PropertyChangeListener[] getPropertyChangeListeners() @@ -683,7 +683,7 @@ public class TableColumn /** * Creates and returns a default renderer for the column header (in this case, * a new instance of {@link DefaultTableCellRenderer}). - * + * * @return A default renderer for the column header. */ protected TableCellRenderer createDefaultHeaderRenderer() diff --git a/libjava/classpath/javax/swing/table/TableColumnModel.java b/libjava/classpath/javax/swing/table/TableColumnModel.java index 7e8a70c..9a95f92 100644 --- a/libjava/classpath/javax/swing/table/TableColumnModel.java +++ b/libjava/classpath/javax/swing/table/TableColumnModel.java @@ -49,17 +49,17 @@ import javax.swing.event.TableColumnModelListener; /** * The interface used by {@link JTable} to access the columns in the table * view. - * + * * @author Andrew Selkirk */ public interface TableColumnModel { /** * Adds a column to the model. - * + * * @param column the new column (<code>null</code> not permitted). - * - * @throws IllegalArgumentException if <code>column</code> is + * + * @throws IllegalArgumentException if <code>column</code> is * <code>null</code>. */ void addColumn(TableColumn column); @@ -67,14 +67,14 @@ public interface TableColumnModel /** * Removes a column from the model. If <code>column</code> is not defined * in the model, this method does nothing. - * + * * @param column TableColumn */ void removeColumn(TableColumn column); /** * Moves a column. - * + * * @param columnIndex Index of column to move * @param newIndex New index of column */ @@ -83,23 +83,23 @@ public interface TableColumnModel /** * Sets the column margin and sends a {@link ChangeEvent} to all registered * {@link TableColumnModelListener}s registered with the model. - * + * * @param margin the column margin. - * + * * @see #getColumnMargin() */ void setColumnMargin(int margin); /** * Returns the number of columns in the model. - * + * * @return The column count. */ int getColumnCount(); /** * Returns an enumeration of the columns in the model. - * + * * @return An enumeration of the columns in the model. */ Enumeration<TableColumn> getColumns(); @@ -108,28 +108,28 @@ public interface TableColumnModel * Returns the index of the {@link TableColumn} with the given identifier. * * @param identifier the identifier (<code>null</code> not permitted). - * + * * @return The index of the {@link TableColumn} with the given identifier. - * - * @throws IllegalArgumentException if <code>identifier</code> is + * + * @throws IllegalArgumentException if <code>identifier</code> is * <code>null</code> or there is no column with that identifier. */ int getColumnIndex(Object identifier); /** * Returns the <code>TableColumn</code> at the specified index. - * + * * @param columnIndex the column index. - * + * * @return The table column. */ TableColumn getColumn(int columnIndex); /** * Returns the column margin. - * + * * @return The column margin. - * + * * @see #setColumnMargin(int) */ int getColumnMargin(); @@ -143,11 +143,11 @@ public interface TableColumnModel * <li>individual column widths are taken into account, but the column margin * is ignored.</li> * </ul> - * If no column contains the specified position, this method returns + * If no column contains the specified position, this method returns * <code>-1</code>. - * + * * @param xPosition the x-position. - * + * * @return The column index, or <code>-1</code>. */ int getColumnIndexAtX(int xPosition); @@ -164,17 +164,17 @@ public interface TableColumnModel * Sets the flag that indicates whether or not column selection is allowed. * * @param allowed the new flag value. - * + * * @see #getColumnSelectionAllowed() */ void setColumnSelectionAllowed(boolean allowed); /** - * Returns <code>true</code> if column selection is allowed, and + * Returns <code>true</code> if column selection is allowed, and * <code>false</code> if column selection is not allowed. * * @return A boolean. - * + * * @see #setColumnSelectionAllowed(boolean) */ boolean getColumnSelectionAllowed(); @@ -187,29 +187,29 @@ public interface TableColumnModel /** * Returns the number of selected columns in the model. - * + * * @return The selected column count. - * + * * @see #getSelectionModel() */ int getSelectedColumnCount(); /** - * Sets the selection model that will be used to keep track of the selected + * Sets the selection model that will be used to keep track of the selected * columns. * * @param model the selection model (<code>null</code> not permitted). - * - * @throws IllegalArgumentException if <code>model</code> is + * + * @throws IllegalArgumentException if <code>model</code> is * <code>null</code>. */ void setSelectionModel(ListSelectionModel model); /** * Returns the selection model used to track table column selections. - * + * * @return The selection model. - * + * * @see #setSelectionModel(ListSelectionModel) */ ListSelectionModel getSelectionModel(); @@ -223,9 +223,9 @@ public interface TableColumnModel void addColumnModelListener(TableColumnModelListener listener); /** - * Deregisters a listener, so that it will no longer receive + * Deregisters a listener, so that it will no longer receive * {@link TableColumnModelEvent} notifications. - * + * * @param listener the listener. */ void removeColumnModelListener(TableColumnModelListener listener); diff --git a/libjava/classpath/javax/swing/table/TableModel.java b/libjava/classpath/javax/swing/table/TableModel.java index 7629fa4..d8fb713 100644 --- a/libjava/classpath/javax/swing/table/TableModel.java +++ b/libjava/classpath/javax/swing/table/TableModel.java @@ -40,48 +40,48 @@ package javax.swing.table; import javax.swing.event.TableModelListener; /** - * A <code>TableModel</code> is a two dimensional data structure that + * A <code>TableModel</code> is a two dimensional data structure that * can store arbitrary <code>Object</code> instances, usually for the - * purpose of display in a {@link javax.swing.JTable} component. Individual - * objects can be accessed by specifying the row index and column index for + * purpose of display in a {@link javax.swing.JTable} component. Individual + * objects can be accessed by specifying the row index and column index for * the object. Each column in the model has a name associated with it. * <p> * The {@link DefaultTableModel} class provides one implementation of * this interface. - * + * * @author Andrew Selkirk */ public interface TableModel { /** * Returns the number of rows in the model. - * + * * @return The row count. */ int getRowCount(); /** * Returns the number of columns in the model. - * + * * @return The column count */ int getColumnCount(); /** * Returns the name of a column in the model. - * + * * @param columnIndex the column index. - * + * * @return The column name. */ String getColumnName(int columnIndex); /** * Returns the <code>Class</code> for all <code>Object</code> instances - * in the specified column. - * + * in the specified column. + * * @param columnIndex the column index. - * + * * @return The class. */ Class<?> getColumnClass(int columnIndex); @@ -89,10 +89,10 @@ public interface TableModel /** * Returns <code>true</code> if the cell is editable, and <code>false</code> * otherwise. - * + * * @param rowIndex the row index. * @param columnIndex the column index. - * + * * @return <code>true</code> if editable, <code>false</code> otherwise. */ boolean isCellEditable(int rowIndex, int columnIndex); @@ -100,17 +100,17 @@ public interface TableModel /** * Returns the value (<code>Object</code>) at a particular cell in the * table. - * + * * @param rowIndex the row index. * @param columnIndex the column index. - * + * * @return The value at the specified cell. */ Object getValueAt(int rowIndex, int columnIndex); /** - * Sets the value at a particular cell in the table. - * + * Sets the value at a particular cell in the table. + * * @param aValue the value (<code>null</code> permitted). * @param rowIndex the row index. * @param columnIndex the column index. @@ -120,14 +120,14 @@ public interface TableModel /** * Adds a listener to the model. The listener will receive notification * of updates to the model. - * + * * @param listener the listener. */ void addTableModelListener(TableModelListener listener); /** * Removes a listener from the model. - * + * * @param listener the listener. */ void removeTableModelListener(TableModelListener listener); |