SciDAVis  1.D4
Public Types | Public Slots | Public Member Functions | Protected Member Functions | Private Attributes
TableStatistics Class Reference

Table that computes and displays statistics on another Table. More...

#include <TableStatistics.h>

Inheritance diagram for TableStatistics:
Table TableView scripted MyWidget

List of all members.

Public Types

enum  Type { StatRow, StatColumn }
 supported statistics types More...
- Public Types inherited from Table
enum  ColType {
  Numeric = 0, Text = 1, Date = 2, Time = 3,
  Month = 4, Day = 5, DateTime = 6

Public Slots

void removeCol (const QString &)
 remove statistics of removed columns (to be connected with Table::removedCol)
void renameCol (const QString &, const QString &)
 handle renaming of columns (to be connected with Table::changedColHeader)
void update (Table *, const QString &colName)
 update statistics after a column has changed (to be connected with Table::modifiedData)
- Public Slots inherited from Table
double cell (int row, int col)
 Return the value of the cell as a double.
void clearCell (int row, int col)
QString colComment (int col)
QStringList colComments ()
int colIndex (const QString &name)
QString colLabel (int col)
QString colName (int col)
QStringList colNames ()
SciDAVis::PlotDesignation colPlotDesignation (int col)
Columncolumn (int index) const
 Return column number 'index'.
Columncolumn (const QString &name) const
 Return the column determined by the given name.
int columnCount ()
QString columnFormat (int col)
QStringList columnsList ()
int columnType (int col)
QList< int > columnTypes ()
int columnWidth (int col)
int colX (int col)
int colY (int col)
bool commentsEnabled ()
void copy (Table *m)
void customEvent (QEvent *e)
QStringList drawableColumnSelection ()
bool exportASCII (const QString &fname, const QString &separator, bool withLabels=false, bool exportSelection=false)
void exportPDF (const QString &fileName)
int firstXCol ()
void handleChange ()
void handleColumnChange (int, int)
void handleColumnChange (int, int, int, int)
void handleColumnsAboutToBeRemoved (int, int)
void handleColumnsRemoved (int, int)
void handleRowChange ()
void importASCII (const QString &fname, const QString &sep, int ignoredLines, bool renameCols, bool stripSpaces, bool simplifySpaces, bool newTable)
void importV0x0001XXHeader (QStringList header)
void init ()
bool noXColumn ()
bool noYColumn ()
int numCols ()
int numRows ()
int numSelectedRows ()
QList< int > plotDesignations ()
void print ()
void print (const QString &fileName)
bool recalculate (int col, bool only_selected_rows=true)
 Compute cells from the cell formulas.
bool recalculate ()
 Recalculate selected cells.
void restore (const QStringList &lst)
 Not implemented yet.
int rowCount ()
QString saveAsTemplate (const QString &geometryInfo)
int selectedColsNumber ()
QStringList selectedColumns ()
QStringList selectedErrColumns ()
QStringList selectedYColumns ()
QMap< int, QString > selectedYLabels ()
void setBackgroundColor (const QColor &col)
void setCell (int row, int col, double val)
void setColComment (int col, const QString &s)
void setColComments (const QStringList &lst)
void setColName (int col, const QString &text)
void setColPlotDesignation (int col, SciDAVis::PlotDesignation d)
void setColumnType (int col, SciDAVis::ColumnMode mode)
void setColumnTypes (QList< int > ctl)
void setColumnTypes (const QStringList &ctl)
void setColWidths (const QStringList &widths)
void setCommand (int col, const QString &com)
 Set formula for column col.
void setCommands (const QStringList &com)
 Set all column formulae.
void setCommands (const QString &com)
 Set all column formulae.
void setHeader (QStringList header)
void setHeaderColor (const QColor &col)
void setHeaderFont (const QFont &fnt)
void setNumCols (int cols)
void setNumRows (int rows)
void setPlotDesignation (SciDAVis::PlotDesignation pd)
void setText (int row, int col, const QString &text)
void setTextColor (const QColor &col)
void setTextFont (const QFont &fnt)
QString text (int row, int col)
int verticalHeaderWidth ()
QStringList YColumns ()
void removeCol ()
void removeCol (const QStringList &list)
void clearCol ()
void insertCol ()
void insertCols (int start, int count)
void addCol (SciDAVis::PlotDesignation pd=SciDAVis::Y)
void addColumns (int c)
void deleteSelectedRows ()
void insertRow ()
void cutSelection ()
 Selection Operations.
void copySelection ()
void clearSelection ()
void pasteSelection ()
void selectAllTable ()
void deselect ()
void clear ()
void saveToDevice (QIODevice *device, const QString &geometry)
QString saveHeader ()
QString saveComments ()
QString saveCommands ()
QString saveColumnWidths ()
QString saveColumnTypes ()
- Public Slots inherited from TableView
void activateFormulaMode (bool on)
void deselectAll ()
void goToCell (int row, int col)
void goToNextColumn ()
void goToPreviousColumn ()
void handleHorizontalSectionResized (int logicalIndex, int oldSize, int newSize)
void rereadSectionSizes ()
void selectAll ()
void showControlDescriptionTab ()
void showControlFormulaTab ()
void showControlTypeTab ()
void toggleComments ()
void toggleControlTabBar ()

Public Member Functions

Tablebase () const
 return the base table of which statistics are displayed
virtual QString saveToString (const QString &geometry)
 TableStatistics (ScriptingEnv *env, QWidget *parent, Table *base, Type, QList< int > targets)
Type type () const
 return the type of statistics
- Public Member Functions inherited from Table
void closeEvent (QCloseEvent *)
 Close event handler.
virtual QString name ()
 Return the window name.
virtual void setBirthDate (const QString &s)
 Set the creation date.
void setCaptionPolicy (CaptionPolicy policy)
 Set the caption policy.
virtual void setName (const QString &s)
 Set the window name.
void setNumericPrecision (int prec)
 Sets the number of significant digits.
virtual void setWindowLabel (const QString &s)
 Set the window label.
 Table (ScriptingEnv *env, const QString &fname, const QString &sep, int ignoredLines, bool renameCols, bool stripSpaces, bool simplifySpaces, bool convertToNumeric, QLocale numericFormat, const QString &label, QWidget *parent=0, const char *name=0, Qt::WFlags f=0)
 Table (ScriptingEnv *env, int r, int c, const QString &label, QWidget *parent=0, const char *name=0, Qt::WFlags f=0)
virtual QString windowLabel ()
 Return the window label.
- Public Member Functions inherited from TableView
bool areCommentsShown () const
 Return whether comments are show currently.
int columnWidth (int col) const
bool formulaModeActive () const
bool isControlTabBarVisible ()
void setColumnWidth (int col, int width)
void showComments (bool on=true)
 Show or hide (if on = false) the column comments.
 TableView (future::Table *table)
virtual ~TableView ()
int selectedColumnCount (bool full=false)
 Return how many columns are selected.
int selectedColumnCount (SciDAVis::PlotDesignation pd)
 Return how many columns with the given plot designation are (at least partly) selected.
bool isColumnSelected (int col, bool full=false)
 Returns true if column 'col' is selected; otherwise false.
QList< Column * > selectedColumns (bool full=false)
 Return all selected columns.
int selectedRowCount (bool full=false)
 Return how many rows are (at least partly) selected.
bool isRowSelected (int row, bool full=false)
 Returns true if row 'row' is selected; otherwise false.
int firstSelectedColumn (bool full=false)
 Return the index of the first selected column.
int lastSelectedColumn (bool full=false)
 Return the index of the last selected column.
int firstSelectedRow (bool full=false)
 Return the index of the first selected row.
int lastSelectedRow (bool full=false)
 Return the index of the last selected row.
IntervalAttribute< bool > selectedRows (bool full=false)
 Get the complete set of selected rows.
bool isCellSelected (int row, int col)
 Return whether a cell is selected.
void setCellSelected (int row, int col, bool select=true)
 Select/Deselect a cell.
void setCellsSelected (int first_row, int first_col, int last_row, int last_col, bool select=true)
 Select/Deselect a range of cells.
void getCurrentCell (int *row, int *col)
 Determine the current cell (-1 if no cell is designated as the current)
- Public Member Functions inherited from MyWidget
void askOnCloseEvent (bool ask)
 Toggle the "ask on close" flag.
QString aspect ()
 Return the window status as a string.
virtual QString birthDate ()
 Return the creation date.
virtual CaptionPolicy captionPolicy ()
 Return the caption policy.
Folderfolder ()
 Returns the pointer to the parent folder of the window.
 MyWidget (const QString &label=QString(), QWidget *parent=0, const QString name=0, Qt::WFlags f=0)
void notifyChanges ()
 Notifies the main application that the window has been modified.
void setFolder (Folder *f)
 Initializes the pointer to the parent folder of the window.
virtual void setHidden ()
 Notifies that a window was hidden by a direct user action.
void setMaximized ()
void setMinimized ()
void setNormal ()
void setStatus (Status s)
 Set the window status flag (hidden, normal, minimized or maximized)
Status status ()
 Return the window status flag (hidden, normal, minimized or maximized)
- Public Member Functions inherited from scripted
 scripted (ScriptingEnv *env)
void scriptingChangeEvent (ScriptingChangeEvent *)
 ~scripted ()

Protected Member Functions

bool eventFilter (QObject *watched, QEvent *event)
 Filters other object's events (customizes title bar's context menu)

