umbrello: umbrello/uml1model/umlcanvasobject.h Source File

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

umlcanvasobject.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) 2002-2020 *
8 * Umbrello UML Modeller Authors <umbrello-devel@kde.org> *
9 ***************************************************************************/
10
11 #ifndef CANVASOBJECT_H
12 #define CANVASOBJECT_H
13
14 #include "umlobject.h"
15 #include "umlobjectlist.h"
16 #include "umlclassifierlist.h"
17 #include "umlassociationlist.h"
18
33 class UMLCanvasObject : public UMLObject
34 {
35 Q_OBJECT
36
37 public:
38 explicit UMLCanvasObject(const QString & name = QString(), Uml::ID::Type id = Uml::ID::None);
39 virtual ~UMLCanvasObject();
40
41 bool operator==(const UMLCanvasObject& rhs) const;
42
43 virtual void copyInto(UMLObject *lhs) const;
44
45 // The abstract method UMLObject::clone() is implemented
46 // in the classes inheriting from UMLCanvasObject.
47
48 bool addAssociationEnd(UMLAssociation* assoc);
49
50 bool hasAssociation(UMLAssociation* assoc);
51
52 int removeAssociationEnd(UMLAssociation *assoc);
53
54 void removeAllAssociationEnds();
55
56 int associations();
57
58 UMLAssociationList getAssociations();
59
60 UMLAssociationList getSpecificAssocs(Uml::AssociationType::Enum assocType);
61
62 UMLClassifierList getSuperClasses(bool withRealizations = true);
63 UMLClassifierList getSubClasses();
64
65 virtual UMLAssociationList getRealizations();
66
67 UMLAssociationList getAggregations();
68 UMLAssociationList getCompositions();
69 UMLAssociationList getRelationships();
70
71 virtual UMLObject *findChildObject(const QString &n,
72 UMLObject::ObjectType t = UMLObject::ot_UMLObject);
73 virtual UMLObject *findChildObjectById(Uml::ID::Type id, bool considerAncestors = false);
74
75 virtual QString uniqChildName(const UMLObject::ObjectType type,
76 const QString &prefix = QString());
77
78 virtual void removeAllChildObjects();
79
80 UMLObjectList &subordinates() const {
81 m_List.removeAll(0);
82 return m_List;
83 }
84
85 virtual bool resolveRef();
86
87 // The abstract method UMLObject::saveToXMI1() is implemented
88 // in the classes inheriting from UMLCanvasObject.
89
90 private:
91
100 mutable UMLObjectList m_List;
101
102 signals:
103
104 void sigAssociationEndAdded(UMLAssociation * assoc);
105 void sigAssociationEndRemoved(UMLAssociation * assoc);
106
107 };
108
109 #endif
UMLObject::id
virtual Uml::ID::Type id() const
Definition: umlobject.cpp:425
template.h
UMLObject::ObjectType
ObjectType
Definition: umlobject.h:80
UMLCanvasObject::copyInto
virtual void copyInto(UMLObject *lhs) const
Definition: umlcanvasobject.cpp:298
UMLCanvasObject::getSuperClasses
UMLClassifierList getSuperClasses(bool withRealizations=true)
Definition: umlcanvasobject.cpp:349
UMLObject::ot_CheckConstraint
@ ot_CheckConstraint
Definition: umlobject.h:107
UMLObject::name
QString name() const
Definition: umlobject.cpp:211
UMLApp::activeLanguageIsCaseSensitive
bool activeLanguageIsCaseSensitive()
Definition: uml.cpp:2517
stereotype.h
UMLCanvasObject::getAssociations
UMLAssociationList getAssociations()
Definition: umlcanvasobject.cpp:329
UMLCanvasObject
Non-graphical information for a UMLCanvasObject.
Definition: umlcanvasobject.h:34
UMLCanvasObject::uniqChildName
virtual QString uniqChildName(const UMLObject::ObjectType type, const QString &prefix=QString())
Definition: umlcanvasobject.cpp:180
UMLObject::ot_Association
@ ot_Association
Definition: umlobject.h:91
UMLCanvasObject::removeAllAssociationEnds
void removeAllAssociationEnds()
Definition: umlcanvasobject.cpp:129
UMLObject::ot_ForeignKeyConstraint
@ ot_ForeignKeyConstraint
Definition: umlobject.h:106
UMLCanvasObject::sigAssociationEndRemoved
void sigAssociationEndRemoved(UMLAssociation *assoc)
UMLObject::resolveRef
virtual bool resolveRef()
Definition: umlobject.cpp:738
operation.h
DEBUG_REGISTER_DISABLED
#define DEBUG_REGISTER_DISABLED(src)
Definition: debug_utils.h:132
Uml::ID::None
const Type None
special value for uninitialized ID
Definition: basictypes.h:353
Uml::RoleType::A
@ A
Definition: basictypes.h:239
UMLObject::ot_Attribute
@ ot_Attribute
Definition: umlobject.h:92
UMLCanvasObject::~UMLCanvasObject
virtual ~UMLCanvasObject()
Definition: umlcanvasobject.cpp:45
Uml::ID::toString
QString toString(const ID::Type &id)
Definition: basictypes.cpp:1263
UMLCanvasObject::removeAllChildObjects
virtual void removeAllChildObjects()
Definition: umlcanvasobject.cpp:161
UMLObject::emitModified
void emitModified()
Definition: umlobject.cpp:385
umlcanvasobject.h
association.h
UMLCanvasObject::findChildObjectById
virtual UMLObject * findChildObjectById(Uml::ID::Type id, bool considerAncestors=false)
Definition: umlcanvasobject.cpp:261
UMLClassifierList
QList< UMLClassifier * > UMLClassifierList
Definition: umlclassifierlist.h:17
UMLObject::asUMLAssociation
UMLAssociation * asUMLAssociation()
Definition: umlobject.cpp:1303
Uml::ID::Type
std::string Type
Definition: basictypes.h:351
UMLObject::ot_UMLObject
@ ot_UMLObject
Definition: umlobject.h:82
Uml::AssociationType::Relationship
@ Relationship
Definition: basictypes.h:126
UMLObject
The base class for UML objects.
Definition: umlobject.h:74
UMLObject::ot_InstanceAttribute
@ ot_InstanceAttribute
Definition: umlobject.h:110
UMLAssociation::getObject
UMLObject * getObject(Uml::RoleType::Enum role) const
Definition: association.cpp:496
UMLObject::baseType
ObjectType baseType() const
Definition: umlobject.cpp:397
UMLObject::ot_EnumLiteral
@ ot_EnumLiteral
Definition: umlobject.h:94
Uml::AssociationType::Aggregation
@ Aggregation
Definition: basictypes.h:108
UMLCanvasObject::hasAssociation
bool hasAssociation(UMLAssociation *assoc)
Definition: umlcanvasobject.cpp:101
UMLCanvasObject::m_List
UMLObjectList m_List
Definition: umlcanvasobject.h:100
UMLCanvasObject::operator==
bool operator==(const UMLCanvasObject &rhs) const
Definition: umlcanvasobject.cpp:274
UMLObject::asUMLCanvasObject
UMLCanvasObject * asUMLCanvasObject()
Definition: umlobject.cpp:1305
UMLCanvasObject::getSpecificAssocs
UMLAssociationList getSpecificAssocs(Uml::AssociationType::Enum assocType)
Definition: umlcanvasobject.cpp:61
attribute.h
a
QString a
Definition: petalnode.cpp:18
uWarning
#define uWarning()
Definition: debug_utils.h:124
UMLCanvasObject::removeAssociationEnd
int removeAssociationEnd(UMLAssociation *assoc)
Definition: umlcanvasobject.cpp:114
UMLObject::copyInto
virtual void copyInto(UMLObject *lhs) const
Definition: umlobject.cpp:314
i18n
#define i18n
Definition: main.cpp:39
umlclassifierlist.h
UMLObject::ot_EntityAttribute
@ ot_EntityAttribute
Definition: umlobject.h:102
UMLCanvasObject::getSubClasses
UMLClassifierList getSubClasses()
Definition: umlcanvasobject.cpp:377
UMLCanvasObject::sigAssociationEndAdded
void sigAssociationEndAdded(UMLAssociation *assoc)
UMLCanvasObject::UMLCanvasObject
UMLCanvasObject(const QString &name=QString(), Uml::ID::Type id=Uml::ID::None)
Definition: umlcanvasobject.cpp:37
Uml::RoleType::B
@ B
Definition: basictypes.h:240
UMLObject::toString
static QString toString(ObjectType ot)
Definition: umlobject.cpp:1124
UMLObject::ot_UniqueConstraint
@ ot_UniqueConstraint
Definition: umlobject.h:105
Uml::AssociationType::Enum
Enum
Definition: basictypes.h:106
Uml::AssociationType::Generalization
@ Generalization
Definition: basictypes.h:107
UMLApp::app
static UMLApp * app()
Definition: uml.cpp:269
UMLCanvasObject::getRelationships
UMLAssociationList getRelationships()
Definition: umlcanvasobject.cpp:432
UMLCanvasObject::subordinates
UMLObjectList & subordinates() const
Definition: umlcanvasobject.h:80
UMLCanvasObject::findChildObject
virtual UMLObject * findChildObject(const QString &n, UMLObject::ObjectType t=UMLObject::ot_UMLObject)
Definition: umlcanvasobject.cpp:238
Uml
Definition: basictypes.cpp:37
UMLCanvasObject::resolveRef
virtual bool resolveRef()
Definition: umlcanvasobject.cpp:440
UMLCanvasObject::getAggregations
UMLAssociationList getAggregations()
Definition: umlcanvasobject.cpp:412
DEBUG
#define DEBUG(src)
Definition: debug_utils.h:129
classifier.h
uml.h
UMLClassifier
Information for a non-graphical Concept/Class.
Definition: classifier.h:40
debug_utils.h
UMLCanvasObject::addAssociationEnd
bool addAssociationEnd(UMLAssociation *assoc)
Definition: umlcanvasobject.cpp:80
umlassociationlist.h
UMLAssociation
Sets up association information.
Definition: association.h:33
UMLCanvasObject::getRealizations
virtual UMLAssociationList getRealizations()
Definition: umlcanvasobject.cpp:402
UMLCanvasObject::getCompositions
UMLAssociationList getCompositions()
Definition: umlcanvasobject.cpp:422
DBG_SRC
#define DBG_SRC
Definition: import_utils.cpp:43
umlobject.h
UMLObject::ot_Template
@ ot_Template
Definition: umlobject.h:95
UMLDoc::removeAssociation
void removeAssociation(UMLAssociation *assoc, bool doSetModified=true)
Definition: umldoc.cpp:1396
Uml::AssociationType::Composition
@ Composition
Definition: basictypes.h:117
idchangelog.h
b
bool b
Definition: cxx11-null-pointer-constant.h:6
uIgnoreZeroPointer
#define uIgnoreZeroPointer(a)
Definition: debug_utils.h:134
UMLObject::ot_Operation
@ ot_Operation
Definition: umlobject.h:93
umlobjectlist.h
UMLCanvasObject::associations
int associations()
Definition: umlcanvasobject.cpp:314
UMLObjectList
Definition: umlobjectlist.h:29
UMLAssociationList
QList< UMLAssociation * > UMLAssociationList
Definition: umlassociationlist.h:18
UMLApp::document
UMLDoc * document() const
Definition: uml.cpp:1055
Uml::AssociationType::Realization
@ Realization
Definition: basictypes.h:118
umldoc.h