diff options
Diffstat (limited to 'src/uml/qumlcomponentrealization.cpp')
-rw-r--r-- | src/uml/qumlcomponentrealization.cpp | 73 |
1 files changed, 12 insertions, 61 deletions
diff --git a/src/uml/qumlcomponentrealization.cpp b/src/uml/qumlcomponentrealization.cpp index ea2b03c7..5a39848e 100644 --- a/src/uml/qumlcomponentrealization.cpp +++ b/src/uml/qumlcomponentrealization.cpp @@ -62,26 +62,24 @@ \brief The realization concept is specialized to (optionally) define the classifiers that realize the contract offered by a component in terms of its provided and required interfaces. The component forms an abstraction from these various classifiers. */ -QUmlComponentRealization::QUmlComponentRealization(bool createQObject) : +QUmlComponentRealization::QUmlComponentRealization(bool createQModelingObject) : QUmlRealization(false), _abstraction(0) { - if (createQObject) - _qObject = new QUmlComponentRealizationObject(this); - setGroupProperties(); - setPropertyData(); + if (createQModelingObject) + _qModelingObject = qobject_cast<QModelingObject *>(new QUmlComponentRealizationObject(this)); } QUmlComponentRealization::~QUmlComponentRealization() { - if (!deletingFromQObject) { - if (_qObject) - _qObject->setProperty("deletingFromModelingObject", true); - delete _qObject; + if (!deletingFromQModelingObject) { + if (_qModelingObject) + _qModelingObject->setProperty("deletingFromModelingObject", true); + delete _qModelingObject; } } -QModelingObject *QUmlComponentRealization::clone() const +QModelingElement *QUmlComponentRealization::clone() const { QUmlComponentRealization *c = new QUmlComponentRealization; foreach (QUmlComment *element, ownedComments()) @@ -130,8 +128,8 @@ void QUmlComponentRealization::setAbstraction(QUmlComponent *abstraction) removeSupplier(_abstraction); _abstraction = abstraction; - if (abstraction && abstraction->asQObject() && this->asQObject()) - QObject::connect(abstraction->asQObject(), SIGNAL(destroyed()), this->asQObject(), SLOT(setAbstraction())); + if (abstraction && abstraction->asQModelingObject() && this->asQModelingObject()) + QObject::connect(abstraction->asQModelingObject(), SIGNAL(destroyed()), this->asQModelingObject(), SLOT(setAbstraction())); // Adjust subsetted properties if (abstraction) { @@ -157,8 +155,8 @@ void QUmlComponentRealization::addRealizingClassifier(QUmlClassifier *realizingC if (!_realizingClassifiers.contains(realizingClassifier)) { _realizingClassifiers.insert(realizingClassifier); - if (realizingClassifier && realizingClassifier->asQObject() && this->asQObject()) - QObject::connect(realizingClassifier->asQObject(), SIGNAL(destroyed(QObject*)), this->asQObject(), SLOT(removeRealizingClassifier(QObject *))); + if (realizingClassifier && realizingClassifier->asQModelingObject() && this->asQModelingObject()) + QObject::connect(realizingClassifier->asQModelingObject(), SIGNAL(destroyed(QObject*)), this->asQModelingObject(), SLOT(removeRealizingClassifier(QObject *))); // Adjust subsetted properties addClient(realizingClassifier); @@ -177,50 +175,3 @@ void QUmlComponentRealization::removeRealizingClassifier(QUmlClassifier *realizi } } -void QUmlComponentRealization::setGroupProperties() -{ - const QMetaObject *metaObject = _qObject->metaObject(); - - _groupProperties.insert(QStringLiteral("QUmlElement"), new QMetaProperty(metaObject->property(metaObject->indexOfProperty("ownedComments")))); - _groupProperties.insert(QStringLiteral("QUmlElement"), new QMetaProperty(metaObject->property(metaObject->indexOfProperty("ownedElements")))); - _groupProperties.insert(QStringLiteral("QUmlElement"), new QMetaProperty(metaObject->property(metaObject->indexOfProperty("owner")))); - _groupProperties.insert(QStringLiteral("QUmlParameterableElement"), new QMetaProperty(metaObject->property(metaObject->indexOfProperty("owningTemplateParameter")))); - _groupProperties.insert(QStringLiteral("QUmlParameterableElement"), new QMetaProperty(metaObject->property(metaObject->indexOfProperty("templateParameter")))); - _groupProperties.insert(QStringLiteral("QUmlNamedElement"), new QMetaProperty(metaObject->property(metaObject->indexOfProperty("clientDependencies")))); - _groupProperties.insert(QStringLiteral("QUmlNamedElement"), new QMetaProperty(metaObject->property(metaObject->indexOfProperty("name")))); - _groupProperties.insert(QStringLiteral("QUmlNamedElement"), new QMetaProperty(metaObject->property(metaObject->indexOfProperty("nameExpression")))); - _groupProperties.insert(QStringLiteral("QUmlNamedElement"), new QMetaProperty(metaObject->property(metaObject->indexOfProperty("namespace_")))); - _groupProperties.insert(QStringLiteral("QUmlNamedElement"), new QMetaProperty(metaObject->property(metaObject->indexOfProperty("qualifiedName")))); - _groupProperties.insert(QStringLiteral("QUmlPackageableElement"), new QMetaProperty(metaObject->property(metaObject->indexOfProperty("visibility")))); - _groupProperties.insert(QStringLiteral("QUmlRelationship"), new QMetaProperty(metaObject->property(metaObject->indexOfProperty("relatedElements")))); - _groupProperties.insert(QStringLiteral("QUmlDirectedRelationship"), new QMetaProperty(metaObject->property(metaObject->indexOfProperty("sources")))); - _groupProperties.insert(QStringLiteral("QUmlDirectedRelationship"), new QMetaProperty(metaObject->property(metaObject->indexOfProperty("targets")))); - _groupProperties.insert(QStringLiteral("QUmlDependency"), new QMetaProperty(metaObject->property(metaObject->indexOfProperty("clients")))); - _groupProperties.insert(QStringLiteral("QUmlDependency"), new QMetaProperty(metaObject->property(metaObject->indexOfProperty("suppliers")))); - _groupProperties.insert(QStringLiteral("QUmlAbstraction"), new QMetaProperty(metaObject->property(metaObject->indexOfProperty("mapping")))); - _groupProperties.insert(QStringLiteral("QUmlComponentRealization"), new QMetaProperty(metaObject->property(metaObject->indexOfProperty("abstraction")))); - _groupProperties.insert(QStringLiteral("QUmlComponentRealization"), new QMetaProperty(metaObject->property(metaObject->indexOfProperty("realizingClassifiers")))); -} - -void QUmlComponentRealization::setPropertyData() -{ - QModelingObject::propertyDataHash[QStringLiteral("QUmlComponentRealization")][QStringLiteral("abstraction")][QtModeling::AggregationRole] = QStringLiteral("none"); - QModelingObject::propertyDataHash[QStringLiteral("QUmlComponentRealization")][QStringLiteral("abstraction")][QtModeling::PropertyClassRole] = QStringLiteral("QUmlComponentRealization"); - QModelingObject::propertyDataHash[QStringLiteral("QUmlComponentRealization")][QStringLiteral("abstraction")][QtModeling::IsDerivedRole] = false; - QModelingObject::propertyDataHash[QStringLiteral("QUmlComponentRealization")][QStringLiteral("abstraction")][QtModeling::IsDerivedUnionRole] = false; - QModelingObject::propertyDataHash[QStringLiteral("QUmlComponentRealization")][QStringLiteral("abstraction")][QtModeling::DocumentationRole] = QStringLiteral("The Component that owns this ComponentRealization and which is implemented by its realizing classifiers."); - QModelingObject::propertyDataHash[QStringLiteral("QUmlComponentRealization")][QStringLiteral("abstraction")][QtModeling::RedefinedPropertiesRole] = QStringLiteral(""); - QModelingObject::propertyDataHash[QStringLiteral("QUmlComponentRealization")][QStringLiteral("abstraction")][QtModeling::SubsettedPropertiesRole] = QStringLiteral("Dependency-supplier Element-owner"); - QModelingObject::propertyDataHash[QStringLiteral("QUmlComponentRealization")][QStringLiteral("abstraction")][QtModeling::OppositeEndRole] = QStringLiteral("Component-realization"); - - QModelingObject::propertyDataHash[QStringLiteral("QUmlComponentRealization")][QStringLiteral("realizingClassifiers")][QtModeling::AggregationRole] = QStringLiteral("none"); - QModelingObject::propertyDataHash[QStringLiteral("QUmlComponentRealization")][QStringLiteral("realizingClassifiers")][QtModeling::PropertyClassRole] = QStringLiteral("QUmlComponentRealization"); - QModelingObject::propertyDataHash[QStringLiteral("QUmlComponentRealization")][QStringLiteral("realizingClassifiers")][QtModeling::IsDerivedRole] = false; - QModelingObject::propertyDataHash[QStringLiteral("QUmlComponentRealization")][QStringLiteral("realizingClassifiers")][QtModeling::IsDerivedUnionRole] = false; - QModelingObject::propertyDataHash[QStringLiteral("QUmlComponentRealization")][QStringLiteral("realizingClassifiers")][QtModeling::DocumentationRole] = QStringLiteral("The classifiers that are involved in the implementation of the Component that owns this Realization."); - QModelingObject::propertyDataHash[QStringLiteral("QUmlComponentRealization")][QStringLiteral("realizingClassifiers")][QtModeling::RedefinedPropertiesRole] = QStringLiteral(""); - QModelingObject::propertyDataHash[QStringLiteral("QUmlComponentRealization")][QStringLiteral("realizingClassifiers")][QtModeling::SubsettedPropertiesRole] = QStringLiteral("Dependency-client"); - QModelingObject::propertyDataHash[QStringLiteral("QUmlComponentRealization")][QStringLiteral("realizingClassifiers")][QtModeling::OppositeEndRole] = QStringLiteral(""); - -} - |