Logo Search packages:      
Sourcecode: scidavis version File versions  Download package

future::Table Class Reference

#include <future_Table.h>

Inheritance diagram for future::Table:

AbstractPart scripted AbstractAspect

List of all members.


Detailed Description

Aspect providing a spreadsheet table with column logic.

This class (incl. Table::Private and its commands) is one aspect in the projet hierarchy that represents a spreadsheet table with column logic. Table provides the public API while Table::Private completely encapsulates the data. The table commands (derived from QUndoCommand) encapsulate all write operations which can be undone and redone, if the table has an undo stack associated with it (usually by the project root aspect).

The underlying private data object is not visible to any classes other then those meantioned above with one exeption: Pointers to columns can be passed around an manipulated directly. The owner Table (parent aspect of the Column objects) will be notified by emission of signals and react accordingly. All public methods of Table and Column are undo aware.

Table also manages its main view of class TableView. Table and TableView can call each others API in both directions. User interaction ist party handled in TableView and translated into Table API calls (e.g., when a user edits a cell this will be handled by the delegate of TableView and Table will not know whether a script or a user changed the data.). Other parts of the user interaction are handled by actions provides by Table, e.g., via a context menu.

Selections are handled by TableView and can be queried by Table. All selection based functions do nothing unless the view exists. The view is created by the first call to view();

Definition at line 79 of file future_Table.h.


Public Slots

void addColumn ()
 Append one column.
void addColumns ()
 Append as many columns as are selected.
void addRows ()
 Append as many rows as are selected.
void clear ()
 Clear the whole table.
void clearMasks ()
 Clear all mask in the table.
void clearSelectedCells ()
void clearSelectedColumns ()
void clearSelectedRows ()
virtual void copy ()
 Copy current selection.
void copySelection ()
virtual void cut ()
 Cut current selection.
void cutSelection ()
void dimensionsDialog ()
void editDescriptionOfCurrentColumn ()
void editTypeAndFormatOfSelectedColumns ()
void fillSelectedCellsWithRandomNumbers ()
void fillSelectedCellsWithRowNumbers ()
void goToCell ()
void insertEmptyColumns ()
 Insert columns depending on the selection.
void insertEmptyRows ()
 Insert rows depending on the selection.
void maskSelection ()
void moveColumn (int from, int to)
void normalizeColumns (QList< Column * > cols)
void normalizeSelectedColumns ()
void normalizeSelection ()
virtual void paste ()
 Paste at the current location or into the current selection.
void pasteIntoSelection ()
void recalculateSelectedCells ()
virtual void remove ()
 Remove me from my parent's list of children.
void removeSelectedColumns ()
void removeSelectedRows ()
void selectAll ()
void setCaptionSpec (const QString &value)
 Set the specification string used for constructing the caption().
void setComment (const QString &value)
void setFormulaForSelection ()
void setName (const QString &value)
void setSelectedColumnsAsNone ()
void setSelectedColumnsAsX ()
void setSelectedColumnsAsXError ()
void setSelectedColumnsAsY ()
void setSelectedColumnsAsYError ()
void setSelectedColumnsAsZ ()
void showTableViewColumnContextMenu (const QPoint &pos)
 Show a context menu for the selected columns.
void showTableViewContextMenu (const QPoint &pos)
 Show a context menu for the selected cells.
void showTableViewRowContextMenu (const QPoint &pos)
 Show a context menu for the selected rows.
void sortColumns (Column *leading, QList< Column * > cols, bool ascending)
 Sort the given list of column.
void sortSelectedColumns ()
void sortTable ()
 Open the sort dialog for all columns.
void statisticsOnSelectedColumns ()
void statisticsOnSelectedRows ()
QString uniqueNameFor (const QString &current_name) const
 Make the specified name unique among my children by incrementing a trailing number.
void unmaskSelection ()

Signals

void aspectAboutToBeAdded (const AbstractAspect *parent, int index)
 Emit this when a parent aspect is about to get a new child inserted.
void aspectAboutToBeRemoved (const AbstractAspect *parent, int index)
 Emit this from a parent before removing its child.
void aspectAboutToBeRemoved (const AbstractAspect *aspect)
 Emit this from an aspect about to be removed from its parent's children.
void aspectAdded (const AbstractAspect *parent, int index)
 Emit this from a parent after adding a new child to it.
void aspectAdded (const AbstractAspect *aspect)
 Emit this from a newly added aspect.
void aspectDescriptionAboutToChange (const AbstractAspect *aspect)
 Emit this before the name, comment or caption spec is changed.
void aspectDescriptionChanged (const AbstractAspect *aspect)
 Emit this when the name, comment or caption spec changed.
void aspectRemoved (const AbstractAspect *parent, int index)
 Emit this from the parent after removing a child.
void columnsAboutToBeInserted (int before, QList< Column * > new_cols)
void columnsAboutToBeRemoved (int first, int count)
void columnsAboutToBeReplaced (int first, int count)
void columnsInserted (int first, int count)
void columnsRemoved (int first, int count)
void columnsReplaced (int first, int count)
void dataChanged (int top, int left, int bottom, int right)
void headerDataChanged (Qt::Orientation orientation, int first, int last)
void rowsAboutToBeInserted (int before, int count)
void rowsAboutToBeRemoved (int first, int count)
void rowsInserted (int first, int count)
void rowsRemoved (int first, int count)
void statusInfo (const QString &text)
 Emit this to give status information to the user.

Public Member Functions

void addChild (AbstractAspect *child)
 Add the given Aspect to my list of children.
void appendColumns (QList< Column * > new_cols)
 Append columns.
void appendRows (int count)
QString caption () const
QString captionSpec () const
 Return the specification string used for constructing the caption().
AbstractAspectchild (int index) const
 Get a child by its position in my list of children.
int childCount () const
 Return the number of child Aspects.
Columncolumn (const QString &name) const
 Return the column determined by the given name.
Columncolumn (int index) const
 Return column number 'index'.
int columnCount (SciDAVis::PlotDesignation pd) const
 Return the number of columns matching the given designation.
int columnCount () const
 Return the total number of columns in the table.
int columnIndex (const Column *col) const
int columnWidth (int col) const
int colX (int col)
 Determine the corresponding X column.
int colY (int col)
 Determine the corresponding Y column.
QString comment () const
void copy (Table *other)
QMenu * createColumnMenu (QMenu *append_to=0)
 Create a menu with column related operations.
virtual QMenu * createContextMenu () const
 Return a new context menu.
QMenu * createRowMenu (QMenu *append_to=0)
 Create a menu with row related operations.
QMenu * createSelectionMenu (QMenu *append_to=0)
 Create a menu with selection related operations.
QMenu * createTableMenu (QMenu *append_to=0)
 Create a menu with table related operations.
QDateTime creationTime () const
QList< AbstractAspect * > descendantsThatInherit (const char *class_name)
 Get all descendents that inherit the given class.
virtual bool fillProjectMenu (QMenu *menu)
 Fill the part specific menu for the main window including setting the title.
virtual bool fillProjectToolBar (QToolBar *bar)
 Fill the part specific tool bar for the main window including setting the title.
future::Folderfolder ()
 Return the folder the Aspect is contained in or 0 if not.
QVariant headerData (int section, Qt::Orientation orientation, int role) const
virtual QIcon icon () const
 Return an icon to be used for decorating my views.
void importV0x0001XXCreationTime (const QString &str)
int index () const
 Return my position in my parent's list of children.
int indexOfChild (const AbstractAspect *child) const
 Return the position of child in my list of children.
void insertChild (AbstractAspect *child, int index)
 Insert the given Aspect at a specific position in my list of children.
void insertColumns (int before, QList< Column * > new_cols)
 Insert columns.
void insertRows (int before, int count)
bool isDescendantOf (AbstractAspect *other)
 Return whether the there is a path upwards to the given aspect.
PartMdiViewmdiSubWindow ()
 Wrap the view() into a PartMdiView.
void moveChild (int from, int to)
 Change the positon of a child in my list of children.
QString name () const
AbstractAspectparentAspect () const
 Return my parent Aspect or 0 if I currently don't have one.
virtual QString path () const
 Return the path that leads from the top-most Aspect (usually a Project) to me.
virtual Projectproject ()
 Return the Project this Aspect belongs to, or 0 if it is currently not part of one.
virtual const Projectproject () const
 Return the Project this Aspect belongs to, or 0 if it is currently not part of one.
virtual void removeAllChildAspects ()
 Remove all child aspects.
void removeChild (int index)
 Remove the Aspect at the given index from my list of children.
void removeChild (AbstractAspect *child, bool detach=false)
 Remove the given Aspect from my list of children.
void removeColumn (Column *col)
void removeColumns (int first, int count)
void removeRows (int first, int count)
void reparentChild (AbstractAspect *new_parent, AbstractAspect *child)
 Move a child to another aspect and transfer ownership.
void reparentChild (AbstractAspect *new_parent, AbstractAspect *child, int d_new_index)
 Move a child to another aspect and transfer ownership.
int rowCount () const
 Return the total number of rows in the table.
void scriptingChangeEvent (ScriptingChangeEvent *)
void scriptingChangeEvent (ScriptingChangeEvent *)
void setColumnCount (int new_size)
 Set the number of columns.
void setColumnWidth (int col, int width)
 This method should only be called by the view.
void setPlotMenu (QMenu *menu)
 Set a plot menu.
void setRowCount (int new_size)
 Set the number of rows of the table.
void setSelectionAs (SciDAVis::PlotDesignation pd)
void sortDialog (QList< Column * > cols)
 Open the sort dialog for the given columns.
 Table (AbstractScriptingEngine *engine, int rows, int columns, const QString &name)
QString text (int row, int col)
 Return the text displayed in the given cell.
virtual QWidget * view ()
 Construct a primary view on me.
undo related
void beginMacro (const QString &text)
 Begin an undo stack macro (series of commands).
void endMacro ()
 End the undo stack macro.
void exec (QUndoCommand *command)
 Execute the given command, pushing it on the undoStack() if available.
virtual QUndoStack * undoStack () const
 Return the undo stack of the Project, or 0 if this Aspect is not part of a Project.
serialize/deserialize
virtual bool load (XmlStreamReader *)
 Load from XML.
bool readColumnWidthElement (XmlStreamReader *reader)
virtual void save (QXmlStreamWriter *) const
 Save as XML.

Static Public Member Functions

static ActionManageractionManager ()
static int defaultColumnWidth ()
static bool defaultCommentVisibility ()
 Return the default for comment visibility for table views.
static QVariant global (const QString &key)
 Retrieve a global setting.
static void initActionManager ()
static void setDefaultColumnWidth (int width)
static void setDefaultCommentVisibility (bool visible)
 Set default for comment visibility for table views.
static void setGlobal (const QString &key, const QVariant &value)
 Update a global setting.
static void setGlobalDefault (const QString &key, const QVariant &value)
 Set default value for a global setting.

Protected Member Functions

virtual void completeAspectInsertion (AbstractAspect *aspect, int index)
 Called after a new child has been inserted or added.
void info (const QString &text)
 Implementations should call this whenever status information should be given to the user.
virtual void prepareAspectRemoval (AbstractAspect *aspect)
 Called before a child is removed.
void setCreationTime (const QDateTime &time)
 Set the creation time.
serialize/deserialize
bool readBasicAttributes (XmlStreamReader *reader)
 Load name, creation time and caption spec from XML.
bool readCommentElement (XmlStreamReader *reader)
 Load comment from an XML element.
void writeBasicAttributes (QXmlStreamWriter *writer) const
 Save name, creation time and caption spec to XML.
void writeCommentElement (QXmlStreamWriter *writer) const
 Save the comment to XML.

Protected Attributes

AbstractScriptingEngined_scripting_engine
ScriptingEnvscriptEnv

Private Slots

void adjustActionNames ()
Column event handlers
void handleDataChange (const AbstractColumn *col)
void handleDescriptionChange (const AbstractAspect *aspect)
void handleModeChange (const AbstractColumn *col)
void handlePlotDesignationChange (const AbstractColumn *col)
void handleRowsAboutToBeInserted (const AbstractColumn *col, int before, int count)
void handleRowsAboutToBeRemoved (const AbstractColumn *col, int first, int count)
void handleRowsInserted (const AbstractColumn *col, int before, int count)
void handleRowsRemoved (const AbstractColumn *col, int first, int count)

Private Member Functions

void addActionsToView ()
void connectActions ()
void connectColumn (const Column *col)
 Internal function to connect all column signals.
void createActions ()
void disconnectColumn (const Column *col)
 Internal function to disconnect a column.
 Table ()
 Private ctor for initActionManager() only.

Private Attributes

QMenu * d_plot_menu
Privated_table_private
TableViewd_view
table related actions
QAction * action_add_column
QAction * action_clear_masks
QAction * action_clear_table
QAction * action_dimensions_dialog
QAction * action_formula_mode
QAction * action_go_to_cell
QAction * action_select_all
QAction * action_sort_table
QAction * action_toggle_comments
QAction * action_toggle_tabbar
column related actions
QAction * action_add_columns
QAction * action_clear_columns
QAction * action_edit_description
QAction * action_insert_columns
QAction * action_normalize_columns
QAction * action_remove_columns
QAction * action_set_as_none
QAction * action_set_as_x
QAction * action_set_as_xerr
QAction * action_set_as_y
QAction * action_set_as_yerr
QAction * action_set_as_z
QAction * action_sort_columns
QAction * action_statistics_columns
QAction * action_type_format
row related actions
QAction * action_add_rows
QAction * action_clear_rows
QAction * action_insert_rows
QAction * action_remove_rows
QAction * action_statistics_rows
selection related actions
QAction * action_clear_selection
QAction * action_copy_selection
QAction * action_cut_selection
QAction * action_fill_random
QAction * action_fill_row_numbers
QAction * action_mask_selection
QAction * action_normalize_selection
QAction * action_paste_into_selection
QAction * action_recalculate
QAction * action_set_formula
QAction * action_unmask_selection

Static Private Attributes

static ActionManageraction_manager = 0
static bool d_default_comment_visibility = false
static int default_column_width = 120

Friends

class Private

Classes

class  Private

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

Generated by  Doxygen 1.6.0   Back to index