umbrello: umbrello/uml1model/association.h Source File

umbrello 2.32.3 Umbrello UML Modeller is a Unified Modelling Language (UML) diagram program based on KDE Technology

association.h
Go to the documentation of this file.
1 /***************************************************************************
2 * This program is free software; you can redistribute it and/or modify *
3 * it under the terms of the GNU General Public License as published by *
4 * the Free Software Foundation; either version 2 of the License, or *
5 * (at your option) any later version. *
6 * *
7 * copyright (C) 2003-2020 *
8 * Umbrello UML Modeller Authors <umbrello-devel@kde.org> *
9 ***************************************************************************/
10
11 #ifndef ASSOCIATION_H
12 #define ASSOCIATION_H
13
14 #include "basictypes.h"
15 #include "umlobject.h"
16
17 #include <QDomDocument>
18 #include <QDomElement>
19
20 class UMLRole;
21
32 class UMLAssociation : public UMLObject
33 {
34 Q_OBJECT
35 friend class AssociationWidget;
36
37 public:
38 UMLAssociation(Uml::AssociationType::Enum type, UMLObject *roleA, UMLObject *roleB);
39 explicit UMLAssociation(Uml::AssociationType::Enum type = Uml::AssociationType::Unknown);
40
41 virtual ~UMLAssociation();
42
43 bool operator==(const UMLAssociation &rhs) const;
44
45 QString toString() const;
46
47 UMLRole * getUMLRole(Uml::RoleType::Enum role) const;
48 Uml::ID::Type getObjectId(Uml::RoleType::Enum role) const;
49 Uml::ID::Type getRoleId(Uml::RoleType::Enum role) const;
50
51 void setAssociationType(Uml::AssociationType::Enum assocType);
52 Uml::AssociationType::Enum getAssocType() const;
53
54 void setObject(UMLObject *obj, Uml::RoleType::Enum role);
55 UMLObject* getObject(Uml::RoleType::Enum role) const;
56
57 void setVisibility(Uml::Visibility::Enum value, Uml::RoleType::Enum role);
58 Uml::Visibility::Enum visibility(Uml::RoleType::Enum role) const;
59
60 void setChangeability(Uml::Changeability::Enum value, Uml::RoleType::Enum role);
61 Uml::Changeability::Enum changeability(Uml::RoleType::Enum role) const;
62
63 void setMultiplicity(const QString &multi, Uml::RoleType::Enum role);
64 QString getMultiplicity(Uml::RoleType::Enum role) const;
65
66 void setRoleName(const QString &roleName, Uml::RoleType::Enum role);
67 QString getRoleName(Uml::RoleType::Enum role) const;
68
69 void setRoleDoc(const QString &doc, Uml::RoleType::Enum role);
70 QString getRoleDoc(Uml::RoleType::Enum role) const;
71
72 void setOldLoadMode(bool value = true);
73 bool getOldLoadMode() const;
74
75 virtual UMLObject* clone() const { return 0; }
76
77 virtual bool resolveRef();
78
79 void saveToXMI1(QDomDocument& qDoc, QDomElement& qElement);
80
81 virtual bool showPropertiesDialog(QWidget *parent = 0);
82
83 protected:
84
85 bool load1(QDomElement& element);
86
87 // keep track of number of parent widgets
88 int nrof_parent_widgets;
89
90 void init(Uml::AssociationType::Enum type, UMLObject *roleAObj, UMLObject *roleBObj);
91
92 UMLRole * m_pRole[2];
93 Uml::AssociationType::Enum m_AssocType;
94 QString m_Name;
95 bool m_bOldLoadMode;
96
97 private:
98
99 bool isRealization(UMLObject* objA, UMLObject* objB) const;
100 };
101
102 #endif
basictypes.h
AssociationWidget
This class represents an association inside a diagram. Bugs and comments to umbrello-devel@kde....
Definition: associationwidget.h:52
AssociationWidget::roleName
QString roleName(Uml::RoleType::Enum role) const
Definition: associationwidget.cpp:945
UMLAssociation
Sets up association information.
Definition: association.h:33
UMLAssociation::saveToXMI1
void saveToXMI1(QDomDocument &qDoc, QDomElement &qElement)
Definition: association.cpp:149
UMLAssociation::~UMLAssociation
virtual ~UMLAssociation()
Definition: association.cpp:70
UMLAssociation::setOldLoadMode
void setOldLoadMode(bool value=true)
Definition: association.cpp:594
UMLAssociation::getMultiplicity
QString getMultiplicity(Uml::RoleType::Enum role) const
Definition: association.cpp:558
UMLAssociation::m_Name
QString m_Name
Definition: association.h:94
UMLAssociation::UMLAssociation
UMLAssociation(Uml::AssociationType::Enum type, UMLObject *roleA, UMLObject *roleB)
Definition: association.cpp:44
UMLAssociation::resolveRef
virtual bool resolveRef()
Definition: association.cpp:128
UMLAssociation::m_bOldLoadMode
bool m_bOldLoadMode
Definition: association.h:95
UMLAssociation::getOldLoadMode
bool getOldLoadMode() const
Definition: association.cpp:602
UMLAssociation::setRoleDoc
void setRoleDoc(const QString &doc, Uml::RoleType::Enum role)
Definition: association.cpp:682
UMLAssociation::clone
virtual UMLObject * clone() const
Definition: association.h:75
UMLAssociation::operator==
bool operator==(const UMLAssociation &rhs) const
Definition: association.cpp:89
UMLAssociation::setVisibility
void setVisibility(Uml::Visibility::Enum value, Uml::RoleType::Enum role)
Definition: association.cpp:640
UMLAssociation::isRealization
bool isRealization(UMLObject *objA, UMLObject *objB) const
Definition: association.cpp:694
UMLAssociation::setAssociationType
void setAssociationType(Uml::AssociationType::Enum assocType)
Definition: association.cpp:611
UMLAssociation::showPropertiesDialog
virtual bool showPropertiesDialog(QWidget *parent=0)
Definition: association.cpp:196
UMLAssociation::load1
bool load1(QDomElement &element)
Definition: association.cpp:208
UMLAssociation::getRoleName
QString getRoleName(Uml::RoleType::Enum role) const
Definition: association.cpp:567
UMLAssociation::getRoleId
Uml::ID::Type getRoleId(Uml::RoleType::Enum role) const
Definition: association.cpp:532
UMLAssociation::setObject
void setObject(UMLObject *obj, Uml::RoleType::Enum role)
Definition: association.cpp:630
UMLAssociation::getObject
UMLObject * getObject(Uml::RoleType::Enum role) const
Definition: association.cpp:496
UMLAssociation::changeability
Uml::Changeability::Enum changeability(Uml::RoleType::Enum role) const
Definition: association.cpp:540
UMLAssociation::getAssocType
Uml::AssociationType::Enum getAssocType() const
Definition: association.cpp:105
UMLAssociation::toString
QString toString() const
Definition: association.cpp:113
UMLAssociation::m_AssocType
Uml::AssociationType::Enum m_AssocType
Definition: association.h:93
UMLAssociation::getObjectId
Uml::ID::Type getObjectId(Uml::RoleType::Enum role) const
Definition: association.cpp:508
UMLAssociation::m_pRole
UMLRole * m_pRole[2]
Definition: association.h:92
UMLAssociation::setMultiplicity
void setMultiplicity(const QString &multi, Uml::RoleType::Enum role)
Definition: association.cpp:660
UMLAssociation::nrof_parent_widgets
int nrof_parent_widgets
Definition: association.h:88
UMLAssociation::setChangeability
void setChangeability(Uml::Changeability::Enum value, Uml::RoleType::Enum role)
Definition: association.cpp:650
UMLAssociation::setRoleName
void setRoleName(const QString &roleName, Uml::RoleType::Enum role)
Definition: association.cpp:672
UMLAssociation::getUMLRole
UMLRole * getUMLRole(Uml::RoleType::Enum role) const
Definition: association.cpp:585
UMLAssociation::getRoleDoc
QString getRoleDoc(Uml::RoleType::Enum role) const
Definition: association.cpp:576
UMLObject
The base class for UML objects.
Definition: umlobject.h:74
UMLObject::doc
QString doc() const
Definition: umlobject.cpp:435
UMLObject::init
void init()
Definition: umlobject.cpp:126
UMLObject::visibility
Uml::Visibility::Enum visibility() const
Definition: umlobject.cpp:466
UMLRole
Definition: umlrole.h:25
Uml::AssociationType::Enum
Enum
Definition: basictypes.h:106
Uml::AssociationType::Unknown
@ Unknown
Definition: basictypes.h:130
Uml::Changeability::Enum
Enum
Definition: basictypes.h:204
Uml::ID::Type
std::string Type
Definition: basictypes.h:351
Uml::RoleType::Enum
Enum
Definition: basictypes.h:238
Uml::Visibility::Enum
Enum
Definition: basictypes.h:59
umlobject.h