SciDAVis
1.D4
|
Base class of all persistent objects in a Project. More...
#include <AbstractAspect.h>
Classes | |
class | Private |
Private data managed by AbstractAspect. More... |
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 ¤t_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 *aspect) |
Emit this from an aspect about to be removed from its parent's children. | |
void | aspectAboutToBeRemoved (const AbstractAspect *parent, int index) |
Emit this from a parent before removing its child. | |
void | aspectAdded (const AbstractAspect *aspect) |
Emit this from a newly added aspect. | |
void | aspectAdded (const AbstractAspect *parent, int index) |
Emit this from a parent after adding a new child to it. | |
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 | statusInfo (const QString &text) |
Emit this to give status information to the user. |
Public Member Functions | |
AbstractAspect (const QString &name) | |
void | addChild (AbstractAspect *child) |
Add the given Aspect to my list of children. | |
QString | caption () const |
QString | captionSpec () const |
Return the specification string used for constructing the caption(). | |
AbstractAspect * | child (int index) const |
Get a child by its position in my list of children. | |
int | childCount () const |
Return the number of child Aspects. | |
QString | comment () const |
virtual QMenu * | createContextMenu () const |
Return a new context menu. | |
QDateTime | creationTime () const |
QList< AbstractAspect * > | descendantsThatInherit (const char *class_name) |
Get all descendents that inherit the given class. | |
future::Folder * | folder () |
Return the folder the Aspect is contained in or 0 if not. | |
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. | |
bool | isDescendantOf (AbstractAspect *other) |
Return whether the there is a path upwards to the given aspect. | |
void | moveChild (int from, int to) |
Change the positon of a child in my list of children. | |
QString | name () const |
AbstractAspect * | parentAspect () 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 const Project * | project () const |
Return the Project this Aspect belongs to, or 0 if it is currently not part of one. | |
virtual Project * | project () |
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 (AbstractAspect *child, bool detach=false) |
Remove the given Aspect from my list of children. | |
void | removeChild (int index) |
Remove the Aspect at the given index from my list of children. | |
void | reparentChild (AbstractAspect *new_parent, AbstractAspect *child, int d_new_index) |
Move a child to another aspect and transfer ownership. | |
void | reparentChild (AbstractAspect *new_parent, AbstractAspect *child) |
Move a child to another aspect and transfer ownership. | |
virtual | ~AbstractAspect () |
undo related | |
virtual QUndoStack * | undoStack () const |
Return the undo stack of the Project, or 0 if this Aspect is not part of a Project. | |
void | exec (QUndoCommand *command) |
Execute the given command, pushing it on the undoStack() if available. | |
void | beginMacro (const QString &text) |
Begin an undo stack macro (series of commands) | |
void | endMacro () |
End the undo stack macro. |
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. |
Private Attributes | |
Private * | d_aspect_private |
Friends | |
class | Private |
serialize/deserialize | |
virtual void | save (QXmlStreamWriter *) const |
Save as XML. | |
virtual bool | load (XmlStreamReader *) |
Load from XML. | |
bool | readBasicAttributes (XmlStreamReader *reader) |
Load name, creation time and caption spec from XML. | |
void | writeBasicAttributes (QXmlStreamWriter *writer) const |
Save name, creation time and caption spec to XML. | |
void | writeCommentElement (QXmlStreamWriter *writer) const |
Save the comment to XML. | |
bool | readCommentElement (XmlStreamReader *reader) |
Load comment from an XML element. |
Base class of all persistent objects in a Project.
Before going into the details, it's useful to understand the ideas behind the Aspect Framework.
Aspects organize themselves into trees, where a parent takes ownership of its children. Usually, though not necessarily, a Project instance will sit at the root of the tree (without a Project ancestor, project() will return 0 and undo does not work). Children are organized using addChild(), removeChild(), child(), indexOfChild() and childCount() on the parent's side as well as the equivalent convenience methods index() and remove() on the child's side.
AbstractAspect manages for every Aspect the properties name, comment, #caption_spec and #creation_time. All of these translate into the caption() as described in the documentation of setCaptionSpec().
If an undoStack() can be found (usually it is managed by Project), changes to the properties as well as adding/removing children support multi-level undo/redo. In order to support undo/redo for problem-specific data in derived classes, make sure that all changes to your data are done by handing appropriate commands to exec().
Optionally, you can supply an icon() to be used by different views (including the ProjectExplorer) and/or reimplement createContextMenu() for a custom context menu of views.
The private data of AbstractAspect is contained in a separate class AbstractAspect::Private. The write access to AbstractAspect::Private should always be done using aspect commands to allow undo/redo.
AbstractAspect::AbstractAspect | ( | const QString & | name | ) |
|
virtual |
References d_aspect_private.
void AbstractAspect::addChild | ( | AbstractAspect * | child | ) |
Add the given Aspect to my list of children.
References beginMacro(), AbstractAspect::Private::childCount(), completeAspectInsertion(), d_aspect_private, endMacro(), exec(), info(), name(), setName(), and AbstractAspect::Private::uniqueNameFor().
Referenced by AbstractSimpleFilter::AbstractSimpleFilter(), Column::Column(), ApplicationWindow::convertMatrixToTable(), ApplicationWindow::convertTableToMatrix(), ApplicationWindow::defineErrorBars(), future::Matrix::duplicate(), Table::importASCII(), ApplicationWindow::importASCII(), ApplicationWindow::importImage(), ApplicationWindow::newHiddenTable(), ApplicationWindow::newMatrix(), ApplicationWindow::newTable(), ApplicationWindow::newTableStatistics(), future::Folder::readChildAspectElement(), and Column::setColumnMode().
|
signal |
Emit this when a parent aspect is about to get a new child inserted.
Referenced by AbstractAspect::Private::insertChild().
|
signal |
Emit this from an aspect about to be removed from its parent's children.
Referenced by AbstractAspect::Private::insertChild(), and AbstractAspect::Private::removeChild().
|
signal |
Emit this from a parent before removing its child.
|
signal |
Emit this from a newly added aspect.
Referenced by AbstractAspect::Private::insertChild().
|
signal |
Emit this from a parent after adding a new child to it.
|
signal |
Emit this before the name, comment or caption spec is changed.
Referenced by AbstractFilter::input(), and AbstractAspect::Private::insertChild().
|
signal |
Emit this when the name, comment or caption spec changed.
Referenced by future::Table::connectColumn(), AbstractFilter::input(), AbstractAspect::Private::insertChild(), and Column::notifyDisplayChange().
|
signal |
Emit this from the parent after removing a child.
Referenced by AbstractAspect::Private::insertChild(), and AbstractAspect::Private::removeChild().
void AbstractAspect::beginMacro | ( | const QString & | text | ) |
Begin an undo stack macro (series of commands)
References undoStack().
Referenced by addChild(), future::Table::addColumn(), future::Table::addColumns(), future::Matrix::addColumns(), future::Table::addRows(), future::Matrix::addRows(), Table::applyFormula(), 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(), insertChild(), future::Table::insertColumns(), future::Matrix::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(), removeAllChildAspects(), removeChild(), future::Table::removeColumns(), future::Matrix::removeColumns(), future::Table::removeRows(), future::Matrix::removeRows(), future::Matrix::removeSelectedColumns(), future::Table::removeSelectedColumns(), future::Matrix::removeSelectedRows(), future::Table::removeSelectedRows(), reparentChild(), Column::setColumnMode(), future::Matrix::setDimensions(), future::Table::setRowCount(), future::Table::setSelectionAs(), future::Table::sortColumns(), and future::Table::unmaskSelection().
QString AbstractAspect::caption | ( | ) | const |
References AbstractAspect::Private::caption(), and d_aspect_private.
Referenced by PartMdiView::handleAspectDescriptionChanged().
QString AbstractAspect::captionSpec | ( | ) | const |
Return the specification string used for constructing the caption().
See setCaptionSpec() for format.
References AbstractAspect::Private::captionSpec(), and d_aspect_private.
Referenced by future::Table::copy(), and writeBasicAttributes().
AbstractAspect * AbstractAspect::child | ( | int | index | ) | const |
Get a child by its position in my list of children.
References AbstractAspect::Private::child(), childCount(), and d_aspect_private.
Referenced by AbstractAspect::Private::addChild(), descendantsThatInherit(), ApplicationWindow::handleAspectAboutToBeRemoved(), ApplicationWindow::handleAspectAdded(), ApplicationWindow::importASCII(), AbstractAspect::Private::indexOfChild(), future::Folder::save(), AbstractAspect::Private::uniqueNameFor(), and AbstractAspect::Private::~Private().
int AbstractAspect::childCount | ( | ) | const |
Return the number of child Aspects.
References AbstractAspect::Private::childCount(), and d_aspect_private.
Referenced by AbstractAspect::Private::child(), child(), descendantsThatInherit(), ApplicationWindow::importASCII(), moveChild(), removeAllChildAspects(), removeChild(), reparentChild(), and future::Folder::save().
QString AbstractAspect::comment | ( | ) | const |
|
inlineprotectedvirtual |
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.
Referenced by addChild(), insertChild(), and reparentChild().
|
virtual |
Return a new context menu.
The caller takes ownership of the menu.
Reimplemented in future::Table, future::Matrix, Project, AbstractPart, and future::Folder.
QDateTime AbstractAspect::creationTime | ( | ) | const |
References AbstractAspect::Private::creationTime(), and d_aspect_private.
Referenced by Matrix::birthDate(), Table::init(), Matrix::init(), ApplicationWindow::openTable(), and writeBasicAttributes().
QList< AbstractAspect * > AbstractAspect::descendantsThatInherit | ( | const char * | class_name | ) |
Get all descendents that inherit the given class.
References child(), childCount(), and descendantsThatInherit().
Referenced by descendantsThatInherit(), and ApplicationWindow::tableWindows().
void AbstractAspect::endMacro | ( | ) |
End the undo stack macro.
References undoStack().
Referenced by addChild(), future::Table::addColumn(), future::Table::addColumns(), future::Matrix::addColumns(), future::Table::addRows(), future::Matrix::addRows(), Table::applyFormula(), 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(), insertChild(), future::Table::insertColumns(), future::Matrix::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(), removeAllChildAspects(), removeChild(), future::Table::removeColumns(), future::Matrix::removeColumns(), future::Table::removeRows(), future::Matrix::removeRows(), future::Matrix::removeSelectedColumns(), future::Table::removeSelectedColumns(), future::Matrix::removeSelectedRows(), future::Table::removeSelectedRows(), reparentChild(), Column::setColumnMode(), future::Matrix::setDimensions(), future::Table::setRowCount(), future::Table::setSelectionAs(), future::Table::sortColumns(), and future::Table::unmaskSelection().
void AbstractAspect::exec | ( | QUndoCommand * | command | ) |
Execute the given command, pushing it on the undoStack() if available.
References undoStack().
Referenced by addChild(), future::Matrix::addColumns(), future::Table::addRows(), future::Matrix::addRows(), Column::clear(), future::Matrix::clear(), Column::clearFormulas(), Column::clearMasks(), future::Matrix::clearSelectedCells(), future::Matrix::clearSelectedColumns(), future::Matrix::clearSelectedRows(), Column::clearValidity(), future::Table::completeAspectInsertion(), Column::copy(), insertChild(), future::Matrix::insertColumns(), future::Matrix::insertRows(), Column::insertRows(), future::Matrix::mirrorHorizontally(), future::Matrix::mirrorVertically(), moveChild(), future::Table::moveColumn(), future::Table::prepareAspectRemoval(), removeChild(), future::Matrix::removeColumns(), future::Table::removeRows(), future::Matrix::removeRows(), Column::removeRows(), reparentChild(), Column::replaceDateTimes(), Column::replaceTexts(), Column::replaceValues(), setCaptionSpec(), future::Matrix::setCell(), future::Matrix::setColumnCells(), Column::setColumnMode(), setComment(), future::Matrix::setCoordinates(), setCreationTime(), Column::setDateTimeAt(), future::Matrix::setDimensions(), future::Matrix::setDisplayedDigits(), DateTime2StringFilter::setFormat(), String2DateTimeFilter::setFormat(), future::Matrix::setFormula(), Column::setFormula(), Column::setInvalid(), Column::setMasked(), 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().
future::Folder * AbstractAspect::folder | ( | ) |
Return the folder the Aspect is contained in or 0 if not.
The returned folder may be the aspect itself if it inherits Folder.
References parentAspect().
Referenced by future::Matrix::duplicate(), and future::Folder::readChildAspectElement().
|
static |
Retrieve a global setting.
References AbstractAspect::Private::g_defaults, and AbstractAspect::Private::g_settings.
Referenced by future::Matrix::importImageDialog(), and ProjectConfigPage::ProjectConfigPage().
|
virtual |
Return an icon to be used for decorating my views.
Reimplemented in future::Table, Column, future::Matrix, and future::Folder.
Referenced by PartMdiView::PartMdiView().
|
inline |
References setCreationTime().
Referenced by Matrix::setBirthDate(), and Table::setBirthDate().
|
inline |
Return my position in my parent's list of children.
References indexOfChild(), and parentAspect().
Referenced by future::Table::handleDataChange(), future::Table::handleDescriptionChange(), future::Table::handleModeChange(), future::Table::handlePlotDesignationChange(), future::Table::handleRowsInserted(), future::Table::handleRowsRemoved(), AbstractAspect::Private::removeChild(), and Column::XmlReadRow().
int AbstractAspect::indexOfChild | ( | const AbstractAspect * | child | ) | const |
Return the position of child in my list of children.
References d_aspect_private, and AbstractAspect::Private::indexOfChild().
Referenced by TableView::handleAspectAdded(), index(), remove(), AbstractAspect::Private::removeChild(), removeChild(), and reparentChild().
|
inlineprotected |
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.
References statusInfo().
Referenced by addChild(), insertChild(), reparentChild(), and setName().
void AbstractAspect::insertChild | ( | AbstractAspect * | child, |
int | index | ||
) |
Insert the given Aspect at a specific position in my list of children.
References beginMacro(), completeAspectInsertion(), d_aspect_private, endMacro(), exec(), info(), name(), setName(), and AbstractAspect::Private::uniqueNameFor().
Referenced by AbstractAspect::Private::addChild(), and future::Table::insertColumns().
bool AbstractAspect::isDescendantOf | ( | AbstractAspect * | other | ) |
Return whether the there is a path upwards to the given aspect.
This also returns true if other==this.
References parentAspect().
|
inlinevirtual |
Load from XML.
XmlStreamReader supports errors as well as warnings. If only warnings (non-critial errors) occur, this function must return the reader at the end element corresponding to the current element at the time the function was called.
This function is normally intended to be called directly after the ctor. If you want to call load on an aspect that has been altered, you must make sure beforehand that it is in the same state as after creation, e.g., remove all its child aspects.
Reimplemented in Column, AbstractSimpleFilter, future::Table, future::Matrix, DateTime2StringFilter, Project, Double2StringFilter, String2DateTimeFilter, and future::Folder.
void AbstractAspect::moveChild | ( | int | from, |
int | to | ||
) |
Change the positon of a child in my list of children.
References childCount(), d_aspect_private, and exec().
Referenced by future::Table::moveColumn().
QString AbstractAspect::name | ( | ) | const |
References d_aspect_private, and AbstractAspect::Private::name().
Referenced by addChild(), future::Table::addColumn(), future::Table::addColumns(), future::Matrix::addColumns(), Filter::addResultCurve(), future::Table::addRows(), future::Matrix::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(), Table::handleAspectDescriptionAboutToChange(), Table::handleAspectDescriptionChange(), Matrix::handleAspectDescriptionChange(), TableView::handleAspectDescriptionChanged(), Table::importASCII(), ApplicationWindow::importASCII(), insertChild(), future::Table::insertColumns(), future::Matrix::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(), Table::name(), future::Matrix::Private::name(), future::Table::Private::name(), future::Table::normalizeColumns(), future::Table::normalizeSelection(), Differentiation::output(), future::Matrix::pasteIntoSelection(), future::Table::pasteIntoSelection(), path(), readBasicAttributes(), future::Table::recalculateSelectedCells(), removeAllChildAspects(), removeChild(), future::Table::removeColumns(), future::Matrix::removeColumns(), future::Table::removeRows(), future::Matrix::removeRows(), future::Matrix::removeSelectedColumns(), future::Table::removeSelectedColumns(), future::Matrix::removeSelectedRows(), future::Table::removeSelectedRows(), reparentChild(), Table::selectedColumns(), Table::selectedErrColumns(), Table::selectedYColumns(), 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(), writeBasicAttributes(), and Table::YColumns().
AbstractAspect * AbstractAspect::parentAspect | ( | ) | const |
Return my parent Aspect or 0 if I currently don't have one.
References d_aspect_private, and AbstractAspect::Private::parent().
Referenced by DateTime2StringFilterSetFormatCmd::DateTime2StringFilterSetFormatCmd(), Double2StringFilterSetDigitsCmd::Double2StringFilterSetDigitsCmd(), Double2StringFilterSetFormatCmd::Double2StringFilterSetFormatCmd(), folder(), TableView::handleAspectAdded(), TableView::handleAspectDescriptionChanged(), index(), isDescendantOf(), path(), project(), remove(), Graph::setLabelsTextFormat(), String2DateTimeFilterSetFormatCmd::String2DateTimeFilterSetFormatCmd(), and undoStack().
|
inlinevirtual |
Return the path that leads from the top-most Aspect (usually a Project) to me.
Reimplemented in Project.
References name(), parentAspect(), and path().
Referenced by path(), and MuParserScript::resolveColumnPath().
|
inlineprotectedvirtual |
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.
Referenced by removeChild(), and reparentChild().
|
inlinevirtual |
Return the Project this Aspect belongs to, or 0 if it is currently not part of one.
Reimplemented in Project.
References parentAspect(), and project().
Referenced by future::Folder::createContextMenu(), and project().
|
inlinevirtual |
Return the Project this Aspect belongs to, or 0 if it is currently not part of one.
Reimplemented in Project.
References parentAspect(), and project().
|
protected |
Load name, creation time and caption spec from XML.
References name(), XmlStreamReader::raiseWarning(), setCaptionSpec(), setCreationTime(), and setName().
Referenced by future::Folder::load(), future::Matrix::load(), future::Table::load(), AbstractSimpleFilter::load(), and Column::load().
|
protected |
Load comment from an XML element.
References setComment().
Referenced by future::Folder::load(), future::Matrix::load(), future::Table::load(), AbstractSimpleFilter::load(), and Column::load().
|
inlinevirtualslot |
Remove me from my parent's list of children.
References indexOfChild(), parentAspect(), and removeChild().
Referenced by PartMdiView::closeEvent(), Table::closeEvent(), Matrix::closeEvent(), and Table::importASCII().
|
virtual |
Remove all child aspects.
References beginMacro(), childCount(), endMacro(), name(), and removeChild().
Referenced by future::Folder::load().
void AbstractAspect::removeChild | ( | AbstractAspect * | child, |
bool | detach = false |
||
) |
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).
References beginMacro(), d_aspect_private, endMacro(), exec(), indexOfChild(), name(), and prepareAspectRemoval().
Referenced by Table::importV0x0001XXHeader(), remove(), removeAllChildAspects(), removeChild(), future::Table::removeColumns(), ApplicationWindow::removeDependentTableStatistics(), Column::setColumnMode(), and Table::setHeader().
void AbstractAspect::removeChild | ( | int | index | ) |
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.
References AbstractAspect::Private::child(), childCount(), d_aspect_private, and removeChild().
void AbstractAspect::reparentChild | ( | AbstractAspect * | new_parent, |
AbstractAspect * | child, | ||
int | d_new_index | ||
) |
Move a child to another aspect and transfer ownership.
References beginMacro(), childCount(), completeAspectInsertion(), d_aspect_private, endMacro(), exec(), indexOfChild(), info(), name(), prepareAspectRemoval(), setName(), and AbstractAspect::Private::uniqueNameFor().
Referenced by ApplicationWindow::importASCII(), and reparentChild().
void AbstractAspect::reparentChild | ( | AbstractAspect * | new_parent, |
AbstractAspect * | child | ||
) |
Move a child to another aspect and transfer ownership.
References childCount(), and reparentChild().
|
inlinevirtual |
Save as XML.
Reimplemented in Column, AbstractSimpleFilter, future::Table, future::Matrix, Project, and future::Folder.
Referenced by future::Folder::save().
|
slot |
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".
References AbstractAspect::Private::captionSpec(), d_aspect_private, and exec().
Referenced by future::Table::copy(), readBasicAttributes(), Matrix::setCaptionPolicy(), and Table::setCaptionPolicy().
|
slot |
References AbstractAspect::Private::comment(), d_aspect_private, and exec().
Referenced by TableView::applyDescription(), future::Table::copy(), ImportOPJ::importTables(), future::Folder::load(), future::Matrix::load(), future::Table::load(), Column::load(), readCommentElement(), Table::setColComment(), Table::setColComments(), Matrix::setWindowLabel(), and Table::setWindowLabel().
|
protected |
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.
References AbstractAspect::Private::creationTime(), d_aspect_private, and exec().
Referenced by importV0x0001XXCreationTime(), and readBasicAttributes().
|
static |
Update a global setting.
References AbstractAspect::Private::g_settings.
Referenced by ProjectConfigPage::apply(), and future::Matrix::importImageDialog().
|
static |
Set default value for a global setting.
References AbstractAspect::Private::g_defaults.
|
slot |
References d_aspect_private, exec(), info(), AbstractAspect::Private::name(), AbstractAspect::Private::parent(), and uniqueNameFor().
Referenced by addChild(), TableView::applyDescription(), Table::importASCII(), ApplicationWindow::importASCII(), ImportOPJ::importTables(), Table::importV0x0001XXHeader(), insertChild(), Column::Private::Private(), readBasicAttributes(), reparentChild(), Column::Private::replaceModeData(), Table::setColName(), Column::Private::setColumnMode(), Table::setHeader(), Matrix::setName(), Table::setName(), and Table::Table().
|
signal |
Emit this to give status information to the user.
Referenced by info(), and AbstractAspect::Private::insertChild().
|
inlinevirtual |
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.
References parentAspect(), and undoStack().
Referenced by beginMacro(), endMacro(), exec(), and undoStack().
|
slot |
Make the specified name unique among my children by incrementing a trailing number.
References d_aspect_private, and AbstractAspect::Private::uniqueNameFor().
Referenced by setName().
|
protected |
Save name, creation time and caption spec to XML.
References captionSpec(), creationTime(), and name().
Referenced by future::Folder::save(), future::Matrix::save(), future::Table::save(), AbstractSimpleFilter::save(), and Column::save().
|
protected |
Save the comment to XML.
References comment().
Referenced by future::Folder::save(), future::Matrix::save(), future::Table::save(), AbstractSimpleFilter::save(), and Column::save().
|
friend |
Reimplemented in future::Table, future::Matrix, and Column.
|
private |
Referenced by addChild(), caption(), captionSpec(), child(), childCount(), comment(), creationTime(), indexOfChild(), AbstractAspect::Private::insertChild(), insertChild(), moveChild(), name(), parentAspect(), AbstractAspect::Private::removeChild(), removeChild(), reparentChild(), setCaptionSpec(), setComment(), setCreationTime(), setName(), uniqueNameFor(), and ~AbstractAspect().