umbrello/umbrello
UMLAssociation Class Reference
This class contains the non-graphic representation of an association. More...
#include <association.h>

Detailed Description
This class contains the non-graphic representation of an association.
An association can be a generalization, realization, simple association, directed association, aggregation, or composition.
Sets up association information.
- See also:
- UMLObject Bugs and comments to uml-devel@lists.sf.net or http://bugs.kde.org
Definition at line 31 of file association.h.
Constructor & Destructor Documentation
| UMLAssociation::UMLAssociation | ( | Uml::Association_Type | type, | |
| UMLObject * | roleA, | |||
| UMLObject * | roleB | |||
| ) |
Sets up an association.
A new unique ID is assigned internally.
- Parameters:
-
type The Uml::Association_Type to construct. roleA Pointer to the UMLObject in role A. roleB Pointer to the UMLObject in role B.
Definition at line 68 of file association.cpp.
| UMLAssociation::UMLAssociation | ( | Uml::Association_Type | type = Uml::at_Unknown |
) |
Constructs an association - for loading only.
This constructor should not normally be used as it constructs an incomplete association (i.e. the role objects are missing.)
- Parameters:
-
type The Uml::Association_Type to construct. Default: Uml::at_Unknown.
Definition at line 85 of file association.cpp.
| UMLAssociation::~UMLAssociation | ( | ) | [virtual] |
Standard destructor.
Definition at line 94 of file association.cpp.
Member Function Documentation
| bool UMLAssociation::assocTypeHasUMLRepresentation | ( | Uml::Association_Type | atype | ) | [static] |
Returns true if the given Association_Type has a representation as a UMLAssociation.
Definition at line 173 of file association.cpp.
| virtual UMLObject* UMLAssociation::clone | ( | ) | const [inline, virtual] |
Implements UMLObject.
Definition at line 79 of file association.h.
| Uml::Association_Type UMLAssociation::getAssocType | ( | ) | const |
Returns the Association_Type of the UMLAssociation.
- Returns:
- The Association_Type of the UMLAssociation.
Definition at line 129 of file association.cpp.
| Uml::Changeability_Type UMLAssociation::getChangeability | ( | Uml::Role_Type | role | ) | const |
Returns the changeability.
Definition at line 572 of file association.cpp.
| QString UMLAssociation::getMulti | ( | Uml::Role_Type | role | ) | const |
Returns the multiplicity assigned to the given role.
- Returns:
- The multiplicity assigned to the given role.
Definition at line 590 of file association.cpp.
| UMLObject * UMLAssociation::getObject | ( | Uml::Role_Type | role | ) | const |
Returns the UMLObject assigned to the given role.
- Returns:
- Pointer to the UMLObject in the given role.
Definition at line 530 of file association.cpp.
| Uml::IDType UMLAssociation::getObjectId | ( | Uml::Role_Type | role | ) | const |
Returns the ID of the UMLObject assigned to the given role.
Shorthand for getObject(role)->getID().
- Returns:
- ID of the UMLObject in the given role.
Definition at line 542 of file association.cpp.
| bool UMLAssociation::getOldLoadMode | ( | ) | const |
Return the backward compatibility flag for loading files.
Definition at line 634 of file association.cpp.
| QString UMLAssociation::getRoleDoc | ( | Uml::Role_Type | role | ) | const |
Returns the documentation assigned to the given role.
- Returns:
- Documentation text of given role.
Definition at line 608 of file association.cpp.
| Uml::IDType UMLAssociation::getRoleId | ( | Uml::Role_Type | role | ) | const |
Returns the ID of the UMLObject assigned to the given role.
CURRENTLY UNUSED.
- Returns:
- ID of the UMLObject of the given role.
Definition at line 564 of file association.cpp.
| QString UMLAssociation::getRoleName | ( | Uml::Role_Type | role | ) | const |
Returns the name assigned to the role A.
- Returns:
- The name assigned to the given role.
Definition at line 599 of file association.cpp.
| UMLRole * UMLAssociation::getUMLRole | ( | Uml::Role_Type | role | ) | const |
Get the underlying UMLRole object for the given role.
- Returns:
- Pointer to the UMLRole object for the given role.
Definition at line 617 of file association.cpp.
| Uml::Visibility UMLAssociation::getVisibility | ( | Uml::Role_Type | role | ) | const |
Returns the Visibility of the given role.
- Returns:
- Visibility of the given role.
Definition at line 581 of file association.cpp.
| void UMLAssociation::init | ( | Uml::Association_Type | type, | |
| UMLObject * | roleAObj, | |||
| UMLObject * | roleBObj | |||
| ) | [protected] |
Common initializations at construction time.
- Parameters:
-
type The Association_Type to represent. roleAObj Pointer to the role A UMLObject. roleBObj Pointer to the role B UMLObject.
Definition at line 765 of file association.cpp.
| bool UMLAssociation::load | ( | QDomElement & | element | ) | [protected, virtual] |
Creates the <UML:Generalization> or <UML:Association> XMI element including its role objects.
Reimplemented from UMLObject.
Definition at line 267 of file association.cpp.
| bool UMLAssociation::operator== | ( | const UMLAssociation & | rhs | ) |
Overloaded '==' operator.
Reimplemented from UMLObject.
Definition at line 113 of file association.cpp.
| bool UMLAssociation::resolveRef | ( | ) | [virtual] |
Resolve types.
Required when dealing with foreign XMI files. Needs to be called after all UML objects are loaded from file. Overrides the method from UMLObject. Calls resolveRef() for each role.
- Returns:
- True for success.
Reimplemented from UMLObject.
Definition at line 195 of file association.cpp.
| void UMLAssociation::saveToXMI | ( | QDomDocument & | qDoc, | |
| QDomElement & | qElement | |||
| ) | [virtual] |
Creates the <UML:Generalization> or <UML:Association> XMI element including its role objects.
Implements UMLObject.
Definition at line 216 of file association.cpp.
| void UMLAssociation::setAssocType | ( | Uml::Association_Type | assocType | ) |
Sets the assocType of the UMLAssociation.
- Parameters:
-
assocType The Association_Type of the UMLAssociation.
Definition at line 643 of file association.cpp.
| void UMLAssociation::setChangeability | ( | Uml::Changeability_Type | value, | |
| Uml::Role_Type | role | |||
| ) |
Sets the changeability of the given role of the UMLAssociation.
- Parameters:
-
value Changeability_Type of the given role. role The Uml::Role_Type to which the changeability is being set
Definition at line 682 of file association.cpp.
| void UMLAssociation::setMulti | ( | const QString & | multi, | |
| Uml::Role_Type | role | |||
| ) |
Sets the multiplicity of the given role of the UMLAssociation.
- Parameters:
-
multi The multiplicity of the given role. role The Uml::Role_Type to which the multiplicity is being applied
Definition at line 692 of file association.cpp.
| void UMLAssociation::setObject | ( | UMLObject * | obj, | |
| Uml::Role_Type | role | |||
| ) |
Sets the UMLObject playing the given role in the association.
- Parameters:
-
obj Pointer to the UMLObject of the given role. role The Uml::Role_Type played by the association
Definition at line 662 of file association.cpp.
| void UMLAssociation::setOldLoadMode | ( | bool | value = true |
) |
Set the attribute m_bOldLoadMode.
- Parameters:
-
value the new value to set
Definition at line 626 of file association.cpp.
| void UMLAssociation::setRoleDoc | ( | const QString & | doc, | |
| Uml::Role_Type | role | |||
| ) |
Sets the documentation on the given role in the association.
- Parameters:
-
doc The string with the documentation. role The Uml::Role_Type to which the documentation is being applied
Definition at line 713 of file association.cpp.
| void UMLAssociation::setRoleName | ( | const QString & | roleName, | |
| Uml::Role_Type | role | |||
| ) |
Sets the name of the given role of the UMLAssociation.
- Parameters:
-
roleName The name to set for the given role. role The Uml::Role_Type for which to set the name.
Definition at line 703 of file association.cpp.
| void UMLAssociation::setVisibility | ( | Uml::Visibility | value, | |
| Uml::Role_Type | role | |||
| ) |
Sets the visibility of the given role of the UMLAssociation.
- Parameters:
-
value Visibility of role. role The Uml::Role_Type to which the visibility is being applied
Definition at line 672 of file association.cpp.
| QString UMLAssociation::toString | ( | Uml::Changeability_Type | type | ) | [static] |
Convert Changeability_Type value into QString representation.
- Parameters:
-
type The Changeability_Type enum value to convert.
Definition at line 722 of file association.cpp.
| QString UMLAssociation::toString | ( | Uml::Association_Type | atype | ) | [static] |
Converts a Uml::Association_Type to its string representation.
- Parameters:
-
atype The Association_Type enum value to convert.
- Returns:
- The string representation of the Association_Type.
Definition at line 162 of file association.cpp.
| QString UMLAssociation::toString | ( | ) | const |
Returns a String representation of this UMLAssociation.
Definition at line 137 of file association.cpp.
Member Data Documentation
const QString UMLAssociation::assocTypeStr [static, protected] |
{
i18n("Generalization"),
i18n("Aggregation"),
i18n("Dependency"),
i18n("Association"),
i18n("Self Association"),
i18n("Collaboration Message"),
i18n("Sequence Message"),
i18n("Collaboration Self Message"),
i18n("Sequence Self Message"),
i18n("Containment"),
i18n("Composition"),
i18n("Realization"),
i18n("Uni Association"),
i18n("Anchor"),
i18n("State Transition"),
i18n("Activity"),
i18n("Exception"),
i18n("Category to Parent"),
i18n("Child to Category"),
i18n("Relationship" )
}
Definition at line 103 of file association.h.
const Uml::Association_Type UMLAssociation::atypeFirst = Uml::at_Generalization [static, protected] |
Definition at line 100 of file association.h.
const Uml::Association_Type UMLAssociation::atypeLast = Uml::at_Relationship [static, protected] |
Definition at line 101 of file association.h.
Uml::Association_Type UMLAssociation::m_AssocType [protected] |
Definition at line 106 of file association.h.
bool UMLAssociation::m_bOldLoadMode [protected] |
Definition at line 108 of file association.h.
QString UMLAssociation::m_Name [protected] |
UMLRole* UMLAssociation::m_pRole[2] [protected] |
Definition at line 105 of file association.h.
const unsigned UMLAssociation::nAssocTypes = (unsigned)atypeLast - (unsigned)atypeFirst + 1 [static, protected] |
Definition at line 102 of file association.h.
int UMLAssociation::nrof_parent_widgets [protected] |
Definition at line 90 of file association.h.
The documentation for this class was generated from the following files:
KDE 4.4 API Reference