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

future::Matrix Class Reference

#include <future_Matrix.h>

Inheritance diagram for future::Matrix:

AbstractPart scripted AbstractAspect

List of all members.


Detailed Description

Aspect providing a spreadsheet to manage MxN matrix data.

Definition at line 54 of file future_Matrix.h.


Public Slots

void addColumns ()
 Append as many columns as are selected.
void addRows ()
 Append as many rows as are selected.
void clear ()
 Clear the whole matrix (i.e. set all cells to 0.0).
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 duplicate ()
 Duplicate the matrix inside its folder.
void editCoordinates ()
void editFormat ()
void editFormula ()
void goToCell ()
void importImageDialog ()
void insertEmptyColumns ()
 Insert columns depending on the selection.
void insertEmptyRows ()
 Insert rows depending on the selection.
void mirrorHorizontally ()
void mirrorVertically ()
virtual void paste ()
 Paste at the current location or into the current selection.
void pasteIntoSelection ()
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 setName (const QString &value)
void showMatrixViewColumnContextMenu (const QPoint &pos)
 Show a context menu for the selected columns.
void showMatrixViewContextMenu (const QPoint &pos)
 Show a context menu for the selected cells.
void showMatrixViewRowContextMenu (const QPoint &pos)
 Show a context menu for the selected rows.
void transpose ()
QString uniqueNameFor (const QString &current_name) const
 Make the specified name unique among my children by incrementing a trailing number.

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, int count)
void columnsAboutToBeRemoved (int first, int count)
void columnsInserted (int first, int count)
void columnsRemoved (int first, int count)
void coordinatesChanged ()
void dataChanged (int top, int left, int bottom, int right)
void formatChanged ()
void formulaChanged ()
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 (int count)
void appendRows (int count)
QString caption () const
QString captionSpec () const
 Return the specification string used for constructing the caption().
double cell (int row, int col) const
 Return the value in the given cell.
AbstractAspectchild (int index) const
 Get a child by its position in my list of children.
int childCount () const
 Return the number of child Aspects.
QVector< double > columnCells (int col, int first_row, int last_row)
 Return the values in the given cells as double vector.
int columnCount () const
 Return the total number of columns.
int columnWidth (int col) const
QString comment () const
void copy (Matrix *other)
QMenu * createColumnMenu (QMenu *append_to=0)
 Create a menu with column related operations.
virtual QMenu * createContextMenu () const
 Return a new context menu.
QMenu * createMatrixMenu (QMenu *append_to=0)
 Create a menu with table related operations.
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.
QDateTime creationTime () const
QList< AbstractAspect * > descendantsThatInherit (const char *class_name)
 Get all descendents that inherit the given class.
int displayedDigits () const
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.
QString formula () 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, int count)
void insertRows (int before, int count)
bool isDescendantOf (AbstractAspect *other)
 Return whether the there is a path upwards to the given aspect.
 Matrix (AbstractScriptingEngine *engine, int rows, int cols, const QString &name)
 Constructor.
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
char numericFormat () 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 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.
QVector< double > rowCells (int row, int first_column, int last_column)
 Return the values in the given cells as double vector.
int rowCount () const
 Return the total number of rows.
int rowHeight (int row) const
void scriptingChangeEvent (ScriptingChangeEvent *)
void scriptingChangeEvent (ScriptingChangeEvent *)
void setCell (int row, int col, double value)
 Set the value of the cell.
void setColumnCells (int col, int first_row, int last_row, const QVector< double > &values)
 Set the values in the given cells from a double vector.
void setColumnWidth (int col, int width)
 This method should only be called by the view.
void setCoordinates (double x1, double x2, double y1, double y2)
void setDimensions (int rows, int cols)
 Set the number of rows and columns.
void setDisplayedDigits (int digits)
void setFormula (const QString &formula)
void setNumericFormat (char format)
void setPlotMenu (QMenu *menu)
 Set a plot menu.
void setRowCells (int row, int first_column, int last_column, const QVector< double > &values)
 Set the values in the given cells from a double vector.
void setRowHeight (int row, int height)
 This method should only be called by the view.
void setXEnd (double x)
void setXStart (double x)
void setYEnd (double y)
void setYStart (double y)
QString text (int row, int col)
 Return the text displayed in the given cell.
virtual QWidget * view ()
 Construct a primary view on me.
double xEnd () const
double xStart () const
double yEnd () const
double yStart () const
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.
virtual void save (QXmlStreamWriter *) const
 Save as XML.

Static Public Member Functions

static ActionManageractionManager ()
static int defaultColumnWidth ()
static int defaultRowHeight ()
static MatrixfromImage (const QImage &image)
static QVariant global (const QString &key)
 Retrieve a global setting.
static void initActionManager ()
static void setDefaultColumnWidth (int width)
static void setDefaultRowHeight (int height)
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 adjustTabBarAction (bool visible)

Private Member Functions

void addActionsToView ()
void connectActions ()
void createActions ()
 Matrix ()
 Private ctor for initActionManager() only.
bool readCellElement (XmlStreamReader *reader)
 Read XML cell element.
bool readColumnWidthElement (XmlStreamReader *reader)
bool readCoordinatesElement (XmlStreamReader *reader)
 Read XML coodinates element.
bool readDisplayElement (XmlStreamReader *reader)
 Read XML display element.
bool readFormulaElement (XmlStreamReader *reader)
 Read XML formula element.
bool readRowHeightElement (XmlStreamReader *reader)

Private Attributes

Privated_matrix_private
QMenu * d_plot_menu
MatrixViewd_view
column related actions
QAction * action_add_columns
QAction * action_clear_columns
QAction * action_insert_columns
QAction * action_remove_columns
row related actions
QAction * action_add_rows
QAction * action_clear_rows
QAction * action_insert_rows
QAction * action_remove_rows
matrix related actions
QAction * action_clear_matrix
QAction * action_dimensions_dialog
QAction * action_duplicate
QAction * action_edit_coordinates
QAction * action_edit_format
QAction * action_go_to_cell
QAction * action_import_image
QAction * action_mirror_horizontally
QAction * action_mirror_vertically
QAction * action_recalculate
QAction * action_select_all
QAction * action_set_formula
QAction * action_toggle_tabbar
QAction * action_transpose
selection related actions
QAction * action_clear_selection
QAction * action_copy_selection
QAction * action_cut_selection
QAction * action_paste_into_selection

Static Private Attributes

static ActionManageraction_manager = 0
static int default_column_width = 120
static int default_row_height = 20

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