SciDAVis
1.D4
|
#include <future_Table.h>
Public Member Functions | |
void | appendColumns (QList< Column * > cols) |
Append columns to the table. | |
Column * | column (int index) const |
Return column number 'index'. | |
int | columnCount () const |
Return the number of columns in the table. | |
QString | columnHeader (int col) |
Return the full column header string. | |
int | columnIndex (const Column *col) const |
Return the index of the given column in the table. | |
int | columnWidth (int col) const |
QVariant | headerData (int section, Qt::Orientation orientation, int role) const |
void | insertColumns (int before, QList< Column * > cols) |
Insert columns before column number 'before'. | |
void | moveColumn (int from, int to) |
Move a column to another position. | |
QString | name () const |
int | numColsWithPD (SciDAVis::PlotDesignation pd) |
Return the number of columns with a given plot designation. | |
Private (Table *owner) | |
void | removeColumns (int first, int count) |
Remove Columns. | |
void | replaceColumns (int first, QList< Column * > new_cols) |
Replace columns completely. | |
int | rowCount () const |
Return the number of rows in the table. | |
void | setColumnWidth (int col, int width) |
void | setRowCount (int count) |
Set the number of rows of the table. | |
void | updateHorizontalHeader (int start_col, int end_col) |
Update the horizontal header labels. | |
void | updateVerticalHeader (int start_row) |
Update the vertical header labels. |
Private Member Functions | |
void | composeColumnHeader (int col, const QString &label) |
Internal function to put together the column header. |
Private Attributes | |
int | d_column_count |
The number of columns. | |
QList< int > | d_column_widths |
Columns widths. | |
QList< Column * > | d_columns |
List of pointers to the column data vectors. | |
QStringList | d_horizontal_header_data |
Horizontal header data. | |
Table * | d_owner |
The owner aspect. | |
int | d_row_count |
The maximum number of rows of all columns. | |
QList< int > | d_vertical_header_data |
Vertical header data. |
This private class manages column based data (i.e., 1D vector based data such as x-values and y-values for a plot) for a Table. Its API is to be called by Table and table commands only. Table may only call the reading functions to ensure that undo/redo is possible for all data changing operations.
Each column is represented by a Column object and can be directly accessed by the pointer returned by column(). Most of the column manipulation is done directly to the columns. The signals of the columns are connected to various handlers in Table which acts according to all changes made to the columns.
The Column objects are managed as child aspects by Table.
Every column has two filters as children: An input filter that can convert a string (e.g., entered by the user in a cell) to the column's data type and an output filter that delivers the correct string representation to display in a table.
The number of columns in the Table will always be equal to d_columns.size(). The number of rows is generally indepenent of the number of rows in the wrapped columns. It is however always adjusted to be large enough to display the longest column. When columns are inserted, resized etc., the table is resized automatically.
|
inline |
void future::Table::Private::appendColumns | ( | QList< Column * > | cols | ) |
Column * future::Table::Private::column | ( | int | index | ) | const |
Return column number 'index'.
References d_columns.
Referenced by future::Table::column(), future::Table::insertRows(), future::Table::moveColumn(), future::Table::pasteIntoSelection(), future::Table::removeColumns(), future::Table::removeRows(), future::Table::setRowCount(), and TableMoveColumnCmd::TableMoveColumnCmd().
|
inline |
Return the number of columns in the table.
References d_column_count.
Referenced by future::Table::columnCount(), future::Table::insertRows(), future::Table::removeRows(), and future::Table::setRowCount().
QString future::Table::Private::columnHeader | ( | int | col | ) |
Return the full column header string.
References future::Table::headerData().
|
inline |
Return the index of the given column in the table.
References d_columns.
Referenced by future::Table::columnIndex().
|
inline |
References d_column_widths.
Referenced by future::Table::columnWidth().
|
private |
Internal function to put together the column header.
Don't use this outside updateHorizontalHeader()
QVariant future::Table::Private::headerData | ( | int | section, |
Qt::Orientation | orientation, | ||
int | role | ||
) | const |
References TableModel::CommentRole.
Referenced by future::Table::headerData().
void future::Table::Private::insertColumns | ( | int | before, |
QList< Column * > | cols | ||
) |
Insert columns before column number 'before'.
If 'first' is equal to the number of columns, the columns will be appended.
before | index of the column to insert before |
cols | a list of column data objects |
References future::Table::defaultColumnWidth(), and future::Table::setRowCount().
Referenced by TableInsertColumnsCmd::redo(), and TableRemoveColumnsCmd::undo().
void future::Table::Private::moveColumn | ( | int | from, |
int | to | ||
) |
Move a column to another position.
Referenced by TableMoveColumnCmd::redo(), and TableMoveColumnCmd::undo().
|
inline |
int future::Table::Private::numColsWithPD | ( | SciDAVis::PlotDesignation | pd | ) |
Return the number of columns with a given plot designation.
void future::Table::Private::removeColumns | ( | int | first, |
int | count | ||
) |
Remove Columns.
This does not delete the removed columns because this must be handled by the undo/redo system.
first | index of the first column to be removed |
count | number of columns to remove |
Referenced by TableRemoveColumnsCmd::redo(), and TableInsertColumnsCmd::undo().
void future::Table::Private::replaceColumns | ( | int | first, |
QList< Column * > | new_cols | ||
) |
Replace columns completely.
first | the first column to be replaced |
new_cols | list of the columns that replace the old ones This does not delete the replaced columns. |
References future::Table::setRowCount().
|
inline |
Return the number of rows in the table.
References d_row_count.
Referenced by TableInsertColumnsCmd::redo(), TableSetNumberOfRowsCmd::redo(), future::Table::removeRows(), future::Table::rowCount(), and future::Table::setRowCount().
|
inline |
References d_column_widths.
Referenced by future::Table::setColumnWidth().
void future::Table::Private::setRowCount | ( | int | count | ) |
Set the number of rows of the table.
Referenced by TableSetNumberOfRowsCmd::redo(), TableInsertColumnsCmd::undo(), and TableSetNumberOfRowsCmd::undo().
void future::Table::Private::updateHorizontalHeader | ( | int | start_col, |
int | end_col | ||
) |
Update the horizontal header labels.
This must be called whenever columns are added or removed and when comments, labels, and column types change.
start_col | first column that needs to be updated |
end_col | last column that needs to be updated |
References SciDAVis::X, SciDAVis::xErr, SciDAVis::Y, SciDAVis::yErr, and SciDAVis::Z.
Referenced by future::Table::handleDescriptionChange(), future::Table::handleModeChange(), and future::Table::handlePlotDesignationChange().
void future::Table::Private::updateVerticalHeader | ( | int | start_row | ) |
Update the vertical header labels.
This must be called whenever rows are added or removed.
start_row | first row that needs to be updated |
|
private |
The number of columns.
Referenced by columnCount().
|
private |
Columns widths.
Referenced by columnWidth(), and setColumnWidth().
|
private |
List of pointers to the column data vectors.
Referenced by column(), and columnIndex().
|
private |
Horizontal header data.
|
private |
The maximum number of rows of all columns.
Referenced by rowCount().
|
private |
Vertical header data.