umbrello/umbrello
#include <umlobject.h>
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) |
void | setInPaste (bool bInPaste=true) |
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 |
Static Public Member Functions | |
static QString | toString (ObjectType ot) |
Protected Member Functions | |
void | init () |
virtual bool | load (QDomElement &element) |
void | maybeSignalObjectCreated () |
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) |
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 149 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 366 of file umlobject.cpp.
QLatin1String UMLObject::baseTypeStr | ( | ) | const |
- Returns
- The type used for rtti as string.
Definition at line 374 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, 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 287 of file umlobject.cpp.
QString UMLObject::doc | ( | ) | const |
Returns the documentation for the object.
- Returns
- Returns the documentation for the object.
Definition at line 404 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 354 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 201 of file umlobject.cpp.
bool UMLObject::hasDoc | ( | ) | const |
Returns state of documentation for the object.
- Returns
- false if documentation is empty
Definition at line 414 of file umlobject.cpp.
|
virtual |
Returns the ID of the object.
- Returns
- Returns the ID of the object.
Definition at line 394 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 312 of file umlobject.cpp.
bool UMLObject::isStatic | ( | ) | const |
Returns true if this UMLObject has classifier scope, otherwise false (the default).
Definition at line 335 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, UMLActor, and UMLUseCase.
Definition at line 862 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 914 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 875 of file umlobject.cpp.
|
protected |
Calls UMLDoc::signalUMLObjectCreated() if m_BaseType affords doing so.
Definition at line 686 of file umlobject.cpp.
|
signal |
QString UMLObject::name | ( | ) | const |
Returns a copy of m_name.
Definition at line 185 of file umlobject.cpp.
bool UMLObject::operator== | ( | const UMLObject & | rhs | ) | const |
Overloaded '==' operator.
Definition at line 228 of file umlobject.cpp.
QString UMLObject::package | ( | const QString & | separator = QString() , |
bool | includeRoot = false |
||
) |
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 603 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 623 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 709 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 808 of file umlobject.cpp.
|
pure virtual |
Implemented in UMLClassifier, UMLAssociation, UMLEntity, UMLOperation, UMLPackage, UMLEntityAttribute, UMLForeignKeyConstraint, UMLFolder, UMLStereotype, UMLAttribute, UMLEnum, UMLTemplate, UMLRole, UMLUniqueConstraint, UMLArtifact, UMLCategory, UMLCheckConstraint, UMLEnumLiteral, UMLActor, UMLNode, UMLComponent, and UMLUseCase.
QString UMLObject::secondaryFallback | ( | ) | const |
Return secondary ID fallback.
Required by resolveRef() for imported model files.
Definition at line 668 of file umlobject.cpp.
QString UMLObject::secondaryId | ( | ) | const |
void UMLObject::setAbstract | ( | bool | bAbstract | ) |
Sets the paste state of the object.
Definition at line 320 of file umlobject.cpp.
|
virtual |
Set the type of the object.
- Parameters
-
ot The ObjectType to set.
Reimplemented in UMLClassifier.
Definition at line 384 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 424 of file umlobject.cpp.
|
virtual |
Assigns a new Id to the object.
Definition at line 159 of file umlobject.cpp.
void UMLObject::setInPaste | ( | bool | bInPaste = true | ) |
Definition at line 326 of file umlobject.cpp.
|
virtual |
Set the UMLObject's name.
Reimplemented in UMLAttribute.
Definition at line 168 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 176 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 518 of file umlobject.cpp.
void UMLObject::setSecondaryFallback | ( | const QString & | id | ) |
Set the secondary ID fallback.
Currently only used by petalTree2Uml().
Definition at line 677 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 659 of file umlobject.cpp.
void UMLObject::setStatic | ( | bool | bStatic | ) |
Sets the value for m_bStatic.
Definition at line 343 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 494 of file umlobject.cpp.
void UMLObject::setStereotypeCmd | ( | const QString & | _name | ) |
Definition at line 507 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 545 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 468 of file umlobject.cpp.
void UMLObject::setVisibility | ( | Uml::Visibility::Enum | visibility | ) |
Sets the visibility of the object.
- Parameters
-
s The visibility of the object.
Definition at line 445 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 453 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 120 of file umlobject.cpp.
QString UMLObject::stereotype | ( | bool | includeAdornments = false | ) | const |
Returns the stereotype.
Definition at line 581 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 1094 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 641 of file umlobject.cpp.
const UMLStereotype * UMLObject::umlStereotype | ( | ) |
Returns the classes UMLStereotype object.
- Returns
- Returns the classes UMLStereotype object.
Definition at line 573 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 435 of file umlobject.cpp.
Friends And Related Function Documentation
|
friend |
Print UML Object to debug output stream, so it can be used like uDebug() << "This object shouldn't be here: " << illegalObject;.
Definition at line 1103 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-2014 The KDE developers.
Generated on Tue Oct 14 2014 23:06:02 by doxygen 1.8.7 written by Dimitri van Heesch, © 1997-2006
KDE's Doxygen guidelines are available online.