|
JClass DesktopViews 6.3.0 API Documentation |
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object | +--com.klg.jclass.table.BaseDataView | +--com.klg.jclass.table.TableDataView
The TableDataView
serves an an intermediary between the
Table
and the data source (TableData
).
Field Summary | |
protected com.klg.jclass.table.TableDataModel |
dataSource
|
protected boolean |
isEditable
|
Fields inherited from class com.klg.jclass.table.BaseDataView |
editors, renderers, table |
Constructor Summary | |
TableDataView()
Creates a TableDataView instance that initializes the editor and renderer tables but does not link it to table. |
|
TableDataView(com.klg.jclass.table.JCTable table)
Creates a TableDataView instance and initializes the editor and renderer tables |
Method Summary | |
void |
addTableDataListener(com.klg.jclass.table.JCTableDataListener l)
Adds a JCTableDataListener to this object. |
void |
dataChanged(com.klg.jclass.table.JCTableDataEvent e)
Method to change the data based on the passed in event |
void |
dispose()
Ensures that TableDataView can be disposed. |
boolean |
dragColumn(int column1,
int column2)
Drags a column to a new position. |
boolean |
dragRow(int row1,
int row2)
Drags a row to a new position. |
int[] |
getColumnMap()
Returns an array of column numbers that map view to data. |
int |
getDataColumn(int column)
Returns the data column mapped to the view column. |
int |
getDataRow(int row)
Returns the data row mapped to the view row. |
com.klg.jclass.table.TableDataModel |
getDataSource()
Returns the bound data source. |
int |
getNumColumns()
Returns the number of columns of data the data source contains. |
int |
getNumRows()
Returns the number of rows of data the data source contains. |
Object |
getObject(int row,
int column)
Returns the object given a row or column. |
int[] |
getRowMap()
Returns an array of row numbers that map view to data. |
Object |
getTableColumnLabel(int column)
Returns the value for the column label at the specified column. |
Object |
getTableDataItem(int row,
int column)
Returns the value for the cell at the specified location. |
Object |
getTableRowLabel(int row)
Returns the value for the row label at the specified row. |
int |
getViewColumn(int column)
Returns the column in the view for the data column. |
int |
getViewRow(int row)
Returns the row in the view for the data row. |
boolean |
isEditable()
Returns true if the data source implements EditableTableData. |
protected int[] |
removeMapElement(int[] array,
int element)
Removes an element from the map array. |
void |
removeTableDataListener(com.klg.jclass.table.JCTableDataListener l)
Removes a JCTableDataListener from this object |
protected void |
repaintRange(int start_row,
int start_column,
int end_row,
int end_column)
Issues a range repaint. |
void |
resetColumnMap()
Reset the mapped columns array to a one-to-one mapping. |
void |
resetRowMap()
Reset the mapped rows array to a one-to-one mapping. |
protected void |
resizeColumnMap()
Initializes the mapped columns array any time it is accessed and the number of columns in the datasource does not match the number of columns in the map array. |
protected void |
resizeRowMap()
Initializes the mapped rows array any time it is accessed and the number of rows in the datasource does not match the number of rows in the map array. |
boolean |
setColumnMap(int[] new_map)
Sets a new column map array. |
void |
setDataSource(com.klg.jclass.table.TableDataModel tableData)
Sets the bound data source. |
boolean |
setRowMap(int[] new_map)
Sets a new row map array. |
boolean |
setTableDataItem(Object o,
int row,
int column)
Sets the cell value for editable data sources. |
protected int[] |
shiftMappedArray(int[] array,
int item1,
int item2)
Repositions a row or column to a new location in the mapped array. |
boolean |
swapColumns(int column1,
int column2)
Swaps two columns. |
boolean |
swapRows(int row1,
int row2)
Swaps two rows. |
Methods inherited from class com.klg.jclass.table.BaseDataView |
getCellEditor, getCellEditor, getCellEditor, getCellRenderer, getCellRenderer, getCellRenderer, getCellRenderer, getEditorsTable, getRenderersTable, getTable, loadFieldEditors, loadFieldRenderers, setEditorsTable, setRenderersTable, setTable |
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Methods inherited from interface com.klg.jclass.table.DataViewModel |
getCellEditor, getCellEditor, getCellRenderer, getCellRenderer, getCellRenderer, getEditorsTable, getRenderersTable, getTable, setEditorsTable, setRenderersTable, setTable |
Field Detail |
protected com.klg.jclass.table.TableDataModel dataSource
protected boolean isEditable
Constructor Detail |
public TableDataView()
public TableDataView(com.klg.jclass.table.JCTable table)
table
- The table controlled by this DataView.Method Detail |
public void dataChanged(com.klg.jclass.table.JCTableDataEvent e)
dataChanged
in interface JCTableDataListener
dataChanged
in class BaseDataView
e
- The event used to change the datapublic com.klg.jclass.table.TableDataModel getDataSource()
getDataSource
in interface DataViewModel
getDataSource
in class BaseDataView
public void setDataSource(com.klg.jclass.table.TableDataModel tableData)
setDataSource
in interface DataViewModel
setDataSource
in class BaseDataView
tableData
- The new bound data sourcepublic boolean isEditable()
isEditable
in interface DataViewModel
isEditable
in class BaseDataView
public Object getObject(int row, int column)
getObject
in interface DataViewModel
getObject
in class BaseDataView
row
- The row indexcolumn
- The column index
public boolean setTableDataItem(Object o, int row, int column)
setTableDataItem
in interface DataViewModel
setTableDataItem
in class BaseDataView
o
- The new cell valuerow
- The row indexcolumn
- The column index
public Object getTableDataItem(int row, int column)
getTableDataItem
in interface JCTableDataModel
getTableDataItem
in class BaseDataView
row
- The row indexcolumn
- The column index
public int getNumRows()
getNumRows
in interface JCTableDataModel
public int getNumColumns()
getNumColumns
in interface JCTableDataModel
public Object getTableRowLabel(int row)
getTableRowLabel
in interface JCTableDataModel
getTableRowLabel
in class BaseDataView
row
- The row index
public Object getTableColumnLabel(int column)
getTableColumnLabel
in interface JCTableDataModel
getTableColumnLabel
in class BaseDataView
column
- The column index
public void addTableDataListener(com.klg.jclass.table.JCTableDataListener l)
JCTableDataListener
to this object.
addTableDataListener
in interface TableDataModel
l
- The table data listenere to be addedJCTableDataListener
,
JCTableDataEvent
public void removeTableDataListener(com.klg.jclass.table.JCTableDataListener l)
JCTableDataListener
from this object
removeTableDataListener
in interface TableDataModel
l
- The table data listenere to be removedJCTableDataListener
,
JCTableDataEvent
public int[] getColumnMap()
getColumnMap
in interface SortableDataViewModel
public int[] getRowMap()
getRowMap
in interface SortableDataViewModel
public int getDataColumn(int column)
getDataColumn
in interface SortableDataViewModel
column
- The column number in the view
public int getDataRow(int row)
getDataRow
in interface SortableDataViewModel
row
- The row number in the view
public int getViewColumn(int column)
getViewColumn
in interface SortableDataViewModel
column
- The column number in the datasource
public int getViewRow(int row)
getViewRow
in interface SortableDataViewModel
row
- The row number in the datasource
protected void resizeColumnMap()
protected void resizeRowMap()
public void resetColumnMap()
resetColumnMap
in interface SortableDataViewModel
public void resetRowMap()
resetRowMap
in interface SortableDataViewModel
protected int[] shiftMappedArray(int[] array, int item1, int item2)
array
- The input array of row or column indicesitem1
- The current position of the row/column to be moveditem2
- The destination of the row/column
protected int[] removeMapElement(int[] array, int element)
array
- The input array of row or column indiceselement
- The element to be removed
public boolean swapColumns(int column1, int column2)
swapColumns
in interface SortableDataViewModel
column1
- The view index of the first column to be swappedcolumn2
- The view index of the second column to be swapped
public boolean swapRows(int row1, int row2)
swapRows
in interface SortableDataViewModel
row1
- The view index of the first row to be swappedrow2
- The view index of the second row to be swapped
public boolean setColumnMap(int[] new_map)
setColumnMap
in interface SortableDataViewModel
new_map
- Integer array where initial unsorted new_map resides
public boolean setRowMap(int[] new_map)
setRowMap
in interface SortableDataViewModel
new_map
- Integer array where initial unsorted new_map resides
public boolean dragColumn(int column1, int column2)
dragColumn
in interface SortableDataViewModel
column1
- Current index of column to be draggedcolumn2
- Index where dragged column is to be placed
public boolean dragRow(int row1, int row2)
dragRow
in interface SortableDataViewModel
row1
- Current index of row to be draggedrow2
- Index where dragged row is to be placed
protected void repaintRange(int start_row, int start_column, int end_row, int end_column)
start_row
- The starting row of the range to be repaintedstart_column
- The starting column of the range to be repaintedend_row
- The ending row of the range to be repaintedend_column
- The ending column of the range to be repaintedpublic void dispose()
|
Copyright © 2004 Quest Software Inc.. All rights reserved. |
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |