SciDAVis  1.D4
Public Member Functions | Private Member Functions | Private Attributes
future::Table::Private Class Reference

#include <future_Table.h>

List of all members.

Public Member Functions

void appendColumns (QList< Column * > cols)
 Append columns to the table.
Columncolumn (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.
Tabled_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.

Detailed Description

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.


Constructor & Destructor Documentation

future::Table::Private::Private ( Table owner)
inline

Member Function Documentation

void future::Table::Private::appendColumns ( QList< Column * >  cols)

Append columns to the table.

See also:
insertColumns()

References future::Table::insertColumns().

Column * future::Table::Private::column ( int  index) const
int future::Table::Private::columnCount ( ) const
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().

int future::Table::Private::columnIndex ( const Column col) const
inline

Return the index of the given column in the table.

Returns:
the index or -1 if the column is not in the table

References d_columns.

Referenced by future::Table::columnIndex().

int future::Table::Private::columnWidth ( int  col) const
inline

References d_column_widths.

Referenced by future::Table::columnWidth().

void future::Table::Private::composeColumnHeader ( int  col,
const QString &  label 
)
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
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.

Parameters:
beforeindex of the column to insert before
colsa 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().

QString future::Table::Private::name ( ) const
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.

Parameters:
firstindex of the first column to be removed
countnumber 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.

Parameters:
firstthe first column to be replaced
new_colslist of the columns that replace the old ones This does not delete the replaced columns.

References future::Table::setRowCount().

int future::Table::Private::rowCount ( ) const
inline
void future::Table::Private::setColumnWidth ( int  col,
int  width 
)
inline
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.

Parameters:
start_colfirst column that needs to be updated
end_collast 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.

Parameters:
start_rowfirst row that needs to be updated

Member Data Documentation

int future::Table::Private::d_column_count
private

The number of columns.

Referenced by columnCount().

QList<int> future::Table::Private::d_column_widths
private

Columns widths.

Referenced by columnWidth(), and setColumnWidth().

QList<Column *> future::Table::Private::d_columns
private

List of pointers to the column data vectors.

Referenced by column(), and columnIndex().

QStringList future::Table::Private::d_horizontal_header_data
private

Horizontal header data.

Table* future::Table::Private::d_owner
private

The owner aspect.

Referenced by name().

int future::Table::Private::d_row_count
private

The maximum number of rows of all columns.

Referenced by rowCount().

QList<int> future::Table::Private::d_vertical_header_data
private

Vertical header data.


The documentation for this class was generated from the following files: