umbrello/umbrello
classifier.cpp
Go to the documentation of this file.
285 i18n("An operation with the same name and signature already exists. You cannot add it again."));
561 UMLObject* UMLClassifier::findChildObjectById(Uml::ID::Type id, bool considerAncestors /* =false */)
818 UMLAttribute* UMLClassifier::addAttribute(const QString &name, Uml::ID::Type id /* = Uml::id_None */)
843 UMLAttribute* UMLClassifier::addAttribute(const QString &name, UMLObject *type, Visibility::Enum scope)
968 UMLOperationList UMLClassifier::getOpList(bool includeInherited, UMLClassifierSet *alreadyTraversed)
1442 QDomElement tmplElement = qDoc.createElement(QLatin1String("UML:ModelElement.templateParameter"));
1452 QDomElement genElement = qDoc.createElement(QLatin1String("UML:GeneralizableElement.generalization"));
int removeAttribute(UMLAttribute *att)
Removes an attribute from the class.
Definition: classifier.cpp:901
QObject * child(const char *objName, const char *inheritsClass, bool recursiveSearch) const
void attributeAdded(UMLClassifierListItem *)
void operationAdded(UMLClassifierListItem *)
UMLAssociationList getAggregations()
Shorthand for getSpecificAssocs(Uml::at_Aggregation)
Definition: umlcanvasobject.cpp:423
void templateAdded(UMLClassifierListItem *)
void operationRemoved(UMLClassifierListItem *)
UMLTemplate * addTemplate(const QString &name, Uml::ID::Type id=Uml::ID::None)
Adds an already created template.
Definition: classifier.cpp:1051
UMLObject * getObject(Uml::RoleType::Enum role) const
Returns the UMLObject assigned to the given role.
Definition: association.cpp:497
Definition: umlobject.h:61
This class contains the non-graphical information required for a UML Package.
Definition: package.h:32
int associations()
Returns the number of associations for the CanvasObject.
Definition: umlcanvasobject.cpp:319
This sub-class adds copyInto and clone to the QPtrList base class...
Definition: umlclassifierlistitemlist.h:26
QString & append(QChar ch)
This class defines the non-graphical information required for a UML Classifier (ie a class or interfa...
Definition: classifier.h:39
virtual bool acceptAssociationType(Uml::AssociationType::Enum type)
Reimplemented from UMLObject.
Definition: classifier.cpp:734
Definition: classifier.h:47
UMLAssociationList getSpecificAssocs(Uml::AssociationType::Enum assocType)
Return the subset of m_List that matches the given type.
Definition: umlcanvasobject.cpp:61
Definition: classifier.h:47
virtual bool loadFromXMI(QDomElement &element)
This method loads the generic parts of the XMI common to most model classes.
Definition: umlobject.cpp:912
Classifiers (classes, interfaces) have lists of operations, attributes, templates and others...
Definition: classifierlistitem.h:29
QDomNode appendChild(const QDomNode &newChild)
Definition: basictypes.h:215
virtual void setType(UMLObject *type)
Sets the type of the UMLAttribute.
Definition: classifierlistitem.cpp:125
Uml::Visibility::Enum visibility() const
Returns the visibility of the object.
Definition: umlobject.cpp:431
UMLAttributeList getAttributeListStatic(Uml::Visibility::Enum scope) const
Returns the static attributes for the specified scope.
Definition: classifier.cpp:501
virtual UMLClassifierListItemList getFilteredList(UMLObject::ObjectType ot) const
Returns the entries in m_List that are of the requested type.
Definition: classifier.cpp:1027
QString attribute(const QString &name, const QString &defValue) const
bool operator==(const UMLCanvasObject &rhs) const
Overloaded '==' operator.
Definition: umlcanvasobject.cpp:282
void setVisibility(Uml::Visibility::Enum s)
Reimplementation of method from UMLObject is required as an extra signal, attributeChanged(), is emitted.
Definition: attribute.cpp:87
virtual UMLAttribute * createAttribute(const QString &name=QString(), UMLObject *type=0, Uml::Visibility::Enum vis=Uml::Visibility::Private, const QString &init=QString())
Creates an attribute for the class.
Definition: classifier.cpp:764
static bool tagEq(const QString &tag, const QString &pattern)
Function for comparing tags in XMI files.
Definition: umldoc.cpp:3081
virtual bool load(QDomElement &element)
Auxiliary to loadFromXMI: The loading of operations is implemented here.
Definition: classifier.cpp:1525
iterator begin()
Definition: icon_utils.h:88
This class contains all the ID translations done for each UMLObject pasted.
Definition: idchangelog.h:26
void setIsReference(bool isRef=true)
Set the m_isRef flag (true when dealing with a pointer type)
Definition: classifier.cpp:1289
UMLOperation * createOperation(const QString &name=QString(), bool *isExistingOp=NULL, Model_Utils::NameAndType_List *params=NULL)
Creates an operation in the current document.
Definition: classifier.cpp:243
Definition: basictypes.h:216
const T & at(int i) const
int removeTemplate(UMLTemplate *umltemplate)
Removes a template from the class.
Definition: classifier.cpp:1128
void setName(const QString &name)
Reimplementation of method from UMLObject is required as an extra signal, attributeChanged(), is emitted.
Definition: attribute.cpp:76
void setBaseType(UMLObject::ObjectType ot)
Reimplementation of method from class UMLObject for controlling the exact type of this classifier: cl...
Definition: classifier.cpp:82
This sub-class adds copyInto and clone to the QPtrList base class.
Definition: umlattributelist.h:26
T takeAt(int i)
Definition: umlattributedialog.h:28
This class holds information used by template classes, called paramaterised class in UML and a generi...
Definition: template.h:26
Definition: umlobject.h:60
UMLOperationList findOperations(const QString &n)
Find a list of operations with the given name.
Definition: classifier.cpp:536
Definition: umlobject.h:62
Definition: umloperationdialog.h:37
virtual void saveToXMI(QDomDocument &qDoc, QDomElement &qElement)
Creates the XMI element.
Definition: package.cpp:388
UMLDoc * document() const
Returns a pointer to the current document connected to the KMainWindow instance.
Definition: uml.cpp:910
bool disconnect(const QObject *sender, const char *signal, const QObject *receiver, const char *method)
void removeChangeByNewID(Uml::ID::Type OldID)
Definition: idchangelog.cpp:124
iterator end()
UMLOperation * checkOperationSignature(const QString &name, UMLAttributeList opParams, UMLOperation *exemptOp=NULL)
Checks whether an operation is valid based on its signature - An operation is "valid" if the operatio...
Definition: classifier.cpp:141
QString toString(Uml::SignatureType::Enum sig=Uml::SignatureType::NoSig)
Returns a string representation of the operation.
Definition: operation.cpp:199
virtual void copyInto(UMLObjectList *rhs) const
Copy the internal presentation of this object into the new object.
Definition: umlobjectlist.cpp:26
int removeOperation(UMLOperation *op)
Remove an operation from the Classifier.
Definition: classifier.cpp:372
Definition: basictypes.h:104
bool isNull() const
Definition: basictypes.h:58
This class contains the non-graphic representation of an association.
Definition: association.h:32
int indexOf(const T &value, int from) const
QDomElement toElement() const
int count(const T &value) const
void signalEnumLiteralRemoved(UMLClassifierListItem *elit)
Emit the enumLiteralRemoved signal.
Definition: enum.cpp:231
void saveToXMI(QDomDocument &qDoc, QDomElement &qElement)
Saves to the XMI element.
Definition: operation.cpp:448
Definition: basictypes.h:142
bool addOperation(UMLOperation *op, int position=-1)
Appends an operation to the classifier.
Definition: classifier.cpp:312
QString number(int n, int base)
int count(const T &value) const
void append(const T &value)
A dialog to edit the properties of a class template (paramaterised class)
Definition: umltemplatedialog.h:28
virtual bool resolveRef()
Resolve referenced objects (if any.) Needs to be called after all UML objects are loaded from file...
Definition: umlobject.cpp:707
UMLClassifier(const QString &name=QString(), Uml::ID::Type id=Uml::ID::None)
Sets up a Classifier.
Definition: classifier.cpp:62
bool isInterface() const
Returns true if this classifier represents an interface.
Definition: classifier.cpp:117
void addParm(UMLAttribute *parameter, int position=-1)
Add a parameter to the operation.
Definition: operation.cpp:260
void setClassAssoc(UMLAssociation *assoc)
Sets the UMLAssociation for which this class shall act as an association class.
Definition: classifier.cpp:920
Uml::ParameterDirection::Enum m_direction
Definition: model_utils.h:102
bool setUMLPackage(UMLPackage *pPkg)
Sets the UMLPackage in which this class is located.
Definition: umlobject.cpp:543
void setAttribute(const QString &name, const QString &value)
UMLClassifierList findSubClassConcepts(ClassifierType type=ALL)
Returns a list of concepts which inherit from this concept.
Definition: classifier.cpp:585
void removeObject(UMLObject *pObject)
Removes an object from this package.
Definition: package.cpp:193
Definition: icon_utils.h:76
void attributeRemoved(UMLClassifierListItem *)
bool isEmpty() const
int removeAll(const T &value)
void saveToXMI(QDomDocument &qDoc, QDomElement &qElement)
Utility method called by "get*ChildClassfierList()" methods.
Definition: classifier.cpp:1413
Definition: basictypes.h:60
UMLAssociationList getCompositions()
Shorthand for getSpecificAssocs(Uml::at_Composition)
Definition: umlcanvasobject.cpp:433
virtual bool resolveRef()
Needs to be called after all UML objects are loaded from file.
Definition: classifier.cpp:700
virtual UMLObject * findChildObjectById(Uml::ID::Type id, bool considerAncestors=false)
Find an association.
Definition: umlcanvasobject.cpp:266
virtual UMLObject * findChildObject(const QString &n, UMLObject::ObjectType t=UMLObject::ot_UMLObject)
Find a child object with the given name.
Definition: umlcanvasobject.cpp:240
bool hasStaticAttributes()
Return true if this classifier has static attributes.
Definition: classifier.cpp:1331
bool hasVectorFields()
Return true if this classifier has vector fields.
Definition: classifier.cpp:1369
virtual UMLAssociationList getUniAssociationToBeImplemented()
Return the list of unidirectional association that should show up in the code.
Definition: classifier.cpp:1377
This class is used to set up information for an enum literal.
Definition: enumliteral.h:25
bool hasChildNodes() const
Definition: model_utils.h:99
virtual void copyInto(UMLObject *lhs) const
Copy the internal presentation of this object into the new object.
Definition: classifier.cpp:673
QString toLower() const
void setParent(QObject *parent)
QString stereotype(bool includeAdornments=false) const
Returns the stereotype.
Definition: umlobject.cpp:579
bool isCommonXMIAttribute(const QString &tag)
Return true if the given tag is one of the common XMI attributes, such as: "name" | "visibility" | "i...
Definition: model_utils.cpp:525
virtual UMLObject * findChildObjectById(Uml::ID::Type id, bool considerAncestors=false)
Find the child object by the given id.
Definition: classifier.cpp:561
Definition: basictypes.h:57
void signalEntityAttributeRemoved(UMLClassifierListItem *eattr)
Emit the entityAttributeRemoved signal.
Definition: entity.cpp:400
QLinkedList< NameAndType >::iterator NameAndType_ListIt
Auxiliary type for OpDescriptor.
Definition: model_utils.h:113
Definition: umlobject.h:59
UMLClassifierList findSuperClassConcepts(ClassifierType type=ALL)
Returns a list of concepts which this concept inherits from.
Definition: classifier.cpp:624
bool isNull() const
void treeViewChangeIcon(UMLObject *object, Icon_Utils::IconType to)
Change an icon of an object in the tree view.
Definition: model_utils.cpp:351
This class contains the non-graphical information required for a UML Enum.
Definition: enum.h:28
Definition: umlobject.h:54
bool isStatic() const
Returns true if this UMLObject has classifier scope, otherwise false (the default).
Definition: umlobject.cpp:331
Definition: umlobject.h:58
QDomElement save(const QString &tag, QDomDocument &qDoc)
Auxiliary to saveToXMI.
Definition: umlobject.cpp:806
UMLAttributeList getAttributeList() const
Returns the attributes for the specified scope.
Definition: classifier.cpp:449
QDomNode firstChild() const
Definition: classifier.h:47
This class is used to set up information for an entityattribute.
Definition: entityattribute.h:25
UMLClassifierList getSubClasses()
Return a list of the classes that inherit from this concept.
Definition: umlcanvasobject.cpp:388
virtual void copyInto(UMLObject *lhs) const
Copy the internal presentation of this object into the new object.
Definition: umlcanvasobject.cpp:303
UMLClassifier * originType() const
Get the origin type (in case of e.g.
Definition: classifier.cpp:1280
Definition: umlobject.h:57
void insert(int i, const T &value)
virtual void saveToXMI(QDomDocument &qDoc, QDomElement &qElement)=0
UMLObject * makeObjectFromXMI(const QString &xmiTag, const QString &stereoID)
Make a new UMLObject according to the given XMI tag.
Definition: object_factory.cpp:355
virtual UMLClassifierListItem * makeChildObject(const QString &xmiTag)
utility functions to allow easy determination of what classifiers are "owned" by the current one via ...
Definition: classifier.cpp:1501
UMLClassifierList getSuperClasses(bool withRealizations=true)
Return a list of the superclasses of this concept.
Definition: umlcanvasobject.cpp:360
UMLObject * createTemplate(const QString &name=QString())
Create and add a just created template.
Definition: classifier.cpp:395
bool activeLanguageIsCaseSensitive()
Return true if the active language is case sensitive.
Definition: uml.cpp:2447
Definition: umlobject.h:50
bool hasAbstractOps()
Return true if this classifier has abstract operations.
Definition: classifier.cpp:938
T & last()
bool isDatatype() const
Returns true if this classifier represents a datatype.
Definition: classifier.cpp:125
UMLObjectList m_objects
References to the objects contained in this package.
Definition: package.h:75
int length() const
UMLOperationList getOpList(bool includeInherited=false, UMLClassifierSet *alreadyTraversed=0)
Return a list of operations for the Classifier.
Definition: classifier.cpp:968
bool hasAccessorMethods()
Return true if this classifier has accessor methods.
Definition: classifier.cpp:1341
QString getRoleName(Uml::RoleType::Enum role) const
Returns the name assigned to the role A.
Definition: association.cpp:568
QString tagName() const
UMLAttribute * addAttribute(const QString &name, Uml::ID::Type id=Uml::ID::None)
Creates and adds an attribute for the class.
Definition: classifier.cpp:818
Uml::ID::Type getObjectId(Uml::RoleType::Enum role) const
Returns the ID of the UMLObject assigned to the given role.
Definition: association.cpp:509
virtual QString uniqChildName(const UMLObject::ObjectType type, const QString &prefix=QString())
Returns a name for the new association, operation, template or attribute appended with a number if th...
Definition: umlcanvasobject.cpp:185
Definition: umlobject.h:53
virtual void setID(Uml::ID::Type NewID)
Assigns a new Id to the object.
Definition: umlobject.cpp:158
QDomElement createElement(const QString &tagName)
QString m_SecondaryId
xmi.id of the secondary object for intermediate use during loading.
Definition: umlobject.h:186
UMLTemplate * findTemplate(const QString &name)
Seeks the template parameter of the given name.
Definition: classifier.cpp:1145
bool hasOperationMethods()
Return true if this classifier has operation methods.
Definition: classifier.cpp:1349
UMLOperation * findOperation(const QString &name, Model_Utils::NameAndType_List params)
Find an operation of the given name and parameter signature.
Definition: classifier.cpp:186
bool connect(const QObject *sender, const char *signal, const QObject *receiver, const char *method, Qt::ConnectionType type)
void setOriginType(UMLClassifier *origType)
Set the origin type (in case of e.g.
Definition: classifier.cpp:1271
int takeItem(UMLClassifierListItem *item)
Take and return a subordinate item from this classifier.
Definition: classifier.cpp:1194
Definition: icon_utils.h:87
void modified()
bool operator==(const UMLClassifier &rhs) const
Overloaded '==' operator.
Definition: classifier.cpp:656
Definition: basictypes.h:59
Definition: umlobject.h:55
void templateRemoved(UMLClassifierListItem *)
virtual UMLAssociationList getRealizations()
Shorthand for getSpecificAssocs(Uml::at_Realization)
Definition: umlcanvasobject.cpp:413
Definition: umlobject.h:69
Uml::Visibility::Enum defaultAttributeScope
Definition: optionstate.h:72
UMLObject * m_pSecondary
pointer to an associated object Only a few of the classes inheriting from UMLObject use this...
Definition: umlobject.h:182
This class contains the non-graphical information required for a UML Entity.
Definition: entity.h:34
UMLAssociation * getClassAssoc() const
Returns the UMLAssociation for which this class acts as an association class.
Definition: classifier.cpp:930
bool hasAssociations()
Return true if this classifier has associations.
Definition: classifier.cpp:1307
void setParmKind(Uml::ParameterDirection::Enum pk)
Definition: attribute.cpp:117
Definition: icon_utils.h:81
void signalUMLObjectCreated(UMLObject *o)
Signal that a UMLObject has been created.
Definition: umldoc.cpp:1649
This file is part of the KDE documentation.
Documentation copyright © 1996-2020 The KDE developers.
Generated on Mon Jun 22 2020 13:40:25 by doxygen 1.8.7 written by Dimitri van Heesch, © 1997-2006
Documentation copyright © 1996-2020 The KDE developers.
Generated on Mon Jun 22 2020 13:40:25 by doxygen 1.8.7 written by Dimitri van Heesch, © 1997-2006
KDE's Doxygen guidelines are available online.