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/qumlconstraint.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/qumlconstraint.cpp')
-rw-r--r-- | src/uml/qumlconstraint.cpp | 25 |
1 files changed, 16 insertions, 9 deletions
diff --git a/src/uml/qumlconstraint.cpp b/src/uml/qumlconstraint.cpp index 2281a757..09b11c97 100644 --- a/src/uml/qumlconstraint.cpp +++ b/src/uml/qumlconstraint.cpp @@ -52,6 +52,7 @@ #include <QtUml/QUmlStringExpression> #include <QtUml/QUmlTemplateParameter> #include <QtUml/QUmlValueSpecification> + /*! \class QUmlConstraint @@ -80,19 +81,19 @@ QUmlConstraint::~QUmlConstraint() QModelingObject *QUmlConstraint::clone() const { QUmlConstraint *c = new QUmlConstraint; - foreach (QUmlComment *element, ownedComment()) + foreach (QUmlComment *element, ownedComments()) c->addOwnedComment(dynamic_cast<QUmlComment *>(element->clone())); if (owningTemplateParameter()) c->setOwningTemplateParameter(dynamic_cast<QUmlTemplateParameter *>(owningTemplateParameter()->clone())); if (templateParameter()) c->setTemplateParameter(dynamic_cast<QUmlTemplateParameter *>(templateParameter()->clone())); - foreach (QUmlDependency *element, clientDependency()) + foreach (QUmlDependency *element, clientDependencies()) c->addClientDependency(dynamic_cast<QUmlDependency *>(element->clone())); c->setName(name()); if (nameExpression()) c->setNameExpression(dynamic_cast<QUmlStringExpression *>(nameExpression()->clone())); c->setVisibility(visibility()); - foreach (QUmlElement *element, constrainedElement()) + foreach (QUmlElement *element, constrainedElements()) c->addConstrainedElement(dynamic_cast<QUmlElement *>(element->clone())); if (context()) c->setContext(dynamic_cast<QUmlNamespace *>(context()->clone())); @@ -106,19 +107,19 @@ QModelingObject *QUmlConstraint::clone() const /*! The ordered set of Elements referenced by this Constraint. */ -const QList<QUmlElement *> QUmlConstraint::constrainedElement() const +const QList<QUmlElement *> QUmlConstraint::constrainedElements() const { // This is a read-write association end - return _constrainedElement; + return _constrainedElements; } void QUmlConstraint::addConstrainedElement(QUmlElement *constrainedElement) { // This is a read-write association end - if (!_constrainedElement.contains(constrainedElement)) { - _constrainedElement.append(constrainedElement); + if (!_constrainedElements.contains(constrainedElement)) { + _constrainedElements.append(constrainedElement); if (constrainedElement && constrainedElement->asQObject() && this->asQObject()) QObject::connect(constrainedElement->asQObject(), SIGNAL(destroyed(QObject*)), this->asQObject(), SLOT(removeConstrainedElement(QObject *))); } @@ -128,8 +129,8 @@ void QUmlConstraint::removeConstrainedElement(QUmlElement *constrainedElement) { // This is a read-write association end - if (_constrainedElement.contains(constrainedElement)) { - _constrainedElement.removeAll(constrainedElement); + if (_constrainedElements.contains(constrainedElement)) { + _constrainedElements.removeAll(constrainedElement); } } @@ -192,6 +193,8 @@ void QUmlConstraint::setSpecification(QUmlValueSpecification *specification) void QUmlConstraint::setPropertyData() { QModelingObject::propertyDataHash[QStringLiteral("constrainedElement")][QtModeling::AggregationRole] = QStringLiteral("none"); + QModelingObject::propertyDataHash[QStringLiteral("constrainedElement")][QtModeling::PropertyClassRole] = QStringLiteral("QUmlConstraint"); + QModelingObject::propertyDataHash[QStringLiteral("constrainedElement")][QtModeling::IsDerivedRole] = false; QModelingObject::propertyDataHash[QStringLiteral("constrainedElement")][QtModeling::IsDerivedUnionRole] = false; QModelingObject::propertyDataHash[QStringLiteral("constrainedElement")][QtModeling::DocumentationRole] = QStringLiteral("The ordered set of Elements referenced by this Constraint."); QModelingObject::propertyDataHash[QStringLiteral("constrainedElement")][QtModeling::RedefinedPropertiesRole] = QStringLiteral(""); @@ -199,6 +202,8 @@ void QUmlConstraint::setPropertyData() QModelingObject::propertyDataHash[QStringLiteral("constrainedElement")][QtModeling::OppositeEndRole] = QStringLiteral(""); QModelingObject::propertyDataHash[QStringLiteral("context")][QtModeling::AggregationRole] = QStringLiteral("none"); + QModelingObject::propertyDataHash[QStringLiteral("context")][QtModeling::PropertyClassRole] = QStringLiteral("QUmlConstraint"); + QModelingObject::propertyDataHash[QStringLiteral("context")][QtModeling::IsDerivedRole] = false; QModelingObject::propertyDataHash[QStringLiteral("context")][QtModeling::IsDerivedUnionRole] = false; QModelingObject::propertyDataHash[QStringLiteral("context")][QtModeling::DocumentationRole] = QStringLiteral("Specifies the namespace that owns the NamedElement."); QModelingObject::propertyDataHash[QStringLiteral("context")][QtModeling::RedefinedPropertiesRole] = QStringLiteral(""); @@ -206,6 +211,8 @@ void QUmlConstraint::setPropertyData() QModelingObject::propertyDataHash[QStringLiteral("context")][QtModeling::OppositeEndRole] = QStringLiteral("Namespace-ownedRule"); QModelingObject::propertyDataHash[QStringLiteral("specification")][QtModeling::AggregationRole] = QStringLiteral("composite"); + QModelingObject::propertyDataHash[QStringLiteral("specification")][QtModeling::PropertyClassRole] = QStringLiteral("QUmlConstraint"); + QModelingObject::propertyDataHash[QStringLiteral("specification")][QtModeling::IsDerivedRole] = false; QModelingObject::propertyDataHash[QStringLiteral("specification")][QtModeling::IsDerivedUnionRole] = false; QModelingObject::propertyDataHash[QStringLiteral("specification")][QtModeling::DocumentationRole] = QStringLiteral("A condition that must be true when evaluated in order for the constraint to be satisfied."); QModelingObject::propertyDataHash[QStringLiteral("specification")][QtModeling::RedefinedPropertiesRole] = QStringLiteral(""); |