diff options
author | Sandro S. Andrade <sandroandrade@kde.org> | 2013-10-06 11:31:46 -0300 |
---|---|---|
committer | Sandro S. Andrade <sandroandrade@kde.org> | 2013-10-06 16:28:28 +0200 |
commit | 3031fe1254052bdeffec90ca76e2f3649a971ae7 (patch) | |
tree | 1c53eeec8c4be183f600a8f17c7e156efa779ea1 /src/uml/qumlactivitynode.cpp | |
parent | e07d31eda9cc77f50fb6dbae8905384219171332 (diff) |
Use plural form for multi-valued UML metamodel properties
Change-Id: Ia8ab1c48d0fb552aca0ae729507c18b63d4c448e
Reviewed-by: Sandro S. Andrade <sandroandrade@kde.org>
Diffstat (limited to 'src/uml/qumlactivitynode.cpp')
-rw-r--r-- | src/uml/qumlactivitynode.cpp | 103 |
1 files changed, 60 insertions, 43 deletions
diff --git a/src/uml/qumlactivitynode.cpp b/src/uml/qumlactivitynode.cpp index 2f841e3e..c3ff7247 100644 --- a/src/uml/qumlactivitynode.cpp +++ b/src/uml/qumlactivitynode.cpp @@ -55,6 +55,7 @@ #include <QtUml/QUmlRedefinableElement> #include <QtUml/QUmlStringExpression> #include <QtUml/QUmlStructuredActivityNode> + /*! \class QUmlActivityNode @@ -76,9 +77,9 @@ QUmlActivityNode::~QUmlActivityNode() QModelingObject *QUmlActivityNode::clone() const { QUmlActivityNode *c = new QUmlActivityNode; - foreach (QUmlComment *element, ownedComment()) + foreach (QUmlComment *element, ownedComments()) c->addOwnedComment(dynamic_cast<QUmlComment *>(element->clone())); - foreach (QUmlDependency *element, clientDependency()) + foreach (QUmlDependency *element, clientDependencies()) c->addClientDependency(dynamic_cast<QUmlDependency *>(element->clone())); c->setName(name()); if (nameExpression()) @@ -87,17 +88,17 @@ QModelingObject *QUmlActivityNode::clone() const c->setLeaf(isLeaf()); if (activity()) c->setActivity(dynamic_cast<QUmlActivity *>(activity()->clone())); - foreach (QUmlInterruptibleActivityRegion *element, inInterruptibleRegion()) + foreach (QUmlInterruptibleActivityRegion *element, inInterruptibleRegions()) c->addInInterruptibleRegion(dynamic_cast<QUmlInterruptibleActivityRegion *>(element->clone())); - foreach (QUmlActivityPartition *element, inPartition()) + foreach (QUmlActivityPartition *element, inPartitions()) c->addInPartition(dynamic_cast<QUmlActivityPartition *>(element->clone())); if (inStructuredNode()) c->setInStructuredNode(dynamic_cast<QUmlStructuredActivityNode *>(inStructuredNode()->clone())); - foreach (QUmlActivityEdge *element, incoming()) + foreach (QUmlActivityEdge *element, incomings()) c->addIncoming(dynamic_cast<QUmlActivityEdge *>(element->clone())); - foreach (QUmlActivityEdge *element, outgoing()) + foreach (QUmlActivityEdge *element, outgoings()) c->addOutgoing(dynamic_cast<QUmlActivityEdge *>(element->clone())); - foreach (QUmlActivityNode *element, redefinedNode()) + foreach (QUmlActivityNode *element, redefinedNodes()) c->addRedefinedNode(dynamic_cast<QUmlActivityNode *>(element->clone())); return c; } @@ -133,19 +134,19 @@ void QUmlActivityNode::setActivity(QUmlActivity *activity) /*! Groups containing the node. */ -const QSet<QUmlActivityGroup *> QUmlActivityNode::inGroup() const +const QSet<QUmlActivityGroup *> QUmlActivityNode::inGroups() const { // This is a read-only derived union association end - return _inGroup; + return _inGroups; } void QUmlActivityNode::addInGroup(QUmlActivityGroup *inGroup) { // This is a read-only derived union association end - if (!_inGroup.contains(inGroup)) { - _inGroup.insert(inGroup); + if (!_inGroups.contains(inGroup)) { + _inGroups.insert(inGroup); if (inGroup && inGroup->asQObject() && this->asQObject()) QObject::connect(inGroup->asQObject(), SIGNAL(destroyed(QObject*)), this->asQObject(), SLOT(removeInGroup(QObject *))); @@ -160,8 +161,8 @@ void QUmlActivityNode::removeInGroup(QUmlActivityGroup *inGroup) { // This is a read-only derived union association end - if (_inGroup.contains(inGroup)) { - _inGroup.remove(inGroup); + if (_inGroups.contains(inGroup)) { + _inGroups.remove(inGroup); // Adjust opposite properties if (inGroup) { @@ -173,19 +174,19 @@ void QUmlActivityNode::removeInGroup(QUmlActivityGroup *inGroup) /*! Interruptible regions containing the node. */ -const QSet<QUmlInterruptibleActivityRegion *> QUmlActivityNode::inInterruptibleRegion() const +const QSet<QUmlInterruptibleActivityRegion *> QUmlActivityNode::inInterruptibleRegions() const { // This is a read-write association end - return _inInterruptibleRegion; + return _inInterruptibleRegions; } void QUmlActivityNode::addInInterruptibleRegion(QUmlInterruptibleActivityRegion *inInterruptibleRegion) { // This is a read-write association end - if (!_inInterruptibleRegion.contains(inInterruptibleRegion)) { - _inInterruptibleRegion.insert(inInterruptibleRegion); + if (!_inInterruptibleRegions.contains(inInterruptibleRegion)) { + _inInterruptibleRegions.insert(inInterruptibleRegion); if (inInterruptibleRegion && inInterruptibleRegion->asQObject() && this->asQObject()) QObject::connect(inInterruptibleRegion->asQObject(), SIGNAL(destroyed(QObject*)), this->asQObject(), SLOT(removeInInterruptibleRegion(QObject *))); @@ -203,8 +204,8 @@ void QUmlActivityNode::removeInInterruptibleRegion(QUmlInterruptibleActivityRegi { // This is a read-write association end - if (_inInterruptibleRegion.contains(inInterruptibleRegion)) { - _inInterruptibleRegion.remove(inInterruptibleRegion); + if (_inInterruptibleRegions.contains(inInterruptibleRegion)) { + _inInterruptibleRegions.remove(inInterruptibleRegion); // Adjust subsetted properties removeInGroup(inInterruptibleRegion); @@ -219,19 +220,19 @@ void QUmlActivityNode::removeInInterruptibleRegion(QUmlInterruptibleActivityRegi /*! Partitions containing the node. */ -const QSet<QUmlActivityPartition *> QUmlActivityNode::inPartition() const +const QSet<QUmlActivityPartition *> QUmlActivityNode::inPartitions() const { // This is a read-write association end - return _inPartition; + return _inPartitions; } void QUmlActivityNode::addInPartition(QUmlActivityPartition *inPartition) { // This is a read-write association end - if (!_inPartition.contains(inPartition)) { - _inPartition.insert(inPartition); + if (!_inPartitions.contains(inPartition)) { + _inPartitions.insert(inPartition); if (inPartition && inPartition->asQObject() && this->asQObject()) QObject::connect(inPartition->asQObject(), SIGNAL(destroyed(QObject*)), this->asQObject(), SLOT(removeInPartition(QObject *))); @@ -249,8 +250,8 @@ void QUmlActivityNode::removeInPartition(QUmlActivityPartition *inPartition) { // This is a read-write association end - if (_inPartition.contains(inPartition)) { - _inPartition.remove(inPartition); + if (_inPartitions.contains(inPartition)) { + _inPartitions.remove(inPartition); // Adjust subsetted properties removeInGroup(inPartition); @@ -295,19 +296,19 @@ void QUmlActivityNode::setInStructuredNode(QUmlStructuredActivityNode *inStructu /*! Edges that have the node as target. */ -const QSet<QUmlActivityEdge *> QUmlActivityNode::incoming() const +const QSet<QUmlActivityEdge *> QUmlActivityNode::incomings() const { // This is a read-write association end - return _incoming; + return _incomings; } void QUmlActivityNode::addIncoming(QUmlActivityEdge *incoming) { // This is a read-write association end - if (!_incoming.contains(incoming)) { - _incoming.insert(incoming); + if (!_incomings.contains(incoming)) { + _incomings.insert(incoming); if (incoming && incoming->asQObject() && this->asQObject()) QObject::connect(incoming->asQObject(), SIGNAL(destroyed(QObject*)), this->asQObject(), SLOT(removeIncoming(QObject *))); @@ -322,8 +323,8 @@ void QUmlActivityNode::removeIncoming(QUmlActivityEdge *incoming) { // This is a read-write association end - if (_incoming.contains(incoming)) { - _incoming.remove(incoming); + if (_incomings.contains(incoming)) { + _incomings.remove(incoming); // Adjust opposite properties if (incoming) { @@ -335,19 +336,19 @@ void QUmlActivityNode::removeIncoming(QUmlActivityEdge *incoming) /*! Edges that have the node as source. */ -const QSet<QUmlActivityEdge *> QUmlActivityNode::outgoing() const +const QSet<QUmlActivityEdge *> QUmlActivityNode::outgoings() const { // This is a read-write association end - return _outgoing; + return _outgoings; } void QUmlActivityNode::addOutgoing(QUmlActivityEdge *outgoing) { // This is a read-write association end - if (!_outgoing.contains(outgoing)) { - _outgoing.insert(outgoing); + if (!_outgoings.contains(outgoing)) { + _outgoings.insert(outgoing); if (outgoing && outgoing->asQObject() && this->asQObject()) QObject::connect(outgoing->asQObject(), SIGNAL(destroyed(QObject*)), this->asQObject(), SLOT(removeOutgoing(QObject *))); @@ -362,8 +363,8 @@ void QUmlActivityNode::removeOutgoing(QUmlActivityEdge *outgoing) { // This is a read-write association end - if (_outgoing.contains(outgoing)) { - _outgoing.remove(outgoing); + if (_outgoings.contains(outgoing)) { + _outgoings.remove(outgoing); // Adjust opposite properties if (outgoing) { @@ -375,19 +376,19 @@ void QUmlActivityNode::removeOutgoing(QUmlActivityEdge *outgoing) /*! Inherited nodes replaced by this node in a specialization of the activity. */ -const QSet<QUmlActivityNode *> QUmlActivityNode::redefinedNode() const +const QSet<QUmlActivityNode *> QUmlActivityNode::redefinedNodes() const { // This is a read-write association end - return _redefinedNode; + return _redefinedNodes; } void QUmlActivityNode::addRedefinedNode(QUmlActivityNode *redefinedNode) { // This is a read-write association end - if (!_redefinedNode.contains(redefinedNode)) { - _redefinedNode.insert(redefinedNode); + if (!_redefinedNodes.contains(redefinedNode)) { + _redefinedNodes.insert(redefinedNode); if (redefinedNode && redefinedNode->asQObject() && this->asQObject()) QObject::connect(redefinedNode->asQObject(), SIGNAL(destroyed(QObject*)), this->asQObject(), SLOT(removeRedefinedNode(QObject *))); @@ -400,8 +401,8 @@ void QUmlActivityNode::removeRedefinedNode(QUmlActivityNode *redefinedNode) { // This is a read-write association end - if (_redefinedNode.contains(redefinedNode)) { - _redefinedNode.remove(redefinedNode); + if (_redefinedNodes.contains(redefinedNode)) { + _redefinedNodes.remove(redefinedNode); // Adjust subsetted properties removeRedefinedElement(redefinedNode); @@ -411,6 +412,8 @@ void QUmlActivityNode::removeRedefinedNode(QUmlActivityNode *redefinedNode) void QUmlActivityNode::setPropertyData() { QModelingObject::propertyDataHash[QStringLiteral("activity")][QtModeling::AggregationRole] = QStringLiteral("none"); + QModelingObject::propertyDataHash[QStringLiteral("activity")][QtModeling::PropertyClassRole] = QStringLiteral("QUmlActivityNode"); + QModelingObject::propertyDataHash[QStringLiteral("activity")][QtModeling::IsDerivedRole] = false; QModelingObject::propertyDataHash[QStringLiteral("activity")][QtModeling::IsDerivedUnionRole] = false; QModelingObject::propertyDataHash[QStringLiteral("activity")][QtModeling::DocumentationRole] = QStringLiteral("Activity containing the node."); QModelingObject::propertyDataHash[QStringLiteral("activity")][QtModeling::RedefinedPropertiesRole] = QStringLiteral(""); @@ -418,6 +421,8 @@ void QUmlActivityNode::setPropertyData() QModelingObject::propertyDataHash[QStringLiteral("activity")][QtModeling::OppositeEndRole] = QStringLiteral("Activity-node"); QModelingObject::propertyDataHash[QStringLiteral("inGroup")][QtModeling::AggregationRole] = QStringLiteral("none"); + QModelingObject::propertyDataHash[QStringLiteral("inGroup")][QtModeling::PropertyClassRole] = QStringLiteral("QUmlActivityNode"); + QModelingObject::propertyDataHash[QStringLiteral("inGroup")][QtModeling::IsDerivedRole] = true; QModelingObject::propertyDataHash[QStringLiteral("inGroup")][QtModeling::IsDerivedUnionRole] = true; QModelingObject::propertyDataHash[QStringLiteral("inGroup")][QtModeling::DocumentationRole] = QStringLiteral("Groups containing the node."); QModelingObject::propertyDataHash[QStringLiteral("inGroup")][QtModeling::RedefinedPropertiesRole] = QStringLiteral(""); @@ -425,6 +430,8 @@ void QUmlActivityNode::setPropertyData() QModelingObject::propertyDataHash[QStringLiteral("inGroup")][QtModeling::OppositeEndRole] = QStringLiteral("ActivityGroup-containedNode"); QModelingObject::propertyDataHash[QStringLiteral("inInterruptibleRegion")][QtModeling::AggregationRole] = QStringLiteral("none"); + QModelingObject::propertyDataHash[QStringLiteral("inInterruptibleRegion")][QtModeling::PropertyClassRole] = QStringLiteral("QUmlActivityNode"); + QModelingObject::propertyDataHash[QStringLiteral("inInterruptibleRegion")][QtModeling::IsDerivedRole] = false; QModelingObject::propertyDataHash[QStringLiteral("inInterruptibleRegion")][QtModeling::IsDerivedUnionRole] = false; QModelingObject::propertyDataHash[QStringLiteral("inInterruptibleRegion")][QtModeling::DocumentationRole] = QStringLiteral("Interruptible regions containing the node."); QModelingObject::propertyDataHash[QStringLiteral("inInterruptibleRegion")][QtModeling::RedefinedPropertiesRole] = QStringLiteral(""); @@ -432,6 +439,8 @@ void QUmlActivityNode::setPropertyData() QModelingObject::propertyDataHash[QStringLiteral("inInterruptibleRegion")][QtModeling::OppositeEndRole] = QStringLiteral("InterruptibleActivityRegion-node"); QModelingObject::propertyDataHash[QStringLiteral("inPartition")][QtModeling::AggregationRole] = QStringLiteral("none"); + QModelingObject::propertyDataHash[QStringLiteral("inPartition")][QtModeling::PropertyClassRole] = QStringLiteral("QUmlActivityNode"); + QModelingObject::propertyDataHash[QStringLiteral("inPartition")][QtModeling::IsDerivedRole] = false; QModelingObject::propertyDataHash[QStringLiteral("inPartition")][QtModeling::IsDerivedUnionRole] = false; QModelingObject::propertyDataHash[QStringLiteral("inPartition")][QtModeling::DocumentationRole] = QStringLiteral("Partitions containing the node."); QModelingObject::propertyDataHash[QStringLiteral("inPartition")][QtModeling::RedefinedPropertiesRole] = QStringLiteral(""); @@ -439,6 +448,8 @@ void QUmlActivityNode::setPropertyData() QModelingObject::propertyDataHash[QStringLiteral("inPartition")][QtModeling::OppositeEndRole] = QStringLiteral("ActivityPartition-node"); QModelingObject::propertyDataHash[QStringLiteral("inStructuredNode")][QtModeling::AggregationRole] = QStringLiteral("none"); + QModelingObject::propertyDataHash[QStringLiteral("inStructuredNode")][QtModeling::PropertyClassRole] = QStringLiteral("QUmlActivityNode"); + QModelingObject::propertyDataHash[QStringLiteral("inStructuredNode")][QtModeling::IsDerivedRole] = false; QModelingObject::propertyDataHash[QStringLiteral("inStructuredNode")][QtModeling::IsDerivedUnionRole] = false; QModelingObject::propertyDataHash[QStringLiteral("inStructuredNode")][QtModeling::DocumentationRole] = QStringLiteral("Structured activity node containing the node."); QModelingObject::propertyDataHash[QStringLiteral("inStructuredNode")][QtModeling::RedefinedPropertiesRole] = QStringLiteral(""); @@ -446,6 +457,8 @@ void QUmlActivityNode::setPropertyData() QModelingObject::propertyDataHash[QStringLiteral("inStructuredNode")][QtModeling::OppositeEndRole] = QStringLiteral("StructuredActivityNode-node"); QModelingObject::propertyDataHash[QStringLiteral("incoming")][QtModeling::AggregationRole] = QStringLiteral("none"); + QModelingObject::propertyDataHash[QStringLiteral("incoming")][QtModeling::PropertyClassRole] = QStringLiteral("QUmlActivityNode"); + QModelingObject::propertyDataHash[QStringLiteral("incoming")][QtModeling::IsDerivedRole] = false; QModelingObject::propertyDataHash[QStringLiteral("incoming")][QtModeling::IsDerivedUnionRole] = false; QModelingObject::propertyDataHash[QStringLiteral("incoming")][QtModeling::DocumentationRole] = QStringLiteral("Edges that have the node as target."); QModelingObject::propertyDataHash[QStringLiteral("incoming")][QtModeling::RedefinedPropertiesRole] = QStringLiteral(""); @@ -453,6 +466,8 @@ void QUmlActivityNode::setPropertyData() QModelingObject::propertyDataHash[QStringLiteral("incoming")][QtModeling::OppositeEndRole] = QStringLiteral("ActivityEdge-target"); QModelingObject::propertyDataHash[QStringLiteral("outgoing")][QtModeling::AggregationRole] = QStringLiteral("none"); + QModelingObject::propertyDataHash[QStringLiteral("outgoing")][QtModeling::PropertyClassRole] = QStringLiteral("QUmlActivityNode"); + QModelingObject::propertyDataHash[QStringLiteral("outgoing")][QtModeling::IsDerivedRole] = false; QModelingObject::propertyDataHash[QStringLiteral("outgoing")][QtModeling::IsDerivedUnionRole] = false; QModelingObject::propertyDataHash[QStringLiteral("outgoing")][QtModeling::DocumentationRole] = QStringLiteral("Edges that have the node as source."); QModelingObject::propertyDataHash[QStringLiteral("outgoing")][QtModeling::RedefinedPropertiesRole] = QStringLiteral(""); @@ -460,6 +475,8 @@ void QUmlActivityNode::setPropertyData() QModelingObject::propertyDataHash[QStringLiteral("outgoing")][QtModeling::OppositeEndRole] = QStringLiteral("ActivityEdge-source"); QModelingObject::propertyDataHash[QStringLiteral("redefinedNode")][QtModeling::AggregationRole] = QStringLiteral("none"); + QModelingObject::propertyDataHash[QStringLiteral("redefinedNode")][QtModeling::PropertyClassRole] = QStringLiteral("QUmlActivityNode"); + QModelingObject::propertyDataHash[QStringLiteral("redefinedNode")][QtModeling::IsDerivedRole] = false; QModelingObject::propertyDataHash[QStringLiteral("redefinedNode")][QtModeling::IsDerivedUnionRole] = false; QModelingObject::propertyDataHash[QStringLiteral("redefinedNode")][QtModeling::DocumentationRole] = QStringLiteral("Inherited nodes replaced by this node in a specialization of the activity."); QModelingObject::propertyDataHash[QStringLiteral("redefinedNode")][QtModeling::RedefinedPropertiesRole] = QStringLiteral(""); |