Private Attributes

QList< int > d_targets
Type d_type

Additional Inherited Members

- Signals inherited from Table
void aboutToRemoveCol (const QString &)
void changedColHeader (const QString &, const QString &)
void modifiedData (Table *, const QString &)
void removedCol (const QString &)
void resizedTable (QWidget *)
void showContextMenu (bool selection)
- Public Attributes inherited from Table
- Protected Slots inherited from Table
void addFunction ()
void addReference ()
void applyFormula ()
void handleAspectDescriptionAboutToChange (const AbstractAspect *aspect)
void handleAspectDescriptionChange (const AbstractAspect *aspect)
void updateFunctionDoc ()
- Protected Slots inherited from TableView
void advanceCell ()
 Advance current cell after [Return] or [Enter] was pressed.
void applyDescription ()
void applyType ()
void currentColumnChanged (const QModelIndex &current, const QModelIndex &previous)
void handleAspectAboutToBeRemoved (const AbstractAspect *aspect, int index)
void handleAspectAdded (const AbstractAspect *aspect)
void handleAspectDescriptionChanged (const AbstractAspect *aspect)
void handleFormatLineEditChange ()
void handleHeaderDataChanged (Qt::Orientation orientation, int first, int last)
void handleHorizontalHeaderDoubleClicked (int index)
void handleHorizontalSectionMoved (int index, int from, int to)
void selectionChanged (const QItemSelection &selected, const QItemSelection &deselected)
void updateFormatBox ()
void updateTypeInfo ()
- Protected Slots inherited from MyWidget
void updateCaption ()
 Set caption according to current CaptionPolicy, name and label.

