umbrello/umbrello
UMLObject Class Reference
This class is the non-graphical version of UMLWidget. More...
#include <umlobject.h>

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.
Constructor & Destructor Documentation
| UMLObject::UMLObject | ( | UMLObject * | parent, | |
| const QString & | name, | |||
| Uml::IDType | id = Uml::id_None | |||
| ) | [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 46 of file umlobject.cpp.
| UMLObject::UMLObject | ( | UMLObject * | parent | ) | [explicit] |
Creates a UMLObject.
- Parameters:
-
parent The parent of the object.
Definition at line 79 of file umlobject.cpp.
| UMLObject::UMLObject | ( | const QString & | name = QString(), |
|
| Uml::IDType | id = Uml::id_None | |||
| ) | [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.
| UMLObject::~UMLObject | ( | ) | [virtual] |
Standard destructor.
Definition at line 88 of file umlobject.cpp.
Member Function Documentation
| bool UMLObject::acceptAssociationType | ( | Uml::Association_Type | ) | [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 149 of file umlobject.cpp.
| virtual UMLObject* UMLObject::clone | ( | ) | const [pure virtual] |
Implemented in UMLActor, UMLArtifact, UMLAssociation, UMLAttribute, UMLCategory, UMLCheckConstraint, UMLClassifier, UMLClassifierListItem, UMLComponent, UMLEntity, UMLEntityAttribute, UMLEntityConstraint, UMLEnum, UMLEnumLiteral, UMLFolder, UMLForeignKeyConstraint, UMLNode, UMLOperation, UMLPackage, UMLStereotype, UMLTemplate, UMLRole, UMLUniqueConstraint, and UMLUseCase.
| void UMLObject::copyInto | ( | UMLObject * | lhs | ) | const [virtual] |
Copy the internal presentation of this object into the new object.
Definition at line 286 of file umlobject.cpp.
| void UMLObject::emitModified | ( | ) | [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 353 of file umlobject.cpp.
| bool UMLObject::getAbstract | ( | ) | const |
Returns the abstract state of the object.
Definition at line 311 of file umlobject.cpp.
| Uml::Object_Type UMLObject::getBaseType | ( | ) | const |
Returns the type of the object.
- Returns:
- Returns the type of the object.
Definition at line 376 of file umlobject.cpp.
| QString UMLObject::getDoc | ( | ) | const |
Returns the documentation for the object.
- Returns:
- Returns the documentation for the object.
Definition at line 406 of file umlobject.cpp.
| QString UMLObject::getFullyQualifiedName | ( | const QString & | separator = QString(), |
|
| bool | includeRoot = false | |||
| ) | const [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.
Reimplemented in UMLAttribute, UMLCheckConstraint, and UMLUniqueConstraint.
Definition at line 200 of file umlobject.cpp.
| Uml::IDType UMLObject::getID | ( | ) | const [virtual] |
Returns the ID of the object.
- Returns:
- Returns the ID of the object.
Definition at line 396 of file umlobject.cpp.
| QString UMLObject::getName | ( | ) | const |
Returns a copy of m_Name.
Definition at line 184 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 567 of file umlobject.cpp.
| UMLPackageList UMLObject::getPackages | ( | 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 587 of file umlobject.cpp.
| QString UMLObject::getSecondaryFallback | ( | ) | const |
Return secondary ID fallback.
Required by resolveRef() for imported model files.
Definition at line 632 of file umlobject.cpp.
| QString UMLObject::getSecondaryId | ( | ) | const |
| bool UMLObject::getStatic | ( | ) | const |
Returns true if this UMLObject has classifier scope, otherwise false (the default).
Definition at line 334 of file umlobject.cpp.
| QString UMLObject::getStereotype | ( | bool | includeAdornments = false |
) | const |
Returns the stereotype.
Definition at line 545 of file umlobject.cpp.
| UMLPackage * UMLObject::getUMLPackage | ( | ) |
Returns the UMLPackage that this class is located in.
- Returns:
- Pointer to the UMLPackage of this class.
Definition at line 605 of file umlobject.cpp.
| const UMLStereotype * UMLObject::getUMLStereotype | ( | ) |
Returns the classes UMLStereotype object.
- Returns:
- Returns the classes UMLStereotype object.
Definition at line 537 of file umlobject.cpp.
| Uml::Visibility UMLObject::getVisibility | ( | ) | const |
Returns the visibility of the object.
- Returns:
- Returns the visibility of the object.
Definition at line 416 of file umlobject.cpp.
| void UMLObject::init | ( | ) | [protected] |
Initializes key variables of the class.
Reimplemented in UMLActor, UMLCategory, UMLEntityAttribute, UMLFolder, UMLNode, and UMLUseCase.
Definition at line 95 of file umlobject.cpp.
| bool UMLObject::load | ( | QDomElement & | element | ) | [protected, virtual] |
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 UMLActor, UMLArtifact, UMLAssociation, UMLAttribute, UMLCategory, UMLCheckConstraint, UMLClassifier, UMLComponent, UMLEntity, UMLEntityAttribute, UMLEnum, UMLEnumLiteral, UMLFolder, UMLForeignKeyConstraint, UMLNode, UMLOperation, UMLPackage, UMLTemplate, UMLRole, UMLUniqueConstraint, and UMLUseCase.
Definition at line 826 of file umlobject.cpp.
| bool UMLObject::loadFromXMI | ( | QDomElement & | element | ) | [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 878 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 839 of file umlobject.cpp.
| void UMLObject::maybeSignalObjectCreated | ( | ) | [protected] |
Calls UMLDoc::signalUMLObjectCreated() if m_BaseType affords doing so.
Definition at line 650 of file umlobject.cpp.
| void UMLObject::modified | ( | ) | [signal] |
| bool UMLObject::operator== | ( | const UMLObject & | rhs | ) |
Overloaded '==' operator.
Reimplemented in UMLAssociation, UMLAttribute, UMLCheckConstraint, UMLClassifier, UMLEntity, UMLEntityAttribute, UMLEntityConstraint, UMLEnum, UMLEnumLiteral, UMLForeignKeyConstraint, UMLOperation, UMLStereotype, UMLTemplate, UMLCanvasObject, UMLRole, and UMLUniqueConstraint.
Definition at line 227 of file umlobject.cpp.
| bool UMLObject::resolveRef | ( | ) | [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 UMLAssociation, UMLClassifier, UMLEntity, UMLForeignKeyConstraint, UMLOperation, UMLPackage, and UMLCanvasObject.
Definition at line 673 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 772 of file umlobject.cpp.
| virtual void UMLObject::saveToXMI | ( | QDomDocument & | qDoc, | |
| QDomElement & | qElement | |||
| ) | [pure virtual] |
Implemented in UMLActor, UMLArtifact, UMLAssociation, UMLAttribute, UMLCategory, UMLCheckConstraint, UMLClassifier, UMLComponent, UMLEntity, UMLEntityAttribute, UMLEnum, UMLEnumLiteral, UMLFolder, UMLForeignKeyConstraint, UMLNode, UMLOperation, UMLPackage, UMLStereotype, UMLTemplate, UMLRole, UMLUniqueConstraint, and UMLUseCase.
| void UMLObject::setAbstract | ( | bool | bAbstract | ) |
Sets the paste state of the object.
Definition at line 319 of file umlobject.cpp.
| void UMLObject::setBaseType | ( | Uml::Object_Type | ot | ) | [virtual] |
Set the type of the object.
- Parameters:
-
ot The Uml::Object_Type to set.
Reimplemented in UMLClassifier.
Definition at line 386 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 365 of file umlobject.cpp.
| void UMLObject::setID | ( | Uml::IDType | NewID | ) | [virtual] |
Assigns a new Id to the object.
Definition at line 158 of file umlobject.cpp.
| void UMLObject::setInPaste | ( | bool | bInPaste = true |
) |
Definition at line 325 of file umlobject.cpp.
| void UMLObject::setName | ( | const QString & | strName | ) | [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 175 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 499 of file umlobject.cpp.
| void UMLObject::setSecondaryFallback | ( | const QString & | id | ) |
Set the secondary ID fallback.
Currently only used by petalTree2Uml().
Definition at line 641 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 623 of file umlobject.cpp.
| void UMLObject::setStatic | ( | bool | bStatic | ) |
Sets the value for m_bStatic.
Definition at line 342 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 475 of file umlobject.cpp.
| void UMLObject::setStereotypecmd | ( | const QString & | _name | ) |
Definition at line 488 of file umlobject.cpp.
| void UMLObject::setUMLPackage | ( | UMLPackage * | pPkg | ) |
Sets the UMLPackage in which this class is located.
- Parameters:
-
pPkg Pointer to the class' UMLPackage.
Definition at line 526 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 449 of file umlobject.cpp.
| void UMLObject::setVisibility | ( | Uml::Visibility | s | ) |
Sets the visibility of the object.
- Parameters:
-
s The visibility of the object.
Reimplemented in UMLAttribute.
Definition at line 426 of file umlobject.cpp.
| void UMLObject::setVisibilitycmd | ( | Uml::Visibility | s | ) |
Method used by setVisibility: it is called by cmdSetVisibility, Don't use it!
Definition at line 434 of file umlobject.cpp.
| bool UMLObject::showProperties | ( | int | page = 0, |
|
| bool | assoc = false | |||
| ) | [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 120 of file umlobject.cpp.
Member Data Documentation
bool UMLObject::m_bAbstract [protected] |
The state of whether the object is abstract or not.
Definition at line 143 of file umlobject.h.
Uml::Object_Type UMLObject::m_BaseType [protected] |
The objects type.
Definition at line 141 of file umlobject.h.
bool UMLObject::m_bCreationWasSignalled [protected] |
Auxiliary to maybeSignalObjectCreated().
Definition at line 146 of file umlobject.h.
bool UMLObject::m_bInPaste [protected] |
Caller sets this true when in paste operation.
Definition at line 145 of file umlobject.h.
bool UMLObject::m_bStatic [protected] |
Flag for instance scope.
Definition at line 144 of file umlobject.h.
QString UMLObject::m_Doc [protected] |
The object's documentation.
Definition at line 137 of file umlobject.h.
QString UMLObject::m_Name [protected] |
Uml::IDType UMLObject::m_nId [protected] |
The object's id.
Definition at line 136 of file umlobject.h.
UMLObject* UMLObject::m_pSecondary [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 154 of file umlobject.h.
UMLStereotype* UMLObject::m_pStereotype [protected] |
The stereotype of the object if applicable.
Definition at line 139 of file umlobject.h.
UMLPackage* UMLObject::m_pUMLPackage [protected] |
The package the object belongs to if applicable.
Definition at line 138 of file umlobject.h.
QString UMLObject::m_SecondaryFallback [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 171 of file umlobject.h.
QString UMLObject::m_SecondaryId [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 161 of file umlobject.h.
Uml::Visibility UMLObject::m_Vis [protected] |
The objects visibility.
Definition at line 142 of file umlobject.h.
The documentation for this class was generated from the following files:
KDE 4.4 API Reference