umbrello/umbrello
#include <umlobject.h>
Public Types | |
enum | ObjectType { ot_Unknown = -1, ot_UMLObject = 100, ot_Actor, ot_UseCase, ot_Package, ot_Interface, ot_Datatype, ot_Enum, ot_Class, ot_Association, ot_Attribute, ot_Operation, ot_EnumLiteral, ot_Template, ot_Component, ot_Artifact, ot_Node, ot_Stereotype, ot_Role, ot_Entity, ot_EntityAttribute, ot_Folder, ot_EntityConstraint, ot_UniqueConstraint, ot_ForeignKeyConstraint, ot_CheckConstraint, ot_Category, ot_Port } |
Public Slots | |
void | emitModified () |
Signals | |
void | modified () |
Public Member Functions | |
UMLObject (UMLObject *parent, const QString &name, Uml::ID::Type id=Uml::ID::None) | |
UMLObject (UMLObject *parent) | |
UMLObject (const QString &name=QString(), Uml::ID::Type id=Uml::ID::None) | |
virtual | ~UMLObject () |
virtual bool | acceptAssociationType (Uml::AssociationType::Enum) |
ObjectType | baseType () const |
QLatin1String | baseTypeStr () const |
virtual UMLObject * | clone () const =0 |
virtual void | copyInto (UMLObject *lhs) const |
QString | doc () const |
virtual QString | fullyQualifiedName (const QString &separator=QString(), bool includeRoot=false) const |
bool | hasDoc () const |
virtual Uml::ID::Type | id () const |
bool | isAbstract () const |
bool | isStatic () const |
virtual bool | loadFromXMI (QDomElement &element) |
bool | loadStereotype (QDomElement &element) |
QString | name () const |
bool | operator== (const UMLObject &rhs) const |
QString | package (const QString &separator=QString(), bool includeRoot=false) |
UMLPackageList | packages (bool includeRoot=false) const |
virtual bool | resolveRef () |
QDomElement | save (const QString &tag, QDomDocument &qDoc) |
virtual void | saveToXMI (QDomDocument &qDoc, QDomElement &qElement)=0 |
QString | secondaryFallback () const |
QString | secondaryId () const |
void | setAbstract (bool bAbstract) |
virtual void | setBaseType (ObjectType ot) |
void | setDoc (const QString &d) |
virtual void | setID (Uml::ID::Type NewID) |
virtual void | setName (const QString &strName) |
void | setNameCmd (const QString &strName) |
void | setPackage (const QString &_name) |
void | setSecondaryFallback (const QString &id) |
void | setSecondaryId (const QString &id) |
void | setStatic (bool bStatic) |
void | setStereotype (const QString &_name) |
void | setStereotypeCmd (const QString &_name) |
bool | setUMLPackage (UMLPackage *pPkg) |
void | setUMLStereotype (UMLStereotype *stereo) |
void | setVisibility (Uml::Visibility::Enum visibility) |
void | setVisibilityCmd (Uml::Visibility::Enum visibility) |
virtual bool | showPropertiesPagedDialog (int page=0, bool assoc=false) |
QString | stereotype (bool includeAdornments=false) const |
UMLPackage * | umlPackage () |
const UMLStereotype * | umlStereotype () |
Uml::Visibility::Enum | visibility () const |
Public Member Functions inherited from QObject | |
QObject (QObject *parent) | |
QObject (QObject *parent, const char *name) | |
virtual | ~QObject () |
bool | blockSignals (bool block) |
QObject * | child (const char *objName, const char *inheritsClass, bool recursiveSearch) const |
const QObjectList & | children () const |
const char * | className () const |
bool | connect (const QObject *sender, const char *signal, const char *method, Qt::ConnectionType type) const |
void | deleteLater () |
void | destroyed (QObject *obj) |
bool | disconnect (const QObject *receiver, const char *method) |
bool | disconnect (const char *signal, const QObject *receiver, const char *method) |
void | dumpObjectInfo () |
void | dumpObjectTree () |
QList< QByteArray > | dynamicPropertyNames () const |
virtual bool | event (QEvent *e) |
virtual bool | eventFilter (QObject *watched, QEvent *event) |
T | findChild (const QString &name) const |
QList< T > | findChildren (const QRegExp ®Exp) const |
QList< T > | findChildren (const QString &name) const |
bool | inherits (const char *className) const |
void | insertChild (QObject *object) |
void | installEventFilter (QObject *filterObj) |
bool | isA (const char *className) const |
bool | isWidgetType () const |
void | killTimer (int id) |
virtual const QMetaObject * | metaObject () const |
void | moveToThread (QThread *targetThread) |
const char * | name () const |
const char * | name (const char *defaultName) const |
QString | objectName () const |
QObject * | parent () const |
QVariant | property (const char *name) const |
void | removeChild (QObject *object) |
void | removeEventFilter (QObject *obj) |
void | setName (const char *name) |
void | setObjectName (const QString &name) |
void | setParent (QObject *parent) |
bool | setProperty (const char *name, const QVariant &value) |
bool | signalsBlocked () const |
int | startTimer (int interval) |
QThread * | thread () const |
Static Public Member Functions | |
static QString | toString (ObjectType ot) |
Static Public Member Functions inherited from QObject | |
bool | connect (const QObject *sender, const char *signal, const QObject *receiver, const char *method, Qt::ConnectionType type) |
bool | connect (const QObject *sender, const QMetaMethod &signal, const QObject *receiver, const QMetaMethod &method, Qt::ConnectionType type) |
bool | disconnect (const QObject *sender, const char *signal, const QObject *receiver, const char *method) |
bool | disconnect (const QObject *sender, const QMetaMethod &signal, const QObject *receiver, const QMetaMethod &method) |
QString | tr (const char *sourceText, const char *disambiguation, int n) |
QString | trUtf8 (const char *sourceText, const char *disambiguation, int n) |
Protected Member Functions | |
void | init () |
virtual bool | load (QDomElement &element) |
void | maybeSignalObjectCreated () |
Protected Member Functions inherited from QObject | |
bool | checkConnectArgs (const char *signal, const QObject *object, const char *method) |
virtual void | childEvent (QChildEvent *event) |
virtual void | connectNotify (const char *signal) |
virtual void | customEvent (QEvent *event) |
virtual void | disconnectNotify (const char *signal) |
int | receivers (const char *signal) const |
QObject * | sender () const |
int | senderSignalIndex () const |
virtual void | timerEvent (QTimerEvent *event) |
Protected Attributes | |
bool | m_bAbstract |
ObjectType | m_BaseType |
bool | m_bCreationWasSignalled |
bool | m_bInPaste |
bool | m_bStatic |
QString | m_Doc |
QString | m_name |
Uml::ID::Type | m_nId |
UMLObject * | m_pSecondary |
UMLStereotype * | m_pStereotype |
UMLPackage * | m_pUMLPackage |
QString | m_SecondaryFallback |
QString | m_SecondaryId |
Uml::Visibility::Enum | m_visibility |
Friends | |
QDebug | operator<< (QDebug out, const UMLObject &obj) |
Additional Inherited Members | |
Static Protected Member Functions inherited from QObject | |
QByteArray | normalizeSignalSlot (const char *signalSlot) |
Properties inherited from QObject | |
objectName | |
Detailed Description
This class is the non-graphical version of UMLWidget.
These are created and maintained in the class UMLDoc. This class holds all the generic information needed for all UML objects.
clone needs to be implemented by each child class.
saveToXMI saves the XMI attributes of each specific model class. It needs to be implemented by each child class. For creating the QDomElement and saving the common XMI parts, it can use the save() method.
The base class for UML objects.
Definition at line 41 of file umlobject.h.
Member Enumeration Documentation
Definition at line 47 of file umlobject.h.
Constructor & Destructor Documentation
|
explicit |
Creates a UMLObject.
- Parameters
-
parent The parent of the object. name The name of the object. id The ID of the object (optional.) If omitted then a new ID will be assigned internally.
Definition at line 48 of file umlobject.cpp.
|
explicit |
Creates a UMLObject.
- Parameters
-
parent The parent of the object.
Definition at line 78 of file umlobject.cpp.
|
explicit |
Creates a UMLObject.
- Parameters
-
name The name of the object. id The ID of the object (optional.) If omitted then a new ID will be assigned internally.
Definition at line 64 of file umlobject.cpp.
|
virtual |
Standard destructor.
Definition at line 89 of file umlobject.cpp.
Member Function Documentation
|
virtual |
This should be reimplemented by subclasses if they wish to accept certain types of associations.
Note that this only tells if this UMLObject can accept the association type. When creating an association another check is made to see if the association is valid. For example a UMLClass (UMLClassifier) can accept generalizations and should return true. If while creating a generalization the superclass is already subclassed from this, the association is not valid and will not be created. The default accepts nothing (returns false)
Reimplemented in UMLClassifier.
Definition at line 148 of file umlobject.cpp.
UMLObject::ObjectType UMLObject::baseType | ( | ) | const |
Returns the type of the object.
- Returns
- Returns the type of the object.
Definition at line 362 of file umlobject.cpp.
QLatin1String UMLObject::baseTypeStr | ( | ) | const |
- Returns
- The type used for rtti as string.
Definition at line 370 of file umlobject.cpp.
|
pure virtual |
Implemented in UMLAssociation, UMLClassifierListItem, UMLForeignKeyConstraint, UMLClassifier, UMLStereotype, UMLEntityAttribute, UMLAttribute, UMLRole, UMLArtifact, UMLCategory, UMLEntity, UMLEntityConstraint, UMLFolder, UMLPackage, UMLUniqueConstraint, UMLCheckConstraint, UMLEnum, UMLOperation, UMLTemplate, UMLActor, UMLEnumLiteral, UMLNode, UMLPort, UMLComponent, and UMLUseCase.
|
virtual |
Copy the internal presentation of this object into the new object.
Reimplemented in UMLClassifierListItem, UMLForeignKeyConstraint, UMLClassifier, UMLStereotype, UMLEntityAttribute, UMLCategory, UMLEntity, UMLCanvasObject, UMLAttribute, UMLEntityConstraint, UMLPackage, UMLUniqueConstraint, UMLCheckConstraint, UMLEnum, UMLOperation, UMLTemplate, and UMLEnumLiteral.
Definition at line 288 of file umlobject.cpp.
QString UMLObject::doc | ( | ) | const |
Returns the documentation for the object.
- Returns
- Returns the documentation for the object.
Definition at line 400 of file umlobject.cpp.
|
slot |
Forces the emission of the modified signal.
Useful when updating several attributes at a time: you can block the signals, update all atts, and then force the signal.
Definition at line 350 of file umlobject.cpp.
|
virtual |
Returns the fully qualified name, i.e.
all package prefixes and then m_name.
- Parameters
-
separator The separator string to use (optional.) If not given then the separator is chosen according to the currently selected active programming language of import and code generation. includeRoot Whether to prefix the root folder name to the FQN. See UMLDoc::getRootFolder(). Default: false.
- Returns
- The fully qualified name of this UMLObject.
Definition at line 202 of file umlobject.cpp.
bool UMLObject::hasDoc | ( | ) | const |
Returns state of documentation for the object.
- Returns
- false if documentation is empty
Definition at line 410 of file umlobject.cpp.
|
virtual |
Returns the ID of the object.
- Returns
- Returns the ID of the object.
Definition at line 390 of file umlobject.cpp.
|
protected |
Initializes key variables of the class.
Definition at line 96 of file umlobject.cpp.
bool UMLObject::isAbstract | ( | ) | const |
Returns the abstract state of the object.
Definition at line 313 of file umlobject.cpp.
bool UMLObject::isStatic | ( | ) | const |
Returns true if this UMLObject has classifier scope, otherwise false (the default).
Definition at line 331 of file umlobject.cpp.
|
protectedvirtual |
Auxiliary to loadFromXMI.
This method is usually overridden by child classes. It is responsible for loading the specific XMI structure of the child class.
Reimplemented in UMLClassifier, UMLForeignKeyConstraint, UMLEntity, UMLAssociation, UMLFolder, UMLEntityAttribute, UMLOperation, UMLAttribute, UMLPackage, UMLEnum, UMLUniqueConstraint, UMLCheckConstraint, UMLArtifact, UMLCategory, UMLTemplate, UMLRole, UMLEnumLiteral, UMLComponent, UMLNode, UMLPort, UMLActor, and UMLUseCase.
Definition at line 860 of file umlobject.cpp.
|
virtual |
This method loads the generic parts of the XMI common to most model classes.
It is not usually reimplemented by child classes. Instead, it invokes the load() method which implements the loading of the specifics of each child class.
- Parameters
-
element The QDomElement from which to load.
Definition at line 912 of file umlobject.cpp.
bool UMLObject::loadStereotype | ( | QDomElement & | element | ) |
Analyzes the given QDomElement for a reference to a stereotype.
- Parameters
-
element QDomElement to analyze.
- Returns
- True if a stereotype reference was found, else false.
Definition at line 873 of file umlobject.cpp.
|
protected |
Calls UMLDoc::signalUMLObjectCreated() if m_BaseType affords doing so.
Definition at line 684 of file umlobject.cpp.
|
signal |
QString UMLObject::name | ( | ) | const |
Returns a copy of m_name.
Definition at line 186 of file umlobject.cpp.
bool UMLObject::operator== | ( | const UMLObject & | rhs | ) | const |
Overloaded '==' operator.
Definition at line 229 of file umlobject.cpp.
Return the package(s) in which this UMLObject is contained as a text.
- Parameters
-
separator Separator string for joining together the individual package prefixes (optional.) If no separator is given then the separator of the currently selected language is used. includeRoot Whether to prefix the root folder name. Default: false.
- Returns
- The UMLObject's enclosing package(s) as a text.
Definition at line 601 of file umlobject.cpp.
UMLPackageList UMLObject::packages | ( | bool | includeRoot = false | ) | const |
Return a list of the packages in which this class is embedded.
The outermost package is first in the list.
- Parameters
-
includeRoot Whether to prefix the root folder name. Default: false.
- Returns
- UMLPackageList of the containing packages.
Definition at line 621 of file umlobject.cpp.
|
virtual |
Resolve referenced objects (if any.) Needs to be called after all UML objects are loaded from file.
This needs to be done after all model objects are loaded because some of the xmi.id's might be forward references, i.e. they may identify model objects which were not yet loaded at the point of reference. The default implementation attempts resolution of the m_SecondaryId.
- Returns
- True for success.
Reimplemented in UMLClassifier, UMLForeignKeyConstraint, UMLCanvasObject, UMLAssociation, UMLEntity, UMLPackage, and UMLOperation.
Definition at line 707 of file umlobject.cpp.
QDomElement UMLObject::save | ( | const QString & | tag, |
QDomDocument & | qDoc | ||
) |
Auxiliary to saveToXMI.
Create a QDomElement with the given tag, and save the XMI attributes that are common to all child classes to the newly created element. This method does not need to be overridden by child classes.
Definition at line 806 of file umlobject.cpp.
|
pure virtual |
Implemented in UMLClassifier, UMLAssociation, UMLEntity, UMLOperation, UMLEntityAttribute, UMLPackage, UMLForeignKeyConstraint, UMLFolder, UMLStereotype, UMLAttribute, UMLEnum, UMLTemplate, UMLRole, UMLUniqueConstraint, UMLArtifact, UMLCategory, UMLCheckConstraint, UMLEnumLiteral, UMLActor, UMLNode, UMLPort, UMLComponent, and UMLUseCase.
QString UMLObject::secondaryFallback | ( | ) | const |
Return secondary ID fallback.
Required by resolveRef() for imported model files.
Definition at line 666 of file umlobject.cpp.
QString UMLObject::secondaryId | ( | ) | const |
void UMLObject::setAbstract | ( | bool | bAbstract | ) |
Sets the paste state of the object.
Definition at line 321 of file umlobject.cpp.
|
virtual |
Set the type of the object.
- Parameters
-
ot The ObjectType to set.
Reimplemented in UMLClassifier.
Definition at line 380 of file umlobject.cpp.
void UMLObject::setDoc | ( | const QString & | d | ) |
Sets the documentation for the object.
- Parameters
-
d The documentation for the object.
Definition at line 420 of file umlobject.cpp.
|
virtual |
Assigns a new Id to the object.
Definition at line 158 of file umlobject.cpp.
|
virtual |
Set the UMLObject's name.
Reimplemented in UMLAttribute.
Definition at line 167 of file umlobject.cpp.
void UMLObject::setNameCmd | ( | const QString & | strName | ) |
Method used by setName: it is called by cmdSetName, Don't use it!
Definition at line 177 of file umlobject.cpp.
void UMLObject::setPackage | ( | const QString & | _name | ) |
Sets the classes Package.
DEPRECATED - use SetUMLPackage instead.
- Parameters
-
_name The classes Package name.
Definition at line 516 of file umlobject.cpp.
void UMLObject::setSecondaryFallback | ( | const QString & | id | ) |
Set the secondary ID fallback.
Currently only used by petalTree2Uml().
Definition at line 675 of file umlobject.cpp.
void UMLObject::setSecondaryId | ( | const QString & | id | ) |
Set the secondary ID.
Currently only required by petalTree2Uml(); all other setting of the m_SecondaryID is internal to the UMLObject class hierarchy.
Definition at line 657 of file umlobject.cpp.
void UMLObject::setStatic | ( | bool | bStatic | ) |
Sets the value for m_bStatic.
Definition at line 339 of file umlobject.cpp.
void UMLObject::setStereotype | ( | const QString & | name | ) |
Sets the classes stereotype name.
Internally uses setUMLStereotype().
- Parameters
-
name Sets the classes stereotype name.
Definition at line 492 of file umlobject.cpp.
void UMLObject::setStereotypeCmd | ( | const QString & | _name | ) |
Definition at line 499 of file umlobject.cpp.
bool UMLObject::setUMLPackage | ( | UMLPackage * | pPkg | ) |
Sets the UMLPackage in which this class is located.
- Parameters
-
pPkg Pointer to the class' UMLPackage.
Definition at line 543 of file umlobject.cpp.
void UMLObject::setUMLStereotype | ( | UMLStereotype * | stereo | ) |
Sets the class' UMLStereotype.
Adjusts the reference counts at the previously set stereotype and at the new stereotype. If the previously set UMLStereotype's reference count drops to zero then the UMLStereotype is removed at the UMLDoc and it is then physically deleted.
- Parameters
-
stereo Sets the classes UMLStereotype.
Definition at line 466 of file umlobject.cpp.
void UMLObject::setVisibility | ( | Uml::Visibility::Enum | visibility | ) |
Sets the visibility of the object.
- Parameters
-
visibility The visibility of the object.
Definition at line 441 of file umlobject.cpp.
void UMLObject::setVisibilityCmd | ( | Uml::Visibility::Enum | visibility | ) |
Method used by setVisibility: it is called by cmdSetVisibility, Don't use it!
Definition at line 451 of file umlobject.cpp.
|
virtual |
This method is called if you wish to see the properties of a UMLObject.
A dialog box will be displayed from which you can change the object's properties.
- Parameters
-
page The page to show. assoc Whether to show association page.
- Returns
- True if we modified the object.
Definition at line 119 of file umlobject.cpp.
QString UMLObject::stereotype | ( | bool | includeAdornments = false | ) | const |
Returns the stereotype.
Definition at line 579 of file umlobject.cpp.
|
static |
Helper function for debug output.
Returns the given enum value as string.
- Parameters
-
ot ObjectType of which a string representation is wanted
- Returns
- the ObjectType as string
Definition at line 1079 of file umlobject.cpp.
UMLPackage * UMLObject::umlPackage | ( | ) |
Returns the UMLPackage that this class is located in.
- Returns
- Pointer to the UMLPackage of this class.
Definition at line 639 of file umlobject.cpp.
const UMLStereotype * UMLObject::umlStereotype | ( | ) |
Returns the classes UMLStereotype object.
- Returns
- Returns the classes UMLStereotype object.
Definition at line 571 of file umlobject.cpp.
Visibility::Enum UMLObject::visibility | ( | ) | const |
Returns the visibility of the object.
- Returns
- Returns the visibility of the object.
Definition at line 431 of file umlobject.cpp.
Friends And Related Function Documentation
Print UML Object to debug output stream, so it can be used like uDebug() << "This object shouldn't be here: " << illegalObject;.
Definition at line 1088 of file umlobject.cpp.
Member Data Documentation
|
protected |
state of whether the object is abstract or not
Definition at line 178 of file umlobject.h.
|
protected |
objects type
Definition at line 176 of file umlobject.h.
|
protected |
auxiliary to maybeSignalObjectCreated()
Definition at line 181 of file umlobject.h.
|
protected |
caller sets this true when in paste operation
Definition at line 180 of file umlobject.h.
|
protected |
flag for instance scope
Definition at line 179 of file umlobject.h.
|
protected |
object's documentation
Definition at line 172 of file umlobject.h.
|
protected |
objects name
Definition at line 175 of file umlobject.h.
|
protected |
object's id
Definition at line 171 of file umlobject.h.
|
protected |
pointer to an associated object Only a few of the classes inheriting from UMLObject use this.
However, it needs to be here because of inheritance graph disjunctness.
Definition at line 182 of file umlobject.h.
|
protected |
stereotype of the object if applicable
Definition at line 174 of file umlobject.h.
|
protected |
package the object belongs to if applicable
Definition at line 173 of file umlobject.h.
|
protected |
Last-chance backup for when m_SecondaryId is not found.
Used by Rose import: MDL files specify both a "quidu" (which corresponds to m_SecondaryId) and the human readable fully qualified target name of a reference. In case the quidu is not found, the human readable name is used which we store in m_SecondaryFallback.
Definition at line 189 of file umlobject.h.
|
protected |
xmi.id of the secondary object for intermediate use during loading.
The secondary ID is resolved to the m_pSecondary in the course of resolveRef() at the end of loading.
Definition at line 186 of file umlobject.h.
|
protected |
objects visibility
Definition at line 177 of file umlobject.h.
The documentation for this class was generated from the following files:
Documentation copyright © 1996-2020 The KDE developers.
Generated on Mon Jun 22 2020 13:40:29 by doxygen 1.8.7 written by Dimitri van Heesch, © 1997-2006
KDE's Doxygen guidelines are available online.