[Uml-devel] KDE/kdesdk/umbrello/umbrello
Oliver Kellogg
okellogg at users.sourceforge.net
Tue Dec 20 14:31:01 UTC 2005
SVN commit 490150 by okellogg:
apply commit 490149 from branches/KDE/3.5
M +11 -28 umlrole.cpp
M +0 -31 umlrole.h
--- trunk/KDE/kdesdk/umbrello/umbrello/umlrole.cpp #490149:490150
@@ -55,14 +55,6 @@
return m_Multi;
}
-QString UMLRole::getName() const {
- return m_Name;
-}
-
-QString UMLRole::getDoc() const {
- return m_Doc;
-}
-
void UMLRole::setObject (UMLObject *obj) {
// because we will get the id of this role from the parent
// object, we CANT allow UMLRoles to take other UMLRoles as
@@ -89,16 +81,6 @@
emit modified();
}
-void UMLRole::setName( const QString &roleName ) {
- m_Name = roleName;
- emit modified();
-}
-
-void UMLRole::setDoc( const QString &doc ) {
- m_Doc = doc;
- emit modified();
-}
-
Uml::Role_Type UMLRole::getRole() {
return m_role;
}
@@ -294,16 +276,17 @@
// the component roles/linked items needs to be done in order to get things
// right. *sigh* -b.t.
- if (m_role == Uml::A) { // setting association type from the role (A)
- QString aggregation = element.attribute("aggregation", "none");
- if (aggregation == "composite")
- m_pAssoc->setAssocType(Uml::at_Composition);
- else if (aggregation == "shared" // UML1.3
- || aggregation == "aggregate") // UML1.4
- m_pAssoc->setAssocType(Uml::at_Aggregation);
- /* else
- m_pAssoc->setAssocType(Uml::at_Association); */
- }
+ // Setting association type from the role (A)
+ // Determination of the "aggregation" attribute used to be done only
+ // when (m_role == Uml::A) but some XMI writers (e.g. StarUML) place
+ // the aggregation attribute at role B.
+ // The role end with the aggregation unequal to "none" wins.
+ QString aggregation = element.attribute("aggregation", "none");
+ if (aggregation == "composite")
+ m_pAssoc->setAssocType(Uml::at_Composition);
+ else if (aggregation == "shared" // UML1.3
+ || aggregation == "aggregate") // UML1.4
+ m_pAssoc->setAssocType(Uml::at_Aggregation);
if (!element.hasAttribute("isNavigable")) {
/* Backward compatibility mode: In Umbrello version 1.3.x the
--- trunk/KDE/kdesdk/umbrello/umbrello/umlrole.h #490149:490150
@@ -67,20 +67,6 @@
QString getMultiplicity() const;
/**
- * Returns the name assigned to the role.
- *
- * @return The name assigned to the role.
- */
- QString getName() const;
-
- /**
- * Returns the documentation for the role.
- *
- * @return The documentation text for the role.
- */
- QString getDoc() const;
-
- /**
* Sets the UMLObject playing the role in the association.
*
* @param obj Pointer to the UMLObject of role.
@@ -101,20 +87,6 @@
*/
void setMultiplicity ( const QString &multi );
- /**
- * Sets the name of the role.
- *
- * @param roleName The name of role.
- */
- void setName( const QString &roleName );
-
- /**
- * Sets the documentation on the role.
- *
- * @param doc The string with the documentation.
- */
- void setDoc( const QString &doc );
-
UMLAssociation * getParentAssociation ();
// Sets the m_SecondaryId
@@ -152,13 +124,10 @@
/** do some initialization at construction time */
void init (UMLAssociation * parent, UMLObject * parentObj, Uml::Role_Type r);
- QString m_Doc;
UMLAssociation * m_pAssoc;
Uml::Role_Type m_role;
- QString m_Name;
QString m_Multi;
Uml::Changeability_Type m_Changeability;
-
};
#endif
More information about the umbrello-devel
mailing list