Detailed Description

Table that computes and displays statistics on another Table.

Future Plans

Make it possible to add new columns/rows to be monitored.

Member Enumeration Documentation

supported statistics types


Constructor & Destructor Documentation

TableStatistics::TableStatistics ( ScriptingEnv env,
QWidget *  parent,
Table base,
Type  t,
QList< int >  targets 

References future::Table::action_add_column, future::Table::action_add_columns, future::Table::action_add_rows, future::Table::action_clear_columns, future::Table::action_clear_rows, future::Table::action_clear_selection, future::Table::action_clear_table, future::Table::action_cut_selection, future::Table::action_dimensions_dialog, future::Table::action_edit_description, future::Table::action_fill_random, future::Table::action_fill_row_numbers, future::Table::action_insert_columns, future::Table::action_insert_rows, future::Table::action_normalize_columns, future::Table::action_normalize_selection, future::Table::action_paste_into_selection, future::Table::action_recalculate, future::Table::action_remove_columns, future::Table::action_remove_rows, future::Table::action_set_formula, future::Table::action_sort_columns, future::Table::action_sort_table, future::Table::action_statistics_columns, future::Table::action_statistics_rows, future::Table::action_toggle_tabbar, future::Table::action_type_format, MyWidget::Both, Table::colName(), Table::column(), d_base, TableView::d_control_tabs, Table::d_future_table, TableView::d_hide_button, d_targets, d_type, TableView::d_view_widget, Table::name(), SciDAVis::Numeric, Column::outputFilter(), Table::setCaptionPolicy(), Table::setColName(), Table::setColPlotDesignation(), future::Table::setColumnCount(), Table::setColumnType(), Table::setName(), Double2StringFilter::setNumDigits(), Double2StringFilter::setNumericFormat(), future::Table::setRowCount(), Table::setWindowLabel(), StatColumn, StatRow, SciDAVis::Text, update(), and SciDAVis::X.

Member Function Documentation

Table* TableStatistics::base ( ) const

return the base table of which statistics are displayed

References d_base.

Referenced by ApplicationWindow::removeDependentTableStatistics().

bool TableStatistics::eventFilter ( QObject *  object,
QEvent *  e 

Filters other object's events (customizes title bar's context menu)

Reimplemented from TableView.

void TableStatistics::removeCol ( const QString &  col)

remove statistics of removed columns (to be connected with Table::removedCol)

References d_base, Table::d_future_table, d_targets, d_type, Table::name(), future::Table::removeRows(), StatRow, Table::text(), and update().

void TableStatistics::renameCol ( const QString &  from,
const QString &  to 

handle renaming of columns (to be connected with Table::changedColHeader)

References Table::column(), d_base, d_targets, d_type, Table::name(), Column::setTextAt(), StatRow, and Table::text().

QString TableStatistics::saveToString ( const QString &  geometry)
Type TableStatistics::type ( ) const

return the type of statistics

References d_type.

void TableStatistics::update ( Table t,
const QString &  colName 

Member Data Documentation

Table* TableStatistics::d_base
QList<int> TableStatistics::d_targets
Type TableStatistics::d_type

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