|
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.data.AbstractDataSource | +--com.klg.jclass.table.data.AbstractVectorDataSource | +--com.klg.jclass.table.data.JCVectorDataSource
JCVectorDataSource
is the main data source of
JCTable
from which most other datasources are derived. It stores
label and cell values in a Vector of Vectors and provides a range of methods
for getting and setting the cell values.
Field Summary | |
protected Vector |
cells
|
protected Vector |
column_labels
|
protected int |
columns
|
protected boolean |
is_moving
|
protected Vector |
row_labels
|
protected int |
rows
|
Fields inherited from class com.klg.jclass.table.data.AbstractDataSource |
listeners |
Constructor Summary | |
JCVectorDataSource()
Creates a new JCVectorDataSource instance. |
|
JCVectorDataSource(int r,
int c,
Vector rowLabels,
Vector columnLabels,
Vector data)
Creates a new JCVectorDataSource instance. |
Method Summary | |
boolean |
addColumn(int position,
Object label,
Vector values)
Inserts a new column into the data source, shifting any cell values to the right of the insertion. |
protected boolean |
addColumn(int position,
Object label,
Vector values,
boolean shift_labels)
|
boolean |
addRow(int position,
Object label,
Vector values)
Inserts a new row into the data source, shifting any cell values below the insertion. |
protected boolean |
addRow(int position,
Object label,
Vector values,
boolean shift_labels)
|
void |
clearCells()
Clears the values of all cells by setting them to null. |
boolean |
deleteColumns(int position,
int num_columns)
Deletes columns from the data source. |
protected boolean |
deleteColumns(int position,
int num_columns,
boolean shift_labels)
|
boolean |
deleteRows(int position,
int num_rows)
Deletes rows from the data source. |
protected boolean |
deleteRows(int position,
int num_rows,
boolean shift_labels)
|
Vector |
getCells()
Returns the internal cell values of the table. |
Vector |
getColumnLabels()
Gets the data source's ColumnLabels value. |
protected Object |
getLabelValue(int row,
int column)
Private method gets the label value. |
int |
getNumColumns()
Gets the number of columns in the table from the data source's NumColumns value. |
int |
getNumRows()
Gets the number of rows in the table by retrieving the value of the data source's NumRows property. |
Vector |
getRowLabels()
Gets the data source's RowLabels value. |
Object |
getTableColumnLabel(int column)
Gets the label of a given column in the data source. |
Object |
getTableDataItem(int row,
int column)
Returns the value for the cell at the specified location. |
Object |
getTableRowLabel(int row)
Gets the label of a given row in the data source. |
static boolean |
isCell(int row,
int column)
Returns true if the row and column constitute a valid cell. |
static boolean |
isColumnLabel(int row,
int column)
Returns true if the row and column constitute a valid column
label. |
static boolean |
isLabel(int row,
int column)
Returns true if the row and column constitute a valid label. |
static boolean |
isRowLabel(int row,
int column)
Returns true if the row and column constitute a valid row label. |
boolean |
isValidCell(int row,
int column)
Returns true if the row and column constitute a valid cell. |
boolean |
isValidLabel(int r,
int c)
Returns true if the row and column constitute a valid label. |
boolean |
moveColumns(int source,
int num_columns,
int destination)
Moves a range of columns in the data source. |
protected boolean |
moveColumns(int source,
int num_columns,
int destination,
boolean shift_labels)
|
boolean |
moveRows(int source,
int num_rows,
int destination)
Moves a range of rows. |
protected boolean |
moveRows(int source,
int num_rows,
int destination,
boolean shift_labels)
|
void |
setCell(int row,
int column,
Object v)
Sets the value of a cell. |
void |
setCells(String[][] v)
Sets the cell values as a matrix of Strings. |
void |
setCells(Vector v)
Sets the cell values as a Vector of Vectors. |
void |
setColumnLabel(int column,
Object value)
Specifies the contents of a column label in the data source. |
void |
setColumnLabels(String[] labels)
Sets the column labels as an array of Strings. |
void |
setColumnLabels(Vector labels)
Sets the column labels as a Vector. |
void |
setDataChanged(int row,
int column,
int num_affected,
int destination,
int command)
Notifies all registered TableDataListeners
of a data source change. |
protected void |
setLabelValue(int row,
int column,
Object value)
Private method sets the label value. |
void |
setNumColumns(int value)
Sets the current number of columns in the data source (default is 5). |
void |
setNumRows(int value)
Sets the current number of rows in the data source (default is 10). |
void |
setRowLabel(int row,
Object value)
Specifies the contents a row label in the data source. |
void |
setRowLabels(String[] labels)
Sets the row labels as an array of Strings. |
void |
setRowLabels(Vector labels)
Sets the row labels as a Vector. |
Methods inherited from class com.klg.jclass.table.data.AbstractVectorDataSource |
createVector, createVector, createVector, createVector, createVector, removeElementsAt, setElementAt, strip |
Methods inherited from class com.klg.jclass.table.data.AbstractDataSource |
addTableDataListener, dispose, fireColumnChanged, fireColumnLabelChanged, fireColumnsAdded, fireColumnsDeleted, fireColumnsMoved, fireDataReset, fireNumColumnsChanged, fireNumRowsChanged, fireRowChanged, fireRowDeleted, fireRowLabelChanged, fireRowsAdded, fireRowsMoved, fireTableDataEvent, fireValueChanged, hasListeners, removeTableDataListener |
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
protected Vector cells
protected Vector column_labels
protected Vector row_labels
protected int columns
protected int rows
protected boolean is_moving
Constructor Detail |
public JCVectorDataSource()
JCVectorDataSource
instance.
public JCVectorDataSource(int r, int c, Vector rowLabels, Vector columnLabels, Vector data)
JCVectorDataSource
instance.
c
- columnLabels
- data
- r
- rowLabels
- Method Detail |
public int getNumColumns()
NumColumns
value.
getNumColumns
in interface JCTableDataModel
setNumColumns(int)
public void setNumColumns(int value)
CellValues
vector.
The addColumn()
and deleteColumns()
methods update
this property by the number of columns added/deleted.
If set to zero, no cells are displayed.
value
- public int getNumRows()
NumRows
property.
getNumRows
in interface JCTableDataModel
setNumRows(int)
public void setNumRows(int value)
CellValues
vector.
The addRow()
and deleteRow()
methods update
this property by the number of rows added/deleted.
If set to zero, no cells are displayed.
value
- public Object getTableColumnLabel(int column)
getTableColumnLabel
in interface JCTableDataModel
column
-
setColumnLabel(int, java.lang.Object)
public Object getTableRowLabel(int row)
getTableRowLabel
in interface JCTableDataModel
row
-
setRowLabel(int, java.lang.Object)
public Object getTableDataItem(int row, int column)
getTableDataItem
in interface JCTableDataModel
column
- row
-
public void clearCells()
setCells(java.lang.String[][])
public Vector getCells()
setCells(java.lang.String[][])
public Vector getColumnLabels()
ColumnLabels
value.
setColumnLabels(java.lang.String[])
public Vector getRowLabels()
RowLabels
value.
setRowLabels(java.lang.String[])
public static final boolean isCell(int row, int column)
true
if the row and column constitute a valid cell.
row
- The row indexcolumn
- The column index
true
if the row and column constiture a valid cellpublic static final boolean isColumnLabel(int row, int column)
true
if the row and column constitute a valid column
label.
row
- The row indexcolumn
- The column index
true
if the row and column constitute a valid column
levelpublic static final boolean isLabel(int row, int column)
true
if the row and column constitute a valid label.
row
- The row indexcolumn
- The column index
true
if the row and column constitute a valid labelpublic static final boolean isRowLabel(int row, int column)
true
if the row and column constitute a valid row label.
row
- The row indexcolumn
- The column index
true
if the row and column constitute a valid row labelpublic final boolean isValidCell(int row, int column)
true
if the row and column constitute a valid cell.
row
- The row indexcolumn
- The column index
true
if the row and column constitute a valid cellpublic final boolean isValidLabel(int r, int c)
true
if the row and column constitute a valid label.
r
- The row indexc
- The column index
true
if the row and column constitute a valid labelpublic void setColumnLabel(int column, Object value)
column
- value
- public void setColumnLabels(String[] labels)
labels
- public void setColumnLabels(Vector labels)
labels
- public void setRowLabel(int row, Object value)
row
- value
- public void setRowLabels(String[] labels)
labels
- public void setRowLabels(Vector labels)
labels
- public void setCell(int row, int column, Object v)
column
- row
- v
- public void setCells(String[][] v)
clearCells()
.
v
- clearCells()
public void setCells(Vector v)
clearCells()
.
v
- protected Object getLabelValue(int row, int column)
column
- row
-
protected void setLabelValue(int row, int column, Object value)
column
- row
- value
- public void setDataChanged(int row, int column, int num_affected, int destination, int command)
TableDataListeners
of a data source change.
column
- command
- destination
- num_affected
- row
- public boolean addColumn(int position, Object label, Vector values)
position
- this is the column index before which to add the new column
(if set to JCTableEnum.MAXINT
, the column is added after the
last column)label
- this is the column label (can be null)values
- an array of objects to be inserted (can be null)
false
if any argument is invalidprotected boolean addColumn(int position, Object label, Vector values, boolean shift_labels)
public boolean addRow(int position, Object label, Vector values)
JCLabelValueListener
has been registered.
position
- this is the row index before which to add the new row (if
set to JCTableEnum.MAXINT
, the row is added after the last row)label
- this is the row label (can be null)values
- an array of objects to be inserted (can be null)
false
if any argument is invalidprotected boolean addRow(int position, Object label, Vector values, boolean shift_labels)
public boolean deleteColumns(int position, int num_columns)
JCLabelValueListener
has been registered.
position
- this is the first column number to deletenum_columns
- this is the number of columns to be deleted
false
if any argument is invalidprotected boolean deleteColumns(int position, int num_columns, boolean shift_labels)
public boolean deleteRows(int position, int num_rows)
JCLabelValueListener
has been registered.
position
- this is the first row number to deletenum_rows
- this is the number of rows to be deleted
false
if any argument is invalidprotected boolean deleteRows(int position, int num_rows, boolean shift_labels)
public boolean moveColumns(int source, int num_columns, int destination)
JCLabelValueListener
has been registered.
source
- this is the first column in the rangenum_columns
- this is the number of columns to movedestination
- this is the column number before which to insert the moved
columns
false
if any argument is invalidprotected boolean moveColumns(int source, int num_columns, int destination, boolean shift_labels)
public boolean moveRows(int source, int num_rows, int destination)
JCLabelValueListener
has been registered.
source
- this is the first row in the rangenum_rows
- this is the number of rows to movedestination
- this is the row number before which to insert the moved
rows
false
if any argument is invalidprotected boolean moveRows(int source, int num_rows, int destination, boolean shift_labels)
|
Copyright © 2004 Quest Software Inc.. All rights reserved. |
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |