1 package net.sf.openrocket.gui.adaptors;
3 import javax.swing.table.TableColumnModel;
5 public abstract class Column {
6 private final String name;
9 * Create a new column with specified name. Additionally, the {@link #getValueAt(int)}
10 * method must be implemented.
12 * @param name the caption of the column.
14 public Column(String name) {
19 * Return the caption of the column.
22 public String toString() {
27 * Return the default width of the column. This is used by the method
28 * {@link #ColumnTableModel.setColumnWidth(TableColumnModel)}. The default width is
29 * 100, the method may be overridden to return other values relative to this value.
31 * @return the relative width of the column (default 100).
33 public int getDefaultWidth() {
39 * Returns the exact width of this column. If the return value is positive,
40 * both the minimum and maximum widths of this column are set to this value
42 * @return the absolute exact width of the column (default 0).
44 public int getExactWidth() {
50 * Return the column type class. This is necessary for example for numerical
51 * sorting of Value objects, showing booleans as checkboxes etc.
53 * @return the object class of this column, by default <code>Object.class</code>.
55 public Class<?> getColumnClass() {
60 * Return the value in this column at the specified row.
62 * @param row the row of the data.
63 * @return the value at the specified position.
65 public abstract Object getValueAt(int row);