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

Column Class Reference

#include <Column.h>

Inheritance diagram for Column:

AbstractColumn AbstractAspect

List of all members.


Detailed Description

Aspect that manages a column.

This class represents a column, i.e., (mathematically) a 1D vector of values with a header. It provides a public reading and (undo aware) writing interface as defined in AbstractColumn. It manages special attributes of column rows such as masking and a validity flag. A column can have one of currently three data types: double, QString, or QDateTime. The string representation of the values can differ depending on the mode of the column.

Column inherits from AbstractAspect and is intended to be a child of the corresponding Table in the aspect hierarchy. Columns don't have a view as they are intended to be displayed inside a table.

Definition at line 55 of file Column.h.


XML related functions

bool load (XmlStreamReader *reader)
 Load the column from XML.
void save (QXmlStreamWriter *writer) const
 Save the column as XML.
bool XmlReadFormula (XmlStreamReader *reader)
 Read XML formula element.
bool XmlReadInputFilter (XmlStreamReader *reader)
 Read XML input filter element.
bool XmlReadMask (XmlStreamReader *reader)
 Read XML mask element.
bool XmlReadOutputFilter (XmlStreamReader *reader)
 Read XML output filter element.
bool XmlReadRow (XmlStreamReader *reader)
 Read XML row element.

Public Slots

virtual void remove ()
 Remove me from my parent's list of children.
void setCaptionSpec (const QString &value)
 Set the specification string used for constructing the caption().
void setComment (const QString &value)
void setName (const QString &value)
QString uniqueNameFor (const QString &current_name) const
 Make the specified name unique among my children by incrementing a trailing number.

Signals

void aboutToBeDestroyed (const AbstractColumn *source)
 Emitted shortly before this data source is deleted.
void aboutToBeReplaced (const AbstractColumn *source, const AbstractColumn *new_col)
 The column will be replaced.
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 dataAboutToChange (const AbstractColumn *source)
 Data (including validity) of the column will be changed.
void dataChanged (const AbstractColumn *source)
 Data (including validity) of the column has changed.
void maskingAboutToChange (const AbstractColumn *source)
 IntervalAttribute related signal.
void maskingChanged (const AbstractColumn *source)
 IntervalAttribute related signal.
void modeAboutToChange (const AbstractColumn *source)
 Column mode (possibly also the data type) will be changed.
void modeChanged (const AbstractColumn *source)
 Column mode (possibly also the data type) changed.
void plotDesignationAboutToChange (const AbstractColumn *source)
 Column plot designation will be changed.
void plotDesignationChanged (const AbstractColumn *source)
 Column plot designation changed.
void rowsAboutToBeInserted (const AbstractColumn *source, int before, int count)
 Rows will be inserted.
void rowsAboutToBeRemoved (const AbstractColumn *source, int first, int count)
 Rows will be deleted.
void rowsInserted (const AbstractColumn *source, int before, int count)
 Rows have been inserted.
void rowsRemoved (const AbstractColumn *source, int first, int count)
 Rows have been deleted.
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.
ColumnStringIOasStringColumn () const
 Return a wrapper column object used for String I/O.
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.
void clear ()
 Clear the whole column.
 Column (const QString &name, QList< QDateTime > data, IntervalAttribute< bool > validity=IntervalAttribute< bool >())
 Ctor.
 Column (const QString &name, QStringList data, IntervalAttribute< bool > validity=IntervalAttribute< bool >())
 Ctor.
 Column (const QString &name, QVector< double > data, IntervalAttribute< bool > validity=IntervalAttribute< bool >())
 Ctor.
 Column (const QString &name, SciDAVis::ColumnMode mode)
 Ctor.
SciDAVis::ColumnMode columnMode () const
 Return the column mode.
QString comment () const
bool copy (const AbstractColumn *source, int source_start, int dest_start, int num_rows)
 Copies a part of another column of the same type.
bool copy (const AbstractColumn *other)
 Copy another column of the same type.
virtual QMenu * createContextMenu () const
 Return a new context menu.
QDateTime creationTime () const
SciDAVis::ColumnDataType dataType () const
 Return the data type of the column.
QList< AbstractAspect * > descendantsThatInherit (const char *class_name)
 Get all descendents that inherit the given class.
future::Folderfolder ()
 Return the folder the Aspect is contained in or 0 if not.
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 insertRows (int before, int count)
 Insert some empty (or initialized with zero) rows.
bool isDescendantOf (AbstractAspect *other)
 Return whether the there is a path upwards to the given aspect.
bool isReadOnly () const
 Return whether the object is read-only.
void moveChild (int from, int to)
 Change the positon of a child in my list of children.
QString name () const
void notifyReplacement (const AbstractColumn *replacement)
 This must be called before the column is replaced by another.
AbstractSimpleFilteroutputFilter () const
 Return the output filter (for data type -> string conversion).
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.
SciDAVis::PlotDesignation plotDesignation () const
 Return the column plot designation.
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 removeRows (int first, int count)
 Remove 'count' rows starting from row 'first'.
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 data vector size.
void setColumnMode (SciDAVis::ColumnMode mode)
 Set the column mode.
void setPlotDesignation (SciDAVis::PlotDesignation pd)
 Set the column plot designation.
 ~Column ()
 Dtor.
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.
Formula related functions
void clearFormulas ()
 Clear all formulas.
QString formula (int row) const
 Return the formula associated with row 'row'.
QList< Interval< int > > formulaIntervals () const
 Return the intervals that have associated formulas.
void setFormula (int row, QString formula)
 Overloaded function for convenience.
void setFormula (Interval< int > i, QString formula)
 Set a formula string for an interval of rows.
IntervalAttribute related functions
void clearMasks ()
 Clear all masking information.
void clearValidity ()
 Clear all validity information.
QList< Interval< int > > invalidIntervals () const
 Return all intervals of invalid rows.
bool isInvalid (Interval< int > i) const
 Return whether a certain interval of rows contains only invalid values.
bool isInvalid (int row) const
 Return whether a certain row contains an invalid value.
bool isMasked (Interval< int > i) const
 Return whether a certain interval of rows rows is fully masked.
bool isMasked (int row) const
 Return whether a certain row is masked.
QList< Interval< int > > maskedIntervals () const
 Return all intervals of masked rows.
void setInvalid (int row, bool invalid=true)
 Overloaded function for convenience.
void setInvalid (Interval< int > i, bool invalid=true)
 Set an interval invalid or valid.
void setMasked (int row, bool mask=true)
 Overloaded function for convenience.
void setMasked (Interval< int > i, bool mask=true)
 Set an interval masked.
type specific functions
QDate dateAt (int row) const
 Return the date part of row 'row'.
QDateTime dateTimeAt (int row) const
 Return the QDateTime in row 'row'.
void replaceDateTimes (int first, const QList< QDateTime > &new_values)
 Replace a range of values.
void replaceTexts (int first, const QStringList &new_values)
 Replace a range of values.
virtual void replaceValues (int first, const QVector< double > &new_values)
 Replace a range of values.
void setDateAt (int row, const QDate &new_value)
 Set the content of row 'row'.
void setDateTimeAt (int row, const QDateTime &new_value)
 Set the content of row 'row'.
void setTextAt (int row, const QString &new_value)
 Set the content of row 'row'.
void setTimeAt (int row, const QTime &new_value)
 Set the content of row 'row'.
void setValueAt (int row, double new_value)
 Set the content of row 'row'.
QString textAt (int row) const
 Return the content of row 'row'.
QTime timeAt (int row) const
 Return the time part of row 'row'.
double valueAt (int row) const
 Return the double value in row 'row'.
aspect related functions
virtual QIcon icon () const
 Return an icon to be used for decorating the views and table column headers.

Static Public Member Functions

static QVariant global (const QString &key)
 Retrieve a global setting.
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.

Private Slots

void notifyDisplayChange ()

Private Attributes

Privated_column_private
 Pointer to the private data object.
ColumnStringIOd_string_io

Friends

class AbstractSimpleFilter
class ColumnPrivate
class ColumnStringIO
class Private
class SimpleCopyThroughFilter
class SimpleMappingFilter

Classes

class  Private
 Private data class of Column. More...

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

Generated by  Doxygen 1.6.0   Back to index