|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object javax.swing.table.AbstractTableModel org.opensourcephysics.display.ArrayTableModel
public class ArrayTableModel
A table model for a 1D and 2D ArrayTable. Column names, column locks, and transposed property added in version 1.1.
Field Summary |
---|
Fields inherited from class javax.swing.table.AbstractTableModel |
---|
listenerList |
Constructor Summary | |
---|---|
ArrayTableModel(boolean[] array)
Constructor ArrayTableModel |
|
ArrayTableModel(boolean[][] array)
Constructor ArrayTableModel |
|
ArrayTableModel(double[] array)
Constructor ArrayTableModel |
|
ArrayTableModel(double[][] array)
Constructor ArrayTableModel |
|
ArrayTableModel(int[] array)
Constructor ArrayTableModel |
|
ArrayTableModel(int[][] array)
Constructor ArrayTableModel |
|
ArrayTableModel(java.lang.String[] array)
Constructor ArrayTableModel |
|
ArrayTableModel(java.lang.String[][] array)
Constructor ArrayTableModel |
Method Summary | |
---|---|
int |
getColumnCount()
Gets the number of columns. |
java.lang.String |
getColumnName(int column)
Gets the name of the specified column. |
int |
getRowCount()
Gets the number of rows. |
java.lang.Object |
getValueAt(int row,
int column)
Gets the value at the given cell. |
boolean |
isCellEditable(int row,
int col)
Determines whether the given cell is editable. |
boolean |
isTransposed()
Returns true of the table's row and column values are interchanged. |
void |
setArray(java.lang.Object arrayObj)
Allows changing the array with minimal changes |
boolean |
setColumnLock(int columnIndex,
boolean locked)
Sets the column's lock flag. |
boolean |
setColumnLocks(boolean[] locked)
Sets the lock flag for multiple columns. |
boolean |
setColumnNames(java.lang.String[] names)
Sets columns names. |
void |
setEditable(boolean editable)
Sets the editable property. |
void |
setFirstColIndex(int index)
Sets the first column's index. |
void |
setFirstRowIndex(int index)
Sets the first row's index. |
void |
setRowNumberVisible(boolean vis)
Sets the display row number flag. |
void |
setTransposed(boolean transposed)
Sets the transposed property for the array. |
void |
setValueAt(java.lang.Object value,
int row,
int col)
Sets the value at the given cell. |
Methods inherited from class javax.swing.table.AbstractTableModel |
---|
addTableModelListener, findColumn, fireTableCellUpdated, fireTableChanged, fireTableDataChanged, fireTableRowsDeleted, fireTableRowsInserted, fireTableRowsUpdated, fireTableStructureChanged, getColumnClass, getListeners, getTableModelListeners, removeTableModelListener |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
---|
public ArrayTableModel(int[] array)
array
- public ArrayTableModel(int[][] array)
array
- public ArrayTableModel(double[] array)
array
- public ArrayTableModel(double[][] array)
array
- public ArrayTableModel(java.lang.String[] array)
array
- public ArrayTableModel(java.lang.String[][] array)
array
- public ArrayTableModel(boolean[] array)
array
- public ArrayTableModel(boolean[][] array)
array
- Method Detail |
---|
public void setArray(java.lang.Object arrayObj)
arrayObj
- public boolean setColumnLock(int columnIndex, boolean locked)
column
- intlocked
- boolean
public boolean setColumnLocks(boolean[] locked)
locked
- boolean array
public void setFirstRowIndex(int index)
index
- public void setFirstColIndex(int index)
index
- public void setRowNumberVisible(boolean vis)
vis
- true<\code> if table display row number
public void setTransposed(boolean transposed)
transposed
- public boolean isTransposed()
public void setEditable(boolean editable)
editable
- true allows editing of the cell values that are not locked.public int getColumnCount()
public boolean setColumnNames(java.lang.String[] names)
names
-
public java.lang.String getColumnName(int column)
getColumnName
in interface javax.swing.table.TableModel
getColumnName
in class javax.swing.table.AbstractTableModel
column
- the column index
public int getRowCount()
public java.lang.Object getValueAt(int row, int column)
row
- the row indexcolumn
- the column index
public void setValueAt(java.lang.Object value, int row, int col)
setValueAt
in interface javax.swing.table.TableModel
setValueAt
in class javax.swing.table.AbstractTableModel
value
- the valuerow
- the row indexcol
- the column indexpublic boolean isCellEditable(int row, int col)
isCellEditable
in interface javax.swing.table.TableModel
isCellEditable
in class javax.swing.table.AbstractTableModel
row
- the row indexcol
- the column index
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |