|
Diamond Control Suite 3.0 | ||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectdiamondedge.swing.grid.TableModelFormat
public class TableModelFormat
This class allows a mapping to be specified between the actual data value in the cell and a set of values. The actual value in the grid will correspond to the value in the TableModel for the selected row and the BoundColumn. The value displayed in the grid will correspond to the value in the TableModel for the selected row and the TextColumn. When editing in a DsGrid, a multi-column drop-down ComboBox will be used as the editor.
Constructor Summary | |
---|---|
TableModelFormat()
|
Method Summary | |
---|---|
int |
getBoundColumn()
Determines the column used as the data value. |
int |
getColumnCount()
Returns the number of columns in the table. |
Object |
getDataValue(int row)
Returns the value for the bound column at specified row. |
int |
getIndexOf(Object dataValue)
Returns the row index for the given data value. |
TableModel |
getModel()
Returns the TableModel used to supply all data values. |
int |
getRowCount()
Returns the number of rows in the table. |
int |
getTextColumn()
Determines the column used as the value for the Text. |
Object |
getTextValue(int row)
Returns the value for the display column at specified row. |
Object |
getValueAt(int rowIndex,
int columnIndex)
Returns the value for the cell at columnIndex and
rowIndex . |
boolean |
isBoundColumnVisible()
Determines whether the column used as the data value is visible. |
void |
loadTextData(Reader reader,
int begRow,
int begCol,
int endRow,
int endCol,
boolean firstRowIsColHeader,
char delim,
boolean stripStringDelim,
boolean convertData)
Load data from a text stream. |
void |
setBoundColumn(int val)
Determines the column used as the data value. |
void |
setBoundColumnVisible(boolean showBoundColumn)
Determines whether the column used as the data value is visible. |
void |
setModel(TableModel dataModel)
Sets the TableModel used to supply all data values. |
void |
setTextColumn(int val)
Determines the column used as the value for the Text property which is diplayed in the text area of the ComboBox. |
void |
setValueAt(Object aValue,
int rowIndex,
int columnIndex)
Sets the value in the cell at columnIndex and
rowIndex to aValue . |
void |
tableChanged(TableModelEvent e)
|
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
---|
public TableModelFormat()
Method Detail |
---|
public TableModel getModel()
public void setModel(TableModel dataModel)
public void loadTextData(Reader reader, int begRow, int begCol, int endRow, int endCol, boolean firstRowIsColHeader, char delim, boolean stripStringDelim, boolean convertData) throws IOException, ArrayIndexOutOfBoundsException
reader
- stream that provides the databegRow
- row position in model to begin placing databegCol
- column position in model to begin placing dataendRow
- ending row position in model to stop setting data. -1 means to load all data.endCol
- ending column position in model to stop setting data. -1 means to load all columns up to model.getColumnCount.firstRowIsColHeader
- the first row is used to set the column headersdelim
- delimeter used to separate values. Pass in '\t' for tab delimeted and ',' for csv.stripStringDelim
- removes the " at the beginning and end of stringsconvertData
- attempt to parse the values into a Number, Boolean, Date in that order
IOException
ArrayIndexOutOfBoundsException
public void tableChanged(TableModelEvent e)
tableChanged
in interface TableModelListener
public boolean isBoundColumnVisible()
public void setBoundColumnVisible(boolean showBoundColumn)
public int getBoundColumn()
public void setBoundColumn(int val)
public int getTextColumn()
public void setTextColumn(int val)
public Object getDataValue(int row)
getDataValue
in interface TableFormat
public Object getTextValue(int row)
getTextValue
in interface TableFormat
public int getIndexOf(Object dataValue)
getIndexOf
in interface TableFormat
public int getRowCount()
getRowCount
in interface TableFormat
public int getColumnCount()
getColumnCount
in interface TableFormat
public Object getValueAt(int rowIndex, int columnIndex)
columnIndex
and
rowIndex
.
getValueAt
in interface TableFormat
public void setValueAt(Object aValue, int rowIndex, int columnIndex)
columnIndex
and
rowIndex
to aValue
.
setValueAt
in interface TableFormat
|
Diamond Control Suite 3.0 | ||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |