scidavis  2.3.0
About: SciDAVis is a free application for Scientific Data Analysis and Visualization (a fork off of QtiPlot).
  Fossies Dox: scidavis-2.3.0.tar.gz  ("unofficial" and yet experimental doxygen-generated source code documentation)  

future::Folder Class Reference

Folder in a project. More...

#include <future_Folder.h>

Inheritance diagram for future::Folder:
[legend]
Collaboration diagram for future::Folder:
[legend]

Public Member Functions

 Folder (const QString &name)
 
virtual ~Folder ()
 
virtual QIcon icon () const
 Return an icon to be used for decorating my views. More...
 
virtual QMenu * createContextMenu () const
 Return a new context menu. More...
 
AbstractAspectparentAspect () const
 Return my parent Aspect or 0 if I currently don't have one. More...
 
future::Folderfolder ()
 Return the folder the Aspect is contained in or 0 if not. More...
 
bool isDescendantOf (AbstractAspect *other)
 Return whether the there is a path upwards to the given aspect. More...
 
void addChild (AbstractAspect *child)
 Add the given Aspect to my list of children. More...
 
void insertChild (AbstractAspect *child, int index)
 Insert the given Aspect at a specific position in my list of children. More...
 
void removeChild (AbstractAspect *child, bool detach=false)
 Remove the given Aspect from my list of children. More...
 
void removeChild (int index)
 Remove the Aspect at the given index from my list of children. More...
 
AbstractAspectchild (int index) const
 Get a child by its position in my list of children. More...
 
int childCount () const
 Return the number of child Aspects. More...
 
int indexOfChild (const AbstractAspect *child) const
 Return the position of child in my list of children. More...
 
int index () const
 Return my position in my parent's list of children. More...
 
void moveChild (int from, int to)
 Change the positon of a child in my list of children. More...
 
void reparentChild (AbstractAspect *new_parent, AbstractAspect *child, int d_new_index)
 Move a child to another aspect and transfer ownership. More...
 
void reparentChild (AbstractAspect *new_parent, AbstractAspect *child)
 Move a child to another aspect and transfer ownership. More...
 
QList< AbstractAspect * > descendantsThatInherit (const char *class_name)
 Get all descendents that inherit the given class. More...
 
virtual void removeAllChildAspects ()
 Remove all child aspects. More...
 
virtual const Projectproject () const
 Return the Project this Aspect belongs to, or 0 if it is currently not part of one. More...
 
virtual Projectproject ()
 Return the Project this Aspect belongs to, or 0 if it is currently not part of one. More...
 
virtual QString path () const
 Return the path that leads from the top-most Aspect (usually a Project) to me. More...
 
QString name () const
 
QString comment () const
 
QString captionSpec () const
 Return the specification string used for constructing the caption(). More...
 
QDateTime creationTime () const
 
QString caption () const
 

undo related

virtual QUndoStack * undoStack () const
 Return the undo stack of the Project, or 0 if this Aspect is not part of a Project. More...
 
void exec (QUndoCommand *command)
 Execute the given command, pushing it on the undoStack() if available. More...
 
void beginMacro (const QString &text)
 Begin an undo stack macro (series of commands) More...
 
void endMacro ()
 End the undo stack macro. More...
 
static QVariant global (const QString &key)
 Retrieve a global setting. More...
 
static void setGlobal (const QString &key, const QVariant &value)
 Update a global setting. More...
 
static void setGlobalDefault (const QString &key, const QVariant &value)
 Set default value for a global setting. More...
 

serialize/deserialize

void importV0x0001XXCreationTime (const QString &str)
 
bool readBasicAttributes (XmlStreamReader *reader)
 Load name, creation time and caption spec from XML. More...
 
void writeBasicAttributes (QXmlStreamWriter *writer) const
 Save name, creation time and caption spec to XML. More...
 
void writeCommentElement (QXmlStreamWriter *writer) const
 Save the comment to XML. More...
 
bool readCommentElement (XmlStreamReader *reader)
 Load comment from an XML element. More...
 
void setCreationTime (const QDateTime &time)
 Set the creation time. More...
 
virtual void completeAspectInsertion (AbstractAspect *aspect, int index)
 Called after a new child has been inserted or added. More...
 
virtual void prepareAspectRemoval (AbstractAspect *aspect)
 Called before a child is removed. More...
 
void info (const QString &text)
 Implementations should call this whenever status information should be given to the user. More...
 
Privated_aspect_private
 
void setName (const QString &value)
 
void setComment (const QString &value)
 
void setCaptionSpec (const QString &value)
 Set the specification string used for constructing the caption(). More...
 
virtual void remove ()
 Remove me from my parent's list of children. More...
 
QString uniqueNameFor (const QString &current_name) const
 Make the specified name unique among my children by incrementing a trailing number. More...
 
void aspectDescriptionAboutToChange (const AbstractAspect *aspect)
 Emit this before the name, comment or caption spec is changed. More...
 
void aspectDescriptionChanged (const AbstractAspect *aspect)
 Emit this when the name, comment or caption spec changed. More...
 
void aspectAboutToBeAdded (const AbstractAspect *parent, int index)
 Emit this when a parent aspect is about to get a new child inserted. More...
 
void aspectAdded (const AbstractAspect *aspect)
 Emit this from a newly added aspect. More...
 
void aspectAdded (const AbstractAspect *parent, int index)
 Emit this from a parent after adding a new child to it. More...
 
void aspectAboutToBeRemoved (const AbstractAspect *aspect)
 Emit this from an aspect about to be removed from its parent's children. More...
 
void aspectAboutToBeRemoved (const AbstractAspect *parent, int index)
 Emit this from a parent before removing its child. More...
 
void aspectRemoved (const AbstractAspect *parent, int index)
 Emit this from the parent after removing a child. More...
 
void statusInfo (const QString &text)
 Emit this to give status information to the user. More...
 

serialize/deserialize

virtual void save (QXmlStreamWriter *) const
 Save as XML. More...
 
virtual bool load (XmlStreamReader *)
 Load from XML. More...
 
bool readChildAspectElement (XmlStreamReader *reader)
 Read child aspect from XML. More...
 

Detailed Description

Folder in a project.

Definition at line 37 of file future_Folder.h.

Constructor & Destructor Documentation

◆ Folder()

Folder::Folder ( const QString &  name)

Definition at line 43 of file future_Folder.cpp.

45 {
46 }

Referenced by readChildAspectElement().

Here is the caller graph for this function:

◆ ~Folder()

Folder::~Folder ( )
virtual

Definition at line 48 of file future_Folder.cpp.

49 {
50 }

Member Function Documentation

◆ addChild()

void AbstractAspect::addChild ( AbstractAspect child)
inherited

Add the given Aspect to my list of children.

Definition at line 114 of file AbstractAspect.cpp.

115 {
116  Q_CHECK_PTR(child);
117  QString new_name = d_aspect_private->uniqueNameFor(child->name());
118  beginMacro(tr("%1: add %2.").arg(name()).arg(new_name));
119  if (new_name != child->name()) {
120  info(tr("Renaming \"%1\" to \"%2\" in order to avoid name collision.").arg(child->name()).arg(new_name));
121  child->setName(new_name);
122  }
125  endMacro();
126 }

References AbstractAspect::beginMacro(), AbstractAspect::child(), AbstractAspect::Private::childCount(), AbstractAspect::completeAspectInsertion(), AbstractAspect::d_aspect_private, AbstractAspect::endMacro(), AbstractAspect::exec(), AbstractAspect::info(), AbstractAspect::name(), AbstractAspect::setName(), and AbstractAspect::Private::uniqueNameFor().

Referenced by AbstractSimpleFilter::AbstractSimpleFilter(), Column::Column(), ApplicationWindow::convertMatrixToTable(), ApplicationWindow::convertTableToMatrix(), future::Matrix::duplicate(), ApplicationWindow::importImage(), Column::init(), ApplicationWindow::newMatrix(), ApplicationWindow::newTable(), ApplicationWindow::newTableStatistics(), readChildAspectElement(), and Column::setColumnMode().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ aspectAboutToBeAdded

void AbstractAspect::aspectAboutToBeAdded ( const AbstractAspect parent,
int  index 
)
signalinherited

Emit this when a parent aspect is about to get a new child inserted.

Referenced by AbstractAspect::Private::insertChild().

Here is the caller graph for this function:

◆ aspectAboutToBeRemoved [1/2]

void AbstractAspect::aspectAboutToBeRemoved ( const AbstractAspect aspect)
signalinherited

Emit this from an aspect about to be removed from its parent's children.

Referenced by AbstractAspect::Private::insertChild(), and AbstractAspect::Private::removeChild().

Here is the caller graph for this function:

◆ aspectAboutToBeRemoved [2/2]

void AbstractAspect::aspectAboutToBeRemoved ( const AbstractAspect parent,
int  index 
)
signalinherited

Emit this from a parent before removing its child.

◆ aspectAdded [1/2]

void AbstractAspect::aspectAdded ( const AbstractAspect aspect)
signalinherited

Emit this from a newly added aspect.

Referenced by AbstractAspect::Private::insertChild().

Here is the caller graph for this function:

◆ aspectAdded [2/2]

void AbstractAspect::aspectAdded ( const AbstractAspect parent,
int  index 
)
signalinherited

Emit this from a parent after adding a new child to it.

◆ aspectDescriptionAboutToChange

void AbstractAspect::aspectDescriptionAboutToChange ( const AbstractAspect aspect)
signalinherited

Emit this before the name, comment or caption spec is changed.

Referenced by AbstractFilter::input(), and AbstractAspect::Private::insertChild().

Here is the caller graph for this function:

◆ aspectDescriptionChanged

void AbstractAspect::aspectDescriptionChanged ( const AbstractAspect aspect)
signalinherited

Emit this when the name, comment or caption spec changed.

Referenced by future::Table::connectColumn(), AbstractFilter::input(), AbstractAspect::Private::insertChild(), and Column::notifyDisplayChange().

Here is the caller graph for this function:

◆ aspectRemoved

void AbstractAspect::aspectRemoved ( const AbstractAspect parent,
int  index 
)
signalinherited

Emit this from the parent after removing a child.

Referenced by AbstractAspect::Private::insertChild(), and AbstractAspect::Private::removeChild().

Here is the caller graph for this function:

◆ beginMacro()

void AbstractAspect::beginMacro ( const QString &  text)
inherited

Begin an undo stack macro (series of commands)

Definition at line 215 of file AbstractAspect.cpp.

216 {
217  QUndoStack *stack = undoStack();
218  if (stack)
219  stack->beginMacro(text);
220 }

References AbstractAspect::undoStack().

Referenced by AbstractAspect::addChild(), future::Table::addColumn(), future::Matrix::addColumns(), future::Table::addColumns(), future::Matrix::addRows(), future::Table::addRows(), Matrix::applyFormula(), TableView::applyType(), future::Matrix::clear(), future::Table::clear(), future::Table::clearMasks(), future::Matrix::clearSelectedCells(), future::Table::clearSelectedCells(), future::Matrix::clearSelectedColumns(), future::Table::clearSelectedColumns(), future::Matrix::clearSelectedRows(), future::Matrix::copy(), future::Table::copy(), future::Matrix::cutSelection(), future::Table::cutSelection(), future::Table::fillSelectedCellsWithRandomNumbers(), future::Table::fillSelectedCellsWithRowNumbers(), AbstractAspect::insertChild(), future::Matrix::insertColumns(), future::Table::insertColumns(), future::Matrix::insertEmptyColumns(), future::Table::insertEmptyColumns(), future::Matrix::insertEmptyRows(), future::Table::insertEmptyRows(), future::Matrix::insertRows(), future::Table::insertRows(), future::Table::maskSelection(), future::Table::moveColumn(), future::Table::normalizeColumns(), future::Table::normalizeSelection(), future::Matrix::pasteIntoSelection(), future::Table::pasteIntoSelection(), future::Table::recalculateSelectedCells(), AbstractAspect::removeAllChildAspects(), AbstractAspect::removeChild(), future::Matrix::removeColumns(), future::Table::removeColumns(), future::Matrix::removeRows(), future::Table::removeRows(), future::Matrix::removeSelectedColumns(), future::Table::removeSelectedColumns(), future::Matrix::removeSelectedRows(), future::Table::removeSelectedRows(), AbstractAspect::reparentChild(), Column::setColumnMode(), future::Matrix::setDimensions(), future::Table::setRowCount(), future::Table::setSelectionAs(), future::Table::sortColumns(), and future::Table::unmaskSelection().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ caption()

QString AbstractAspect::caption ( ) const
inherited

Definition at line 293 of file AbstractAspect.cpp.

294 {
295  return d_aspect_private->caption();
296 }

References AbstractAspect::Private::caption(), and AbstractAspect::d_aspect_private.

Referenced by PartMdiView::handleAspectDescriptionChanged().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ captionSpec()

QString AbstractAspect::captionSpec ( ) const
inherited

Return the specification string used for constructing the caption().

See setCaptionSpec() for format.

Definition at line 271 of file AbstractAspect.cpp.

272 {
273  return d_aspect_private->captionSpec();
274 }

References AbstractAspect::Private::captionSpec(), and AbstractAspect::d_aspect_private.

Referenced by future::Table::copy(), and AbstractAspect::writeBasicAttributes().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ child()

AbstractAspect * AbstractAspect::child ( int  index) const
inherited

Get a child by its position in my list of children.

Definition at line 180 of file AbstractAspect.cpp.

181 {
182  Q_ASSERT(index >= 0 && index <= childCount());
183  return d_aspect_private->child(index);
184 }

References AbstractAspect::Private::child(), AbstractAspect::childCount(), AbstractAspect::d_aspect_private, and AbstractAspect::index().

Referenced by AbstractAspect::addChild(), AbstractAspect::Private::addChild(), AbstractAspect::descendantsThatInherit(), ApplicationWindow::handleAspectAboutToBeRemoved(), ApplicationWindow::handleAspectAdded(), AbstractAspect::indexOfChild(), AbstractAspect::Private::indexOfChild(), AbstractAspect::insertChild(), AbstractAspect::Private::insertChild(), AbstractAspect::Private::removeChild(), AbstractAspect::removeChild(), AbstractAspect::reparentChild(), save(), AbstractAspect::Private::uniqueNameFor(), and AbstractAspect::Private::~Private().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ childCount()

int AbstractAspect::childCount ( ) const
inherited

Return the number of child Aspects.

Definition at line 186 of file AbstractAspect.cpp.

187 {
188  return d_aspect_private->childCount();
189 }

References AbstractAspect::Private::childCount(), and AbstractAspect::d_aspect_private.

Referenced by AbstractAspect::Private::child(), AbstractAspect::child(), AbstractAspect::descendantsThatInherit(), AbstractAspect::moveChild(), AbstractAspect::removeAllChildAspects(), AbstractAspect::removeChild(), AbstractAspect::reparentChild(), and save().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ comment()

QString AbstractAspect::comment ( ) const
inherited

Definition at line 260 of file AbstractAspect.cpp.

261 {
262  return d_aspect_private->comment();
263 }

References AbstractAspect::Private::comment(), and AbstractAspect::d_aspect_private.

Referenced by Table::colComment(), Table::colComments(), future::Table::copy(), Table::saveComments(), TableView::setColumnForControlTabs(), Matrix::windowLabel(), and AbstractAspect::writeCommentElement().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ completeAspectInsertion()

virtual void AbstractAspect::completeAspectInsertion ( AbstractAspect aspect,
int  index 
)
inlineprotectedvirtualinherited

Called after a new child has been inserted or added.

Unlike the aspectAdded() signals, this method does not get called inside undo/redo actions; allowing subclasses to execute undo commands of their own.

Reimplemented in future::Table.

Definition at line 294 of file AbstractAspect.h.

294 { Q_UNUSED(aspect); Q_UNUSED(index); }

References AbstractAspect::index().

Referenced by AbstractAspect::addChild(), AbstractAspect::insertChild(), and AbstractAspect::reparentChild().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ createContextMenu()

QMenu * Folder::createContextMenu ( ) const
virtual

Return a new context menu.

The caller takes ownership of the menu.

Reimplemented from AbstractAspect.

Reimplemented in Project.

Definition at line 60 of file future_Folder.cpp.

61 {
62  if (project())
63  return project()->createFolderContextMenu(this);
64  return 0;
65 }

References Project::createFolderContextMenu(), and AbstractAspect::project().

Here is the call graph for this function:

◆ creationTime()

QDateTime AbstractAspect::creationTime ( ) const
inherited

Definition at line 288 of file AbstractAspect.cpp.

289 {
290  return d_aspect_private->creationTime();
291 }

References AbstractAspect::Private::creationTime(), and AbstractAspect::d_aspect_private.

Referenced by Matrix::birthDate(), Matrix::init(), and AbstractAspect::writeBasicAttributes().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ descendantsThatInherit()

QList< AbstractAspect * > AbstractAspect::descendantsThatInherit ( const char *  class_name)
inherited

Get all descendents that inherit the given class.

Definition at line 342 of file AbstractAspect.cpp.

343 {
344  QList<AbstractAspect *> list;
345  if (inherits(class_name))
346  list << this;
347  for (int i=0; i<childCount(); i++)
348  list << child(i)->descendantsThatInherit(class_name);
349  return list;
350 }

References AbstractAspect::child(), AbstractAspect::childCount(), and AbstractAspect::descendantsThatInherit().

Referenced by AbstractAspect::descendantsThatInherit(), and ApplicationWindow::tableWindows().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ endMacro()

void AbstractAspect::endMacro ( )
inherited

End the undo stack macro.

Definition at line 222 of file AbstractAspect.cpp.

223 {
224  QUndoStack *stack = undoStack();
225  if (stack)
226  stack->endMacro();
227 }

References AbstractAspect::undoStack().

Referenced by AbstractAspect::addChild(), future::Table::addColumn(), future::Matrix::addColumns(), future::Table::addColumns(), future::Matrix::addRows(), future::Table::addRows(), Matrix::applyFormula(), TableView::applyType(), future::Matrix::clear(), future::Table::clear(), future::Table::clearMasks(), future::Matrix::clearSelectedCells(), future::Table::clearSelectedCells(), future::Matrix::clearSelectedColumns(), future::Table::clearSelectedColumns(), future::Matrix::clearSelectedRows(), future::Matrix::copy(), future::Table::copy(), future::Matrix::cutSelection(), future::Table::cutSelection(), future::Table::fillSelectedCellsWithRandomNumbers(), future::Table::fillSelectedCellsWithRowNumbers(), AbstractAspect::insertChild(), future::Matrix::insertColumns(), future::Table::insertColumns(), future::Matrix::insertEmptyColumns(), future::Table::insertEmptyColumns(), future::Matrix::insertEmptyRows(), future::Table::insertEmptyRows(), future::Matrix::insertRows(), future::Table::insertRows(), future::Table::maskSelection(), future::Table::moveColumn(), future::Table::normalizeColumns(), future::Table::normalizeSelection(), future::Matrix::pasteIntoSelection(), future::Table::pasteIntoSelection(), future::Table::recalculateSelectedCells(), AbstractAspect::removeAllChildAspects(), AbstractAspect::removeChild(), future::Matrix::removeColumns(), future::Table::removeColumns(), future::Matrix::removeRows(), future::Table::removeRows(), future::Matrix::removeSelectedColumns(), future::Table::removeSelectedColumns(), future::Matrix::removeSelectedRows(), future::Table::removeSelectedRows(), AbstractAspect::reparentChild(), Column::setColumnMode(), future::Matrix::setDimensions(), future::Table::setRowCount(), future::Table::setSelectionAs(), future::Table::sortColumns(), and future::Table::unmaskSelection().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ exec()

void AbstractAspect::exec ( QUndoCommand *  command)
inherited

Execute the given command, pushing it on the undoStack() if available.

Definition at line 203 of file AbstractAspect.cpp.

204 {
205  Q_CHECK_PTR(cmd);
206  QUndoStack *stack = undoStack();
207  if (stack)
208  stack->push(cmd);
209  else {
210  cmd->redo();
211  delete cmd;
212  }
213 }

References AbstractAspect::undoStack().

Referenced by AbstractAspect::addChild(), future::Matrix::addColumns(), future::Matrix::addRows(), future::Table::addRows(), future::Matrix::clear(), Column::clear(), Column::clearFormulas(), Column::clearMasks(), future::Matrix::clearSelectedCells(), future::Matrix::clearSelectedColumns(), future::Matrix::clearSelectedRows(), Column::clearValidity(), future::Table::completeAspectInsertion(), Column::copy(), AbstractAspect::insertChild(), future::Matrix::insertColumns(), future::Matrix::insertRows(), Column::insertRows(), future::Matrix::mirrorHorizontally(), future::Matrix::mirrorVertically(), AbstractAspect::moveChild(), future::Table::moveColumn(), future::Table::prepareAspectRemoval(), AbstractAspect::removeChild(), future::Matrix::removeColumns(), future::Matrix::removeRows(), future::Table::removeRows(), Column::removeRows(), AbstractAspect::reparentChild(), Column::replaceDateTimes(), Column::replaceTexts(), Column::replaceValues(), AbstractAspect::setCaptionSpec(), future::Matrix::setCell(), future::Matrix::setColumnCells(), Column::setColumnMode(), AbstractAspect::setComment(), future::Matrix::setCoordinates(), AbstractAspect::setCreationTime(), Column::setDateTimeAt(), future::Matrix::setDimensions(), future::Matrix::setDisplayedDigits(), DateTime2StringFilter::setFormat(), String2DateTimeFilter::setFormat(), future::Matrix::setFormula(), Column::setFormula(), Column::setInvalid(), Column::setMasked(), AbstractAspect::setName(), Double2StringFilter::setNumDigits(), Double2StringFilter::setNumericFormat(), future::Matrix::setNumericFormat(), Column::setPlotDesignation(), future::Matrix::setRowCells(), future::Table::setRowCount(), Column::setTextAt(), Column::setValueAt(), future::Matrix::setXEnd(), future::Matrix::setXStart(), future::Matrix::setYEnd(), future::Matrix::setYStart(), and future::Matrix::transpose().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ folder()

future::Folder * AbstractAspect::folder ( )
inherited

Return the folder the Aspect is contained in or 0 if not.

The returned folder may be the aspect itself if it inherits Folder.

Definition at line 316 of file AbstractAspect.cpp.

317 {
318  if(inherits("future::Folder")) return static_cast<future::Folder *>(this);
319  AbstractAspect * parent_aspect = parentAspect();
320  while(parent_aspect && !parent_aspect->inherits("future::Folder"))
321  parent_aspect = parent_aspect->parentAspect();
322  return static_cast<future::Folder *>(parent_aspect);
323 }

References AbstractAspect::parentAspect().

Referenced by Project::createFolderContextMenu(), future::Matrix::duplicate(), and readChildAspectElement().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ global()

QVariant AbstractAspect::global ( const QString &  key)
staticinherited

Retrieve a global setting.

Definition at line 360 of file AbstractAspect.cpp.

361 {
362  QString qualified_key = QString(staticMetaObject.className()) + "/" + key;
363  QVariant result = Private::g_settings->value(qualified_key);
364  if (result.isValid())
365  return result;
366  else
367  return Private::g_defaults[qualified_key];
368 }

References AbstractAspect::Private::g_defaults, and AbstractAspect::Private::g_settings.

Referenced by future::Matrix::importImageDialog(), and ProjectConfigPage::ProjectConfigPage().

Here is the caller graph for this function:

◆ icon()

QIcon Folder::icon ( ) const
virtual

Return an icon to be used for decorating my views.

Reimplemented from AbstractAspect.

Definition at line 52 of file future_Folder.cpp.

53 {
54  QIcon result;
55  result.addFile(":/folder_closed.xpm", QSize(), QIcon::Normal, QIcon::Off);
56  result.addFile(":/folder_open.xpm", QSize(), QIcon::Normal, QIcon::On);
57  return result;
58 }

◆ importV0x0001XXCreationTime()

void AbstractAspect::importV0x0001XXCreationTime ( const QString &  str)
inlineinherited

Definition at line 255 of file AbstractAspect.h.

256  {
257  setCreationTime(QDateTime::fromString(str, Qt::LocalDate));
258  }

References AbstractAspect::setCreationTime(), and str.

Referenced by Matrix::setBirthDate().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ index()

int AbstractAspect::index ( ) const
inlineinherited

Return my position in my parent's list of children.

Definition at line 137 of file AbstractAspect.h.

137 { return parentAspect() ? parentAspect()->indexOfChild(this) : 0; }

References AbstractAspect::indexOfChild(), and AbstractAspect::parentAspect().

Referenced by AbstractAspect::Private::child(), AbstractAspect::child(), future::Table::column(), future::Table::Private::column(), AbstractAspect::completeAspectInsertion(), future::Table::completeAspectInsertion(), future::Table::handleDataChange(), future::Table::handleDescriptionChange(), future::Table::handleModeChange(), future::Table::handlePlotDesignationChange(), future::Table::handleRowsInserted(), future::Table::handleRowsRemoved(), AbstractAspect::insertChild(), AbstractAspect::Private::insertChild(), AbstractAspect::Private::removeChild(), AbstractAspect::removeChild(), and Column::XmlReadRow().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ indexOfChild()

int AbstractAspect::indexOfChild ( const AbstractAspect child) const
inherited

Return the position of child in my list of children.

Definition at line 191 of file AbstractAspect.cpp.

192 {
194 }

References AbstractAspect::child(), AbstractAspect::d_aspect_private, and AbstractAspect::Private::indexOfChild().

Referenced by AbstractAspect::index(), AbstractAspect::remove(), AbstractAspect::Private::removeChild(), AbstractAspect::removeChild(), and AbstractAspect::reparentChild().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ info()

void AbstractAspect::info ( const QString &  text)
inlineprotectedinherited

Implementations should call this whenever status information should be given to the user.

This will cause statusInfo() to be emitted. Typically, this will cause the specified string to be displayed in a status bar, a log window or some similar non-blocking way so as not to disturb the workflow.

Definition at line 307 of file AbstractAspect.h.

307 { emit statusInfo(text); }

References AbstractAspect::statusInfo().

Referenced by AbstractAspect::addChild(), AbstractAspect::insertChild(), AbstractAspect::reparentChild(), and AbstractAspect::setName().

Here is the caller graph for this function:

◆ insertChild()

void AbstractAspect::insertChild ( AbstractAspect child,
int  index 
)
inherited

Insert the given Aspect at a specific position in my list of children.

Definition at line 128 of file AbstractAspect.cpp.

129 {
130  Q_CHECK_PTR(child);
131  QString new_name = d_aspect_private->uniqueNameFor(child->name());
132  beginMacro(tr("%1: insert %2 at position %3.").arg(name()).arg(new_name).arg(index+1));
133  if (new_name != child->name()) {
134  info(tr("Renaming \"%1\" to \"%2\" in order to avoid name collision.").arg(child->name()).arg(new_name));
135  child->setName(new_name);
136  }
139  endMacro();
140 }

References AbstractAspect::beginMacro(), AbstractAspect::child(), AbstractAspect::completeAspectInsertion(), AbstractAspect::d_aspect_private, AbstractAspect::endMacro(), AbstractAspect::exec(), AbstractAspect::index(), AbstractAspect::info(), AbstractAspect::name(), AbstractAspect::setName(), and AbstractAspect::Private::uniqueNameFor().

Referenced by AbstractAspect::Private::addChild(), and future::Table::insertColumns().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ isDescendantOf()

bool AbstractAspect::isDescendantOf ( AbstractAspect other)
inherited

Return whether the there is a path upwards to the given aspect.

This also returns true if other==this.

Definition at line 325 of file AbstractAspect.cpp.

326 {
327  if(other == this) return true;
328  AbstractAspect * parent_aspect = parentAspect();
329  while(parent_aspect)
330  {
331  if(parent_aspect == other) return true;
332  parent_aspect = parent_aspect->parentAspect();
333  }
334  return false;
335 }

References AbstractAspect::parentAspect().

Here is the call graph for this function:

◆ load()

bool Folder::load ( XmlStreamReader reader)
virtual

Load from XML.

Reimplemented from AbstractAspect.

Reimplemented in Project.

Definition at line 83 of file future_Folder.cpp.

84 {
85  if(reader->isStartElement() && reader->name() == "folder")
86  {
87  setComment("");
89 
90  if (!readBasicAttributes(reader)) return false;
91 
92  // read child elements
93  while (!reader->atEnd())
94  {
95  reader->readNext();
96 
97  if (reader->isEndElement()) break;
98 
99  if (reader->isStartElement())
100  {
101  if (reader->name() == "comment")
102  {
103  if (!readCommentElement(reader))
104  return false;
105  }
106  else if(reader->name() == "child_aspect")
107  {
108  if (!readChildAspectElement(reader))
109  return false;
110  }
111  else // unknown element
112  {
113  reader->raiseWarning(tr("unknown element '%1'").arg(reader->name().toString()));
114  if (!reader->skipToEndElement()) return false;
115  }
116  }
117  }
118  }
119  else // no folder element
120  reader->raiseError(tr("no folder element found"));
121 
122  return !reader->hasError();
123 }

References XmlStreamReader::raiseError(), XmlStreamReader::raiseWarning(), AbstractAspect::readBasicAttributes(), readChildAspectElement(), AbstractAspect::readCommentElement(), AbstractAspect::removeAllChildAspects(), AbstractAspect::setComment(), and XmlStreamReader::skipToEndElement().

Referenced by Project::load(), and readChildAspectElement().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ moveChild()

void AbstractAspect::moveChild ( int  from,
int  to 
)
inherited

Change the positon of a child in my list of children.

Definition at line 196 of file AbstractAspect.cpp.

197 {
198  Q_ASSERT(0 <= from && from < d_aspect_private->childCount());
199  Q_ASSERT(0 <= to && to < d_aspect_private->childCount());
200  exec(new AspectChildMoveCmd(d_aspect_private, from, to));
201 }

References AbstractAspect::childCount(), AbstractAspect::d_aspect_private, and AbstractAspect::exec().

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

Here is the call graph for this function:
Here is the caller graph for this function:

◆ name()

QString AbstractAspect::name ( ) const
inherited

Definition at line 229 of file AbstractAspect.cpp.

230 {
231  return d_aspect_private->name();
232 }

References AbstractAspect::d_aspect_private, and AbstractAspect::Private::name().

Referenced by AbstractAspect::addChild(), future::Table::addColumn(), future::Matrix::addColumns(), future::Table::addColumns(), Filter::addResultCurve(), future::Matrix::addRows(), future::Table::addRows(), TableView::applyType(), AspectChildAddCmd::AspectChildAddCmd(), AspectChildRemoveCmd::AspectChildRemoveCmd(), AspectChildReparentCmd::AspectChildReparentCmd(), future::Matrix::clear(), future::Table::clear(), future::Table::clearMasks(), future::Matrix::clearSelectedCells(), future::Table::clearSelectedCells(), future::Matrix::clearSelectedColumns(), future::Table::clearSelectedColumns(), future::Matrix::clearSelectedRows(), Table::colLabel(), Table::colNames(), future::Table::column(), Table::columnsList(), future::Matrix::copy(), future::Table::copy(), future::Matrix::cutSelection(), future::Table::cutSelection(), DateTime2StringFilterSetFormatCmd::DateTime2StringFilterSetFormatCmd(), ApplicationWindow::defineErrorBars(), Double2StringFilterSetDigitsCmd::Double2StringFilterSetDigitsCmd(), Double2StringFilterSetFormatCmd::Double2StringFilterSetFormatCmd(), Table::drawableColumnSelection(), future::Matrix::duplicate(), future::Table::export_to_TeX(), future::Table::fillSelectedCellsWithRandomNumbers(), future::Table::fillSelectedCellsWithRowNumbers(), TableView::handleAspectAdded(), Matrix::handleAspectDescriptionChange(), Table::handleAspectDescriptionChange(), TableView::handleAspectDescriptionChanged(), Table::importASCII(), ApplicationWindow::importASCII(), Table::init(), AbstractAspect::insertChild(), future::Matrix::insertColumns(), future::Table::insertColumns(), future::Matrix::insertEmptyColumns(), future::Table::insertEmptyColumns(), future::Matrix::insertEmptyRows(), future::Table::insertEmptyRows(), future::Matrix::insertRows(), future::Table::insertRows(), future::Table::maskSelection(), future::Table::moveColumn(), Matrix::name(), future::Matrix::Private::name(), future::Table::Private::name(), future::Table::normalizeColumns(), future::Table::normalizeSelection(), Differentiation::output(), future::Matrix::pasteIntoSelection(), future::Table::pasteIntoSelection(), AbstractAspect::path(), AbstractAspect::readBasicAttributes(), future::Table::recalculateSelectedCells(), AbstractAspect::removeAllChildAspects(), AbstractAspect::removeChild(), future::Matrix::removeColumns(), future::Table::removeColumns(), future::Matrix::removeRows(), future::Table::removeRows(), future::Matrix::removeSelectedColumns(), future::Table::removeSelectedColumns(), future::Matrix::removeSelectedRows(), future::Table::removeSelectedRows(), AbstractAspect::reparentChild(), Table::selectedColumns(), Table::selectedErrColumns(), Table::selectedYColumns(), Table::selectedYLabels(), TableView::setColumnForControlTabs(), Column::setColumnMode(), future::Matrix::setDimensions(), Graph::setLabelsTextFormat(), future::Table::setRowCount(), future::Table::setSelectionAs(), future::Table::showTeXTableExportDialog(), future::Table::sortColumns(), String2DateTimeFilterSetFormatCmd::String2DateTimeFilterSetFormatCmd(), TableMoveColumnCmd::TableMoveColumnCmd(), ApplicationWindow::tableWindows(), AbstractAspect::Private::uniqueNameFor(), future::Table::unmaskSelection(), AbstractAspect::writeBasicAttributes(), and Table::YColumns().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ parentAspect()

AbstractAspect * AbstractAspect::parentAspect ( ) const
inherited

Return my parent Aspect or 0 if I currently don't have one.

Definition at line 109 of file AbstractAspect.cpp.

110 {
111  return d_aspect_private->parent();
112 }

References AbstractAspect::d_aspect_private, and AbstractAspect::Private::parent().

Referenced by DateTime2StringFilterSetFormatCmd::DateTime2StringFilterSetFormatCmd(), Double2StringFilterSetDigitsCmd::Double2StringFilterSetDigitsCmd(), Double2StringFilterSetFormatCmd::Double2StringFilterSetFormatCmd(), AbstractAspect::folder(), TableView::handleAspectAdded(), TableView::handleAspectDescriptionChanged(), AbstractAspect::index(), AbstractAspect::isDescendantOf(), AbstractAspect::path(), AbstractAspect::project(), AbstractAspect::remove(), Graph::setLabelsTextFormat(), String2DateTimeFilterSetFormatCmd::String2DateTimeFilterSetFormatCmd(), and AbstractAspect::undoStack().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ path()

virtual QString AbstractAspect::path ( ) const
inlinevirtualinherited

Return the path that leads from the top-most Aspect (usually a Project) to me.

Reimplemented in Project.

Definition at line 154 of file AbstractAspect.h.

154 { return parentAspect() ? parentAspect()->path() + "/" + name() : ""; }

References AbstractAspect::name(), AbstractAspect::parentAspect(), and AbstractAspect::path().

Referenced by AbstractAspect::path().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ prepareAspectRemoval()

virtual void AbstractAspect::prepareAspectRemoval ( AbstractAspect aspect)
inlineprotectedvirtualinherited

Called before a child is removed.

Unlike the aspectAboutToBeRemoved() signals, this method does not get called inside undo/redo actions; allowing subclasses to execute undo commands of their own.

Reimplemented in future::Table.

Definition at line 300 of file AbstractAspect.h.

300 { Q_UNUSED(aspect); }

Referenced by AbstractAspect::removeChild(), and AbstractAspect::reparentChild().

Here is the caller graph for this function:

◆ project() [1/2]

virtual Project* AbstractAspect::project ( )
inlinevirtualinherited

Return the Project this Aspect belongs to, or 0 if it is currently not part of one.

Reimplemented in Project.

Definition at line 152 of file AbstractAspect.h.

152 { return parentAspect() ? parentAspect()->project() : 0; }

References AbstractAspect::parentAspect(), and AbstractAspect::project().

Here is the call graph for this function:

◆ project() [2/2]

virtual const Project* AbstractAspect::project ( ) const
inlinevirtualinherited

Return the Project this Aspect belongs to, or 0 if it is currently not part of one.

Reimplemented in Project.

Definition at line 150 of file AbstractAspect.h.

150 { return parentAspect() ? parentAspect()->project() : 0; }

References AbstractAspect::parentAspect(), and AbstractAspect::project().

Referenced by createContextMenu(), and AbstractAspect::project().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ readBasicAttributes()

bool AbstractAspect::readBasicAttributes ( XmlStreamReader reader)
protectedinherited

Load name, creation time and caption spec from XML.

Returns
false on error

Definition at line 77 of file AbstractAspect.cpp.

78 {
79  QString prefix(tr("XML read error: ","prefix for XML error messages"));
80  QString postfix(tr(" (non-critical)", "postfix for XML error messages"));
81 
82  QXmlStreamAttributes attribs = reader->attributes();
83  QString str;
84 
85  // read name
86  str = attribs.value(reader->namespaceUri().toString(), "name").toString();
87  if(str.isEmpty())
88  {
89  reader->raiseWarning(prefix+tr("aspect name missing or empty")+postfix);
90  }
91  setName(str);
92  // read creation time
93  str = attribs.value(reader->namespaceUri().toString(), "creation_time").toString();
94  QDateTime creation_time = QDateTime::fromString(str, "yyyy-dd-MM hh:mm:ss:zzz");
95  if(str.isEmpty() || !creation_time.isValid())
96  {
97  reader->raiseWarning(tr("Invalid creation time for '%1'. Using current time.").arg(name()));
98  setCreationTime(QDateTime::currentDateTime());
99  }
100  else
101  setCreationTime(creation_time);
102  // read caption spec
103  str = attribs.value(reader->namespaceUri().toString(), "caption_spec").toString();
105 
106  return true;
107 }

References AbstractAspect::name(), XmlStreamReader::raiseWarning(), AbstractAspect::setCaptionSpec(), AbstractAspect::setCreationTime(), AbstractAspect::setName(), and str.

Referenced by load(), future::Matrix::load(), future::Table::load(), AbstractSimpleFilter::load(), and Column::load().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ readChildAspectElement()

bool Folder::readChildAspectElement ( XmlStreamReader reader)
protected

Read child aspect from XML.

Definition at line 125 of file future_Folder.cpp.

126 {
127  bool loaded = false;
128  Q_ASSERT(reader->isStartElement() && reader->name() == "child_aspect");
129 
130  if (!reader->skipToNextTag()) return false;
131  if (reader->isEndElement() && reader->name() == "child_aspect") return true; // empty element tag
132  QString element_name = reader->name().toString();
133  if (element_name == "folder")
134  {
135  Folder * folder = new Folder(tr("Folder %1").arg(1));
136  if (!folder->load(reader))
137  {
138  delete folder;
139  return false;
140  }
141  addChild(folder);
142  loaded = true;
143  }
144  else if (element_name == "column")
145  {
146  Column * column = new Column(tr("Column %1").arg(1), SciDAVis::Text);
147  if (!column->load(reader))
148  {
149  delete column;
150  return false;
151  }
152  addChild(column);
153  loaded = true;
154  }
155  else
156  {
157  foreach(QObject * plugin, QPluginLoader::staticInstances())
158  {
159  XmlElementAspectMaker * maker = qobject_cast<XmlElementAspectMaker *>(plugin);
160  if (maker && maker->canCreate(element_name))
161  {
162  AbstractAspect * aspect = maker->createAspectFromXml(reader);
163  if (aspect)
164  {
165  addChild(aspect);
166  loaded = true;
167  break;
168  }
169  else
170  {
171  reader->raiseError(tr("creation of aspect from element '%1' failed").arg(element_name));
172  return false;
173  }
174  }
175  }
176  }
177  if (!loaded)
178  {
179  reader->raiseWarning(tr("no plugin to load element '%1' found").arg(element_name));
180  if (!reader->skipToEndElement()) return false;
181  }
182  if (!reader->skipToNextTag()) return false;
183  Q_ASSERT(reader->isEndElement() && reader->name() == "child_aspect");
184  return !reader->hasError();
185 }

References AbstractAspect::addChild(), XmlElementAspectMaker::canCreate(), XmlElementAspectMaker::createAspectFromXml(), AbstractAspect::folder(), Folder(), load(), Column::load(), XmlStreamReader::raiseError(), XmlStreamReader::raiseWarning(), XmlStreamReader::skipToEndElement(), XmlStreamReader::skipToNextTag(), and SciDAVis::Text.

Referenced by load().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ readCommentElement()

bool AbstractAspect::readCommentElement ( XmlStreamReader reader)
protectedinherited

Load comment from an XML element.

Definition at line 61 of file AbstractAspect.cpp.

62 {
63  Q_ASSERT(reader->isStartElement() && reader->name() == "comment");
64  QString temp = reader->readElementText();
65  temp.replace("\\n", "\n");
66  setComment(temp);
67  return true;
68 }

References AbstractAspect::setComment().

Referenced by load(), future::Matrix::load(), future::Table::load(), AbstractSimpleFilter::load(), and Column::load().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ remove

virtual void AbstractAspect::remove ( )
inlinevirtualslotinherited

Remove me from my parent's list of children.

Definition at line 250 of file AbstractAspect.h.

References AbstractAspect::indexOfChild(), AbstractAspect::parentAspect(), and AbstractAspect::removeChild().

Referenced by Matrix::closeEvent(), PartMdiView::closeEvent(), AbstractAspect::createContextMenu(), Table::importASCII(), Column::Private::removeRows(), and future::Matrix::Private::removeRows().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ removeAllChildAspects()

void AbstractAspect::removeAllChildAspects ( )
virtualinherited

Remove all child aspects.

Definition at line 352 of file AbstractAspect.cpp.

353 {
354  beginMacro(tr("%1: remove all children.").arg(name()));
355  for (int i=childCount()-1; i >= 0; i--)
356  removeChild(i);
357  endMacro();
358 }

References AbstractAspect::beginMacro(), AbstractAspect::childCount(), AbstractAspect::endMacro(), AbstractAspect::name(), and AbstractAspect::removeChild().

Referenced by load().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ removeChild() [1/2]

void AbstractAspect::removeChild ( AbstractAspect child,
bool  detach = false 
)
inherited

Remove the given Aspect from my list of children.

Usually, the ownership of the child is transfered to the undo command, i.e., the aspect is deleted by the undo command. But by setting detach to true, you can remove a child from the Aspect tree without deleting it. Of course, that means whovere detaches an Aspect in responsible for deleting it (or re-attaching it somewhere in the tree).

See also
reparentChild()

Definition at line 142 of file AbstractAspect.cpp.

143 {
144  Q_ASSERT(indexOfChild(child) != -1);
145  beginMacro(tr("%1: remove %2.").arg(name()).arg(child->name()));
148  endMacro();
149 }

References AbstractAspect::beginMacro(), AbstractAspect::child(), AbstractAspect::d_aspect_private, AbstractAspect::endMacro(), AbstractAspect::exec(), AbstractAspect::indexOfChild(), AbstractAspect::name(), and AbstractAspect::prepareAspectRemoval().

Referenced by AbstractAspect::remove(), AbstractAspect::removeAllChildAspects(), AbstractAspect::removeChild(), future::Table::removeColumns(), ApplicationWindow::removeDependentTableStatistics(), and Column::setColumnMode().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ removeChild() [2/2]

void AbstractAspect::removeChild ( int  index)
inherited

Remove the Aspect at the given index from my list of children.

The ownership of the child is transfered to the undo command, i.e., the aspect is deleted by the undo command.

See also
reparentChild()

Definition at line 174 of file AbstractAspect.cpp.

175 {
176  Q_ASSERT(index >= 0 && index <= childCount());
178 }

References AbstractAspect::Private::child(), AbstractAspect::childCount(), AbstractAspect::d_aspect_private, AbstractAspect::index(), and AbstractAspect::removeChild().

Here is the call graph for this function:

◆ reparentChild() [1/2]

void AbstractAspect::reparentChild ( AbstractAspect new_parent,
AbstractAspect child 
)
inherited

Move a child to another aspect and transfer ownership.

Definition at line 151 of file AbstractAspect.cpp.

152 {
153  Q_ASSERT(new_parent != NULL);
154  reparentChild(new_parent, child, new_parent->childCount());
155 }

References AbstractAspect::child(), AbstractAspect::childCount(), and AbstractAspect::reparentChild().

Here is the call graph for this function:

◆ reparentChild() [2/2]

void AbstractAspect::reparentChild ( AbstractAspect new_parent,
AbstractAspect child,
int  d_new_index 
)
inherited

Move a child to another aspect and transfer ownership.

Definition at line 157 of file AbstractAspect.cpp.

158 {
159  Q_ASSERT(indexOfChild(child) != -1);
160  Q_ASSERT(new_index > 0 && new_index <= new_parent->childCount());
161  Q_ASSERT(new_parent != NULL);
162  QString new_name = new_parent->d_aspect_private->uniqueNameFor(child->name());
163  beginMacro(tr("%1: move %2 to %3.").arg(name()).arg(child->name()).arg(new_parent->name()));
164  if (new_name != child->name()) {
165  info(tr("Renaming \"%1\" to \"%2\" in order to avoid name collision.").arg(child->name()).arg(new_name));
166  child->setName(new_name);
167  }
169  exec(new AspectChildReparentCmd(d_aspect_private, new_parent->d_aspect_private, child, new_index));
170  new_parent->completeAspectInsertion(child, new_index);
171  endMacro();
172 }

References AbstractAspect::beginMacro(), AbstractAspect::child(), AbstractAspect::childCount(), AbstractAspect::completeAspectInsertion(), AbstractAspect::d_aspect_private, AbstractAspect::endMacro(), AbstractAspect::exec(), AbstractAspect::indexOfChild(), AbstractAspect::info(), AbstractAspect::name(), AbstractAspect::prepareAspectRemoval(), AbstractAspect::setName(), and AbstractAspect::Private::uniqueNameFor().

Referenced by AbstractAspect::reparentChild().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ save()

void Folder::save ( QXmlStreamWriter *  writer) const
virtual

Save as XML.

Reimplemented from AbstractAspect.

Reimplemented in Project.

Definition at line 67 of file future_Folder.cpp.

68 {
69  writer->writeStartElement("folder");
70  writeBasicAttributes(writer);
71  writeCommentElement(writer);
72 
73  int child_count = childCount();
74  for (int i=0; i<child_count; i++)
75  {
76  writer->writeStartElement("child_aspect");
77  child(i)->save(writer);
78  writer->writeEndElement(); // "child_aspect"
79  }
80  writer->writeEndElement(); // "folder"
81 }

References AbstractAspect::child(), AbstractAspect::childCount(), AbstractAspect::save(), AbstractAspect::writeBasicAttributes(), and AbstractAspect::writeCommentElement().

Referenced by Project::save().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ setCaptionSpec

void AbstractAspect::setCaptionSpec ( const QString &  value)
slotinherited

Set the specification string used for constructing the caption().

The caption is constructed by substituting some magic tokens in the specification:

Additionally, you can use the construct C{<text>}. <text> is only shown in the caption if comment() is not empty (name and creation time should never be empty).

The default caption specification is "%n%C{ - }%c".

Definition at line 276 of file AbstractAspect.cpp.

277 {
278  if (value == d_aspect_private->captionSpec()) return;
280 }

References AbstractAspect::Private::captionSpec(), AbstractAspect::d_aspect_private, and AbstractAspect::exec().

Referenced by future::Table::copy(), AbstractAspect::readBasicAttributes(), and Matrix::setCaptionPolicy().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ setComment

void AbstractAspect::setComment ( const QString &  value)
slotinherited

Definition at line 265 of file AbstractAspect.cpp.

266 {
267  if (value == d_aspect_private->comment()) return;
269 }

References AbstractAspect::Private::comment(), AbstractAspect::d_aspect_private, and AbstractAspect::exec().

Referenced by future::Table::copy(), ImportOPJ::importSpreadsheet(), load(), future::Matrix::load(), future::Table::load(), Column::load(), AbstractAspect::readCommentElement(), Table::setColComment(), Table::setColComments(), and Matrix::setWindowLabel().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ setCreationTime()

void AbstractAspect::setCreationTime ( const QDateTime &  time)
protectedinherited

Set the creation time.

The creation time will automatically be set when the aspect object is created. This function is usually only needed when the aspect is loaded from a file.

Definition at line 282 of file AbstractAspect.cpp.

283 {
284  if (time == d_aspect_private->creationTime()) return;
286 }

References AbstractAspect::Private::creationTime(), AbstractAspect::d_aspect_private, and AbstractAspect::exec().

Referenced by AbstractAspect::importV0x0001XXCreationTime(), and AbstractAspect::readBasicAttributes().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ setGlobal()

void AbstractAspect::setGlobal ( const QString &  key,
const QVariant &  value 
)
staticinherited

Update a global setting.

Definition at line 370 of file AbstractAspect.cpp.

371 {
372  Private::g_settings->setValue(QString(staticMetaObject.className()) + "/" + key, value);
373 }

References AbstractAspect::Private::g_settings.

Referenced by ProjectConfigPage::apply(), and future::Matrix::importImageDialog().

Here is the caller graph for this function:

◆ setGlobalDefault()

void AbstractAspect::setGlobalDefault ( const QString &  key,
const QVariant &  value 
)
staticinherited

Set default value for a global setting.

Definition at line 375 of file AbstractAspect.cpp.

376 {
377  Private::g_defaults[QString(staticMetaObject.className()) + "/" + key] = value;
378 }

References AbstractAspect::Private::g_defaults.

◆ setName

void AbstractAspect::setName ( const QString &  value)
slotinherited

Definition at line 234 of file AbstractAspect.cpp.

235 {
236  if (value.isEmpty()) {
237  setObjectName("1");
238  return;
239  }
240  if (value == d_aspect_private->name()) return;
241  // Until we get around to completely sanitizing the project file format, we have to remove
242  // characters that can easily break file save/restore.
243  // FIXME: once the project file format is fully XML-based (i.e. able to escape special characters),
244  // this can be removed
245  QString sanitized_value = value;
246  sanitized_value.remove(QChar('\n'));
247  sanitized_value.remove(QChar('\r'));
248  sanitized_value.remove(QChar('\t'));
249  if (sanitized_value != value)
250  info(tr("Tabs and line breaks in object names are currently not supported. They have been removed."));
251  if (d_aspect_private->parent()) {
252  QString new_name = d_aspect_private->parent()->uniqueNameFor(sanitized_value);
253  if (new_name != sanitized_value)
254  info(tr("Intended name \"%1\" diverted to \"%2\" in order to avoid name collision.").arg(sanitized_value).arg(new_name));
255  exec(new AspectNameChangeCmd(d_aspect_private, new_name));
256  } else
257  exec(new AspectNameChangeCmd(d_aspect_private, sanitized_value));
258 }

References AbstractAspect::d_aspect_private, AbstractAspect::exec(), AbstractAspect::info(), AbstractAspect::Private::name(), AbstractAspect::Private::parent(), and AbstractAspect::uniqueNameFor().

Referenced by AbstractAspect::addChild(), Table::importASCII(), ApplicationWindow::importASCII(), ImportOPJ::importSpreadsheet(), Table::importV0x0001XXHeader(), AbstractAspect::insertChild(), Column::Private::Private(), AbstractAspect::readBasicAttributes(), AbstractAspect::reparentChild(), Column::Private::replaceModeData(), Table::setColName(), Column::Private::setColumnMode(), Table::setHeader(), and Matrix::setName().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ statusInfo

void AbstractAspect::statusInfo ( const QString &  text)
signalinherited

Emit this to give status information to the user.

Referenced by AbstractAspect::info(), and AbstractAspect::Private::insertChild().

Here is the caller graph for this function:

◆ undoStack()

virtual QUndoStack* AbstractAspect::undoStack ( ) const
inlinevirtualinherited

Return the undo stack of the Project, or 0 if this Aspect is not part of a Project.

It's also possible to construct undo-enabled Aspect trees without Project. The only requirement is that the root Aspect reimplements undoStack() to get the undo stack from somewhere (the default implementation just delegates to parentAspect()).

Reimplemented in Project.

Definition at line 182 of file AbstractAspect.h.

182 { return parentAspect() ? parentAspect()->undoStack() : 0; }

References AbstractAspect::parentAspect(), and AbstractAspect::undoStack().

Referenced by AbstractAspect::beginMacro(), AbstractAspect::endMacro(), AbstractAspect::exec(), and AbstractAspect::undoStack().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ uniqueNameFor

QString AbstractAspect::uniqueNameFor ( const QString &  current_name) const
slotinherited

Make the specified name unique among my children by incrementing a trailing number.

Definition at line 337 of file AbstractAspect.cpp.

338 {
339  return d_aspect_private->uniqueNameFor(current_name);
340 }

References AbstractAspect::d_aspect_private, and AbstractAspect::Private::uniqueNameFor().

Referenced by AbstractAspect::setName().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ writeBasicAttributes()

void AbstractAspect::writeBasicAttributes ( QXmlStreamWriter *  writer) const
protectedinherited

Save name, creation time and caption spec to XML.

Definition at line 70 of file AbstractAspect.cpp.

71 {
72  writer->writeAttribute("creation_time" , creationTime().toString("yyyy-dd-MM hh:mm:ss:zzz"));
73  writer->writeAttribute("caption_spec", captionSpec());
74  writer->writeAttribute("name", name());
75 }

References AbstractAspect::captionSpec(), AbstractAspect::creationTime(), AbstractAspect::name(), and toString().

Referenced by save(), future::Matrix::save(), future::Table::save(), AbstractSimpleFilter::save(), and Column::save().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ writeCommentElement()

void AbstractAspect::writeCommentElement ( QXmlStreamWriter *  writer) const
protectedinherited

Save the comment to XML.

Definition at line 52 of file AbstractAspect.cpp.

53 {
54  writer->writeStartElement("comment");
55  QString temp = comment();
56  temp.replace("\n", "\\n");
57  writer->writeCDATA(temp);
58  writer->writeEndElement();
59 }

References AbstractAspect::comment().

Referenced by save(), future::Matrix::save(), future::Table::save(), AbstractSimpleFilter::save(), and Column::save().

Here is the call graph for this function:
Here is the caller graph for this function:

Member Data Documentation

◆ d_aspect_private


The documentation for this class was generated from the following files:
AspectNameChangeCmd
Definition: aspectcommands.h:36
AbstractAspect::Private::comment
QString comment() const
Definition: AspectPrivate.cpp:134
AbstractAspect::writeCommentElement
void writeCommentElement(QXmlStreamWriter *writer) const
Save the comment to XML.
Definition: AbstractAspect.cpp:52
AbstractAspect::reparentChild
void reparentChild(AbstractAspect *new_parent, AbstractAspect *child, int d_new_index)
Move a child to another aspect and transfer ownership.
Definition: AbstractAspect.cpp:157
XmlStreamReader::skipToNextTag
bool skipToNextTag()
Go to the next start or end element tag.
Definition: XmlStreamReader.cpp:92
AbstractAspect::Private::captionSpec
QString captionSpec() const
Definition: AspectPrivate.cpp:146
AbstractAspect::Private::caption
QString caption() const
Definition: AspectPrivate.cpp:171
AbstractAspect::exec
void exec(QUndoCommand *command)
Execute the given command, pushing it on the undoStack() if available.
Definition: AbstractAspect.cpp:203
XmlStreamReader::raiseError
void raiseError(const QString &message=QString())
Definition: XmlStreamReader.cpp:80
str
#define str(x)
Definition: PythonScripting.cpp:41
AbstractAspect::setComment
void setComment(const QString &value)
Definition: AbstractAspect.cpp:265
AbstractAspect::Private::uniqueNameFor
QString uniqueNameFor(const QString &current_name) const
Definition: AspectPrivate.cpp:201
AbstractAspect::removeAllChildAspects
virtual void removeAllChildAspects()
Remove all child aspects.
Definition: AbstractAspect.cpp:352
AbstractAspect::Private::childCount
int childCount() const
Definition: AspectPrivate.cpp:111
Column
Aspect that manages a column.
Definition: Column.h:59
AbstractAspect::index
int index() const
Return my position in my parent's list of children.
Definition: AbstractAspect.h:137
AbstractAspect::creationTime
QDateTime creationTime() const
Definition: AbstractAspect.cpp:288
AspectChildAddCmd
Definition: aspectcommands.h:154
XmlElementAspectMaker::canCreate
virtual bool canCreate(const QString &element_name)=0
Determine whether the loader can handle the given element.
toString
S toString(const QString &x)
Deal with conversion between QString and std::string/std::wstring in a generic way.
AspectChildMoveCmd
Definition: aspectcommands.h:168
AbstractAspect::d_aspect_private
Private * d_aspect_private
Definition: AbstractAspect.h:310
AbstractAspect::descendantsThatInherit
QList< AbstractAspect * > descendantsThatInherit(const char *class_name)
Get all descendents that inherit the given class.
Definition: AbstractAspect.cpp:342
future::Folder
Folder in a project.
Definition: future_Folder.h:38
AbstractAspect::uniqueNameFor
QString uniqueNameFor(const QString &current_name) const
Make the specified name unique among my children by incrementing a trailing number.
Definition: AbstractAspect.cpp:337
future::Folder::Folder
Folder(const QString &name)
Definition: future_Folder.cpp:43
AbstractAspect::Private::indexOfChild
int indexOfChild(const AbstractAspect *child) const
Definition: AspectPrivate.cpp:91
XmlStreamReader::skipToEndElement
bool skipToEndElement()
Go to the end element tag of the current element.
Definition: XmlStreamReader.cpp:121
AbstractAspect::indexOfChild
int indexOfChild(const AbstractAspect *child) const
Return the position of child in my list of children.
Definition: AbstractAspect.cpp:191
Project::createFolderContextMenu
virtual QMenu * createFolderContextMenu(const ::future::Folder *folder) const
Definition: Project.cpp:118
AbstractAspect::endMacro
void endMacro()
End the undo stack macro.
Definition: AbstractAspect.cpp:222
AbstractAspect::captionSpec
QString captionSpec() const
Return the specification string used for constructing the caption().
Definition: AbstractAspect.cpp:271
AbstractAspect::Private::g_defaults
static QHash< QString, QVariant > g_defaults
Definition: AspectPrivate.h:70
XmlElementAspectMaker
Factory that creates an aspect out of an XML element.
Definition: interfaces.h:118
AbstractAspect::beginMacro
void beginMacro(const QString &text)
Begin an undo stack macro (series of commands)
Definition: AbstractAspect.cpp:215
AbstractAspect::statusInfo
void statusInfo(const QString &text)
Emit this to give status information to the user.
XmlElementAspectMaker::createAspectFromXml
virtual AbstractAspect * createAspectFromXml(XmlStreamReader *reader)=0
The factory method.
AspectCaptionSpecChangeCmd
Definition: aspectcommands.h:78
AspectCommentChangeCmd
Definition: aspectcommands.h:57
AbstractAspect::childCount
int childCount() const
Return the number of child Aspects.
Definition: AbstractAspect.cpp:186
AbstractAspect::completeAspectInsertion
virtual void completeAspectInsertion(AbstractAspect *aspect, int index)
Called after a new child has been inserted or added.
Definition: AbstractAspect.h:294
Column::load
bool load(XmlStreamReader *reader) override
Load the column from XML.
Definition: Column.cpp:364
AbstractAspect::name
QString name() const
Definition: AbstractAspect.cpp:229
AbstractAspect::path
virtual QString path() const
Return the path that leads from the top-most Aspect (usually a Project) to me.
Definition: AbstractAspect.h:154
AbstractAspect::readBasicAttributes
bool readBasicAttributes(XmlStreamReader *reader)
Load name, creation time and caption spec from XML.
Definition: AbstractAspect.cpp:77
AbstractAspect::child
AbstractAspect * child(int index) const
Get a child by its position in my list of children.
Definition: AbstractAspect.cpp:180
Folder
Folder for the project explorer.
Definition: Folder.h:62
AbstractAspect::Private::name
QString name() const
Definition: AspectPrivate.cpp:122
AbstractAspect::undoStack
virtual QUndoStack * undoStack() const
Return the undo stack of the Project, or 0 if this Aspect is not part of a Project.
Definition: AbstractAspect.h:182
SciDAVis::Text
@ Text
column contains strings
Definition: globals.h:68
AspectChildReparentCmd
Definition: aspectcommands.h:195
AbstractAspect::parentAspect
AbstractAspect * parentAspect() const
Return my parent Aspect or 0 if I currently don't have one.
Definition: AbstractAspect.cpp:109
AbstractAspect::writeBasicAttributes
void writeBasicAttributes(QXmlStreamWriter *writer) const
Save name, creation time and caption spec to XML.
Definition: AbstractAspect.cpp:70
AbstractAspect::folder
future::Folder * folder()
Return the folder the Aspect is contained in or 0 if not.
Definition: AbstractAspect.cpp:316
AbstractAspect::removeChild
void removeChild(AbstractAspect *child, bool detach=false)
Remove the given Aspect from my list of children.
Definition: AbstractAspect.cpp:142
AbstractAspect::Private::creationTime
QDateTime creationTime() const
Definition: AspectPrivate.cpp:196
AbstractAspect::project
virtual const Project * project() const
Return the Project this Aspect belongs to, or 0 if it is currently not part of one.
Definition: AbstractAspect.h:150
AbstractAspect::setCaptionSpec
void setCaptionSpec(const QString &value)
Set the specification string used for constructing the caption().
Definition: AbstractAspect.cpp:276
AbstractAspect::Private::parent
AbstractAspect * parent()
Definition: AspectPrivate.h:65
AbstractAspect::setName
void setName(const QString &value)
Definition: AbstractAspect.cpp:234
AbstractAspect::comment
QString comment() const
Definition: AbstractAspect.cpp:260
AspectChildRemoveCmd
Definition: aspectcommands.h:122
AbstractAspect::Private::child
AbstractAspect * child(int index)
Definition: AspectPrivate.cpp:116
AbstractAspect::addChild
void addChild(AbstractAspect *child)
Add the given Aspect to my list of children.
Definition: AbstractAspect.cpp:114
AbstractAspect::AbstractAspect
AbstractAspect(const QString &name)
Definition: AbstractAspect.cpp:42
future::Folder::load
virtual bool load(XmlStreamReader *)
Load from XML.
Definition: future_Folder.cpp:83
AbstractAspect::setCreationTime
void setCreationTime(const QDateTime &time)
Set the creation time.
Definition: AbstractAspect.cpp:282
future::Folder::readChildAspectElement
bool readChildAspectElement(XmlStreamReader *reader)
Read child aspect from XML.
Definition: future_Folder.cpp:125
XmlStreamReader::raiseWarning
void raiseWarning(const QString &message=QString())
Definition: XmlStreamReader.cpp:86
AbstractAspect::save
virtual void save(QXmlStreamWriter *) const
Save as XML.
Definition: AbstractAspect.h:201
AbstractAspect::Private::g_settings
static QSettings * g_settings
Definition: AspectPrivate.h:69
AbstractAspect::readCommentElement
bool readCommentElement(XmlStreamReader *reader)
Load comment from an XML element.
Definition: AbstractAspect.cpp:61
AbstractAspect
Base class of all persistent objects in a Project.
Definition: AbstractAspect.h:86
AbstractAspect::prepareAspectRemoval
virtual void prepareAspectRemoval(AbstractAspect *aspect)
Called before a child is removed.
Definition: AbstractAspect.h:300
AspectCreationTimeChangeCmd
Definition: aspectcommands.h:100
AbstractAspect::info
void info(const QString &text)
Implementations should call this whenever status information should be given to the user.
Definition: AbstractAspect.h:307