summaryrefslogtreecommitdiffstats
path: root/src/uml/qumlconnector.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'src/uml/qumlconnector.cpp')
-rw-r--r--src/uml/qumlconnector.cpp114
1 files changed, 19 insertions, 95 deletions
diff --git a/src/uml/qumlconnector.cpp b/src/uml/qumlconnector.cpp
index 9406f368..1626a0f5 100644
--- a/src/uml/qumlconnector.cpp
+++ b/src/uml/qumlconnector.cpp
@@ -62,25 +62,23 @@
\brief A delegation connector is a connector that links the external contract of a component (as specified by its ports) to the realization of that behavior. It represents the forwarding of events (operation requests and events): a signal that arrives at a port that has a delegation connector to one or more parts or ports on parts will be passed on to those targets for handling. An assembly connector is a connector between two or more parts or ports on parts that defines that one or more parts provide the services that other parts use.Specifies a link that enables communication between two or more instances. This link may be an instance of an association, or it may represent the possibility of the instances being able to communicate because their identities are known by virtue of being passed in as parameters, held in variables or slots, or because the communicating instances are the same instance. The link may be realized by something as simple as a pointer or by something as complex as a network connection. In contrast to associations, which specify links between any instance of the associated classifiers, connectors specify links between instances playing the connected parts only.
*/
-QUmlConnector::QUmlConnector(bool createQObject) :
+QUmlConnector::QUmlConnector(bool createQModelingObject) :
_type(0)
{
- if (createQObject)
- _qObject = new QUmlConnectorObject(this);
- setGroupProperties();
- setPropertyData();
+ if (createQModelingObject)
+ _qModelingObject = qobject_cast<QModelingObject *>(new QUmlConnectorObject(this));
}
QUmlConnector::~QUmlConnector()
{
- if (!deletingFromQObject) {
- if (_qObject)
- _qObject->setProperty("deletingFromModelingObject", true);
- delete _qObject;
+ if (!deletingFromQModelingObject) {
+ if (_qModelingObject)
+ _qModelingObject->setProperty("deletingFromModelingObject", true);
+ delete _qModelingObject;
}
}
-QModelingObject *QUmlConnector::clone() const
+QModelingElement *QUmlConnector::clone() const
{
QUmlConnector *c = new QUmlConnector;
foreach (QUmlComment *element, ownedComments())
@@ -122,8 +120,8 @@ void QUmlConnector::addContract(QUmlBehavior *contract)
if (!_contracts.contains(contract)) {
_contracts.insert(contract);
- if (contract && contract->asQObject() && this->asQObject())
- QObject::connect(contract->asQObject(), SIGNAL(destroyed(QObject*)), this->asQObject(), SLOT(removeContract(QObject *)));
+ if (contract && contract->asQModelingObject() && this->asQModelingObject())
+ QObject::connect(contract->asQModelingObject(), SIGNAL(destroyed(QObject*)), this->asQModelingObject(), SLOT(removeContract(QObject *)));
}
}
@@ -152,9 +150,9 @@ void QUmlConnector::addEnd(QUmlConnectorEnd *end)
if (!_ends.contains(end)) {
_ends.append(end);
- if (end && end->asQObject() && this->asQObject())
- QObject::connect(end->asQObject(), SIGNAL(destroyed(QObject*)), this->asQObject(), SLOT(removeEnd(QObject *)));
- end->asQObject()->setParent(this->asQObject());
+ if (end && end->asQModelingObject() && this->asQModelingObject())
+ QObject::connect(end->asQModelingObject(), SIGNAL(destroyed(QObject*)), this->asQModelingObject(), SLOT(removeEnd(QObject *)));
+ end->asQModelingObject()->setParent(this->asQModelingObject());
// Adjust subsetted properties
addOwnedElement(end);
@@ -167,8 +165,8 @@ void QUmlConnector::removeEnd(QUmlConnectorEnd *end)
if (_ends.contains(end)) {
_ends.removeAll(end);
- if (end->asQObject())
- end->asQObject()->setParent(0);
+ if (end->asQModelingObject())
+ end->asQModelingObject()->setParent(0);
// Adjust subsetted properties
removeOwnedElement(end);
@@ -215,8 +213,8 @@ void QUmlConnector::addRedefinedConnector(QUmlConnector *redefinedConnector)
if (!_redefinedConnectors.contains(redefinedConnector)) {
_redefinedConnectors.insert(redefinedConnector);
- if (redefinedConnector && redefinedConnector->asQObject() && this->asQObject())
- QObject::connect(redefinedConnector->asQObject(), SIGNAL(destroyed(QObject*)), this->asQObject(), SLOT(removeRedefinedConnector(QObject *)));
+ if (redefinedConnector && redefinedConnector->asQModelingObject() && this->asQModelingObject())
+ QObject::connect(redefinedConnector->asQModelingObject(), SIGNAL(destroyed(QObject*)), this->asQModelingObject(), SLOT(removeRedefinedConnector(QObject *)));
// Adjust subsetted properties
addRedefinedElement(redefinedConnector);
@@ -251,82 +249,8 @@ void QUmlConnector::setType(QUmlAssociation *type)
if (_type != type) {
_type = type;
- if (type && type->asQObject() && this->asQObject())
- QObject::connect(type->asQObject(), SIGNAL(destroyed()), this->asQObject(), SLOT(setType()));
+ if (type && type->asQModelingObject() && this->asQModelingObject())
+ QObject::connect(type->asQModelingObject(), SIGNAL(destroyed()), this->asQModelingObject(), SLOT(setType()));
}
}
-void QUmlConnector::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("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("QUmlNamedElement"), new QMetaProperty(metaObject->property(metaObject->indexOfProperty("visibility"))));
- _groupProperties.insert(QStringLiteral("QUmlRedefinableElement"), new QMetaProperty(metaObject->property(metaObject->indexOfProperty("isLeaf"))));
- _groupProperties.insert(QStringLiteral("QUmlRedefinableElement"), new QMetaProperty(metaObject->property(metaObject->indexOfProperty("redefinedElements"))));
- _groupProperties.insert(QStringLiteral("QUmlRedefinableElement"), new QMetaProperty(metaObject->property(metaObject->indexOfProperty("redefinitionContexts"))));
- _groupProperties.insert(QStringLiteral("QUmlFeature"), new QMetaProperty(metaObject->property(metaObject->indexOfProperty("featuringClassifiers"))));
- _groupProperties.insert(QStringLiteral("QUmlFeature"), new QMetaProperty(metaObject->property(metaObject->indexOfProperty("isStatic"))));
- _groupProperties.insert(QStringLiteral("QUmlConnector"), new QMetaProperty(metaObject->property(metaObject->indexOfProperty("contracts"))));
- _groupProperties.insert(QStringLiteral("QUmlConnector"), new QMetaProperty(metaObject->property(metaObject->indexOfProperty("ends"))));
- _groupProperties.insert(QStringLiteral("QUmlConnector"), new QMetaProperty(metaObject->property(metaObject->indexOfProperty("kind"))));
- _groupProperties.insert(QStringLiteral("QUmlConnector"), new QMetaProperty(metaObject->property(metaObject->indexOfProperty("redefinedConnectors"))));
- _groupProperties.insert(QStringLiteral("QUmlConnector"), new QMetaProperty(metaObject->property(metaObject->indexOfProperty("type"))));
-}
-
-void QUmlConnector::setPropertyData()
-{
- QModelingObject::propertyDataHash[QStringLiteral("QUmlConnector")][QStringLiteral("contracts")][QtModeling::AggregationRole] = QStringLiteral("none");
- QModelingObject::propertyDataHash[QStringLiteral("QUmlConnector")][QStringLiteral("contracts")][QtModeling::PropertyClassRole] = QStringLiteral("QUmlConnector");
- QModelingObject::propertyDataHash[QStringLiteral("QUmlConnector")][QStringLiteral("contracts")][QtModeling::IsDerivedRole] = false;
- QModelingObject::propertyDataHash[QStringLiteral("QUmlConnector")][QStringLiteral("contracts")][QtModeling::IsDerivedUnionRole] = false;
- QModelingObject::propertyDataHash[QStringLiteral("QUmlConnector")][QStringLiteral("contracts")][QtModeling::DocumentationRole] = QStringLiteral("The set of Behaviors that specify the valid interaction patterns across the connector.");
- QModelingObject::propertyDataHash[QStringLiteral("QUmlConnector")][QStringLiteral("contracts")][QtModeling::RedefinedPropertiesRole] = QStringLiteral("");
- QModelingObject::propertyDataHash[QStringLiteral("QUmlConnector")][QStringLiteral("contracts")][QtModeling::SubsettedPropertiesRole] = QStringLiteral("");
- QModelingObject::propertyDataHash[QStringLiteral("QUmlConnector")][QStringLiteral("contracts")][QtModeling::OppositeEndRole] = QStringLiteral("");
-
- QModelingObject::propertyDataHash[QStringLiteral("QUmlConnector")][QStringLiteral("ends")][QtModeling::AggregationRole] = QStringLiteral("composite");
- QModelingObject::propertyDataHash[QStringLiteral("QUmlConnector")][QStringLiteral("ends")][QtModeling::PropertyClassRole] = QStringLiteral("QUmlConnector");
- QModelingObject::propertyDataHash[QStringLiteral("QUmlConnector")][QStringLiteral("ends")][QtModeling::IsDerivedRole] = false;
- QModelingObject::propertyDataHash[QStringLiteral("QUmlConnector")][QStringLiteral("ends")][QtModeling::IsDerivedUnionRole] = false;
- QModelingObject::propertyDataHash[QStringLiteral("QUmlConnector")][QStringLiteral("ends")][QtModeling::DocumentationRole] = QStringLiteral("A connector consists of at least two connector ends, each representing the participation of instances of the classifiers typing the connectable elements attached to this end. The set of connector ends is ordered.");
- QModelingObject::propertyDataHash[QStringLiteral("QUmlConnector")][QStringLiteral("ends")][QtModeling::RedefinedPropertiesRole] = QStringLiteral("");
- QModelingObject::propertyDataHash[QStringLiteral("QUmlConnector")][QStringLiteral("ends")][QtModeling::SubsettedPropertiesRole] = QStringLiteral("Element-ownedElement");
- QModelingObject::propertyDataHash[QStringLiteral("QUmlConnector")][QStringLiteral("ends")][QtModeling::OppositeEndRole] = QStringLiteral("");
-
- QModelingObject::propertyDataHash[QStringLiteral("QUmlConnector")][QStringLiteral("kind")][QtModeling::AggregationRole] = QStringLiteral("none");
- QModelingObject::propertyDataHash[QStringLiteral("QUmlConnector")][QStringLiteral("kind")][QtModeling::PropertyClassRole] = QStringLiteral("QUmlConnector");
- QModelingObject::propertyDataHash[QStringLiteral("QUmlConnector")][QStringLiteral("kind")][QtModeling::IsDerivedRole] = true;
- QModelingObject::propertyDataHash[QStringLiteral("QUmlConnector")][QStringLiteral("kind")][QtModeling::IsDerivedUnionRole] = false;
- QModelingObject::propertyDataHash[QStringLiteral("QUmlConnector")][QStringLiteral("kind")][QtModeling::DocumentationRole] = QStringLiteral("Indicates the kind of connector. This is derived: a connector with one or more ends connected to a Port which is not on a Part and which is not a behavior port is a delegation; otherwise it is an assembly.");
- QModelingObject::propertyDataHash[QStringLiteral("QUmlConnector")][QStringLiteral("kind")][QtModeling::RedefinedPropertiesRole] = QStringLiteral("");
- QModelingObject::propertyDataHash[QStringLiteral("QUmlConnector")][QStringLiteral("kind")][QtModeling::SubsettedPropertiesRole] = QStringLiteral("");
- QModelingObject::propertyDataHash[QStringLiteral("QUmlConnector")][QStringLiteral("kind")][QtModeling::OppositeEndRole] = QStringLiteral("");
-
- QModelingObject::propertyDataHash[QStringLiteral("QUmlConnector")][QStringLiteral("redefinedConnectors")][QtModeling::AggregationRole] = QStringLiteral("none");
- QModelingObject::propertyDataHash[QStringLiteral("QUmlConnector")][QStringLiteral("redefinedConnectors")][QtModeling::PropertyClassRole] = QStringLiteral("QUmlConnector");
- QModelingObject::propertyDataHash[QStringLiteral("QUmlConnector")][QStringLiteral("redefinedConnectors")][QtModeling::IsDerivedRole] = false;
- QModelingObject::propertyDataHash[QStringLiteral("QUmlConnector")][QStringLiteral("redefinedConnectors")][QtModeling::IsDerivedUnionRole] = false;
- QModelingObject::propertyDataHash[QStringLiteral("QUmlConnector")][QStringLiteral("redefinedConnectors")][QtModeling::DocumentationRole] = QStringLiteral("A connector may be redefined when its containing classifier is specialized. The redefining connector may have a type that specializes the type of the redefined connector. The types of the connector ends of the redefining connector may specialize the types of the connector ends of the redefined connector. The properties of the connector ends of the redefining connector may be replaced.");
- QModelingObject::propertyDataHash[QStringLiteral("QUmlConnector")][QStringLiteral("redefinedConnectors")][QtModeling::RedefinedPropertiesRole] = QStringLiteral("");
- QModelingObject::propertyDataHash[QStringLiteral("QUmlConnector")][QStringLiteral("redefinedConnectors")][QtModeling::SubsettedPropertiesRole] = QStringLiteral("RedefinableElement-redefinedElement");
- QModelingObject::propertyDataHash[QStringLiteral("QUmlConnector")][QStringLiteral("redefinedConnectors")][QtModeling::OppositeEndRole] = QStringLiteral("");
-
- QModelingObject::propertyDataHash[QStringLiteral("QUmlConnector")][QStringLiteral("type")][QtModeling::AggregationRole] = QStringLiteral("none");
- QModelingObject::propertyDataHash[QStringLiteral("QUmlConnector")][QStringLiteral("type")][QtModeling::PropertyClassRole] = QStringLiteral("QUmlConnector");
- QModelingObject::propertyDataHash[QStringLiteral("QUmlConnector")][QStringLiteral("type")][QtModeling::IsDerivedRole] = false;
- QModelingObject::propertyDataHash[QStringLiteral("QUmlConnector")][QStringLiteral("type")][QtModeling::IsDerivedUnionRole] = false;
- QModelingObject::propertyDataHash[QStringLiteral("QUmlConnector")][QStringLiteral("type")][QtModeling::DocumentationRole] = QStringLiteral("An optional association that specifies the link corresponding to this connector.");
- QModelingObject::propertyDataHash[QStringLiteral("QUmlConnector")][QStringLiteral("type")][QtModeling::RedefinedPropertiesRole] = QStringLiteral("");
- QModelingObject::propertyDataHash[QStringLiteral("QUmlConnector")][QStringLiteral("type")][QtModeling::SubsettedPropertiesRole] = QStringLiteral("");
- QModelingObject::propertyDataHash[QStringLiteral("QUmlConnector")][QStringLiteral("type")][QtModeling::OppositeEndRole] = QStringLiteral("");
-
-}
-