umbrello 2.38.4
Umbrello UML Modeller is a Unified Modelling Language (UML) diagram program based on KDE Technology
|
The base class for UML objects. More...
#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_Instance , 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 , ot_InstanceAttribute , ot_SubSystem } |
Public Slots | |
void | emitModified () |
Signals | |
void | modified () |
Static Public Member Functions | |
static QString | toString (ObjectType ot) |
static QString | toI18nString (ObjectType t) |
static Icon_Utils::IconType | toIcon (ObjectType t) |
Protected Member Functions | |
void | init () |
void | maybeSignalObjectCreated () |
void | save1end (QXmlStreamWriter &writer) |
virtual bool | load1 (QDomElement &element) |
Protected Attributes | |
Uml::ID::Type | m_nId |
object's id | |
QString | m_Doc |
object's documentation | |
QPointer< UMLStereotype > | m_pStereotype |
stereotype of the object if applicable | |
QString | m_name |
objects name | |
ObjectType | m_BaseType |
objects type | |
Uml::Visibility::Enum | m_visibility |
objects visibility | |
bool | m_bAbstract |
state of whether the object is abstract or not | |
bool | m_bStatic |
flag for instance scope | |
bool | m_bCreationWasSignalled |
auxiliary to maybeSignalObjectCreated() | |
QPointer< UMLObject > | m_pSecondary |
QString | m_SecondaryId |
QString | m_SecondaryFallback |
QStringList | m_TaggedValues |
UMLObjectPrivate * | m_d |
private data | |
Friends | |
class | ObjectsModel |
QDebug | operator<< (QDebug out, const UMLObject &obj) |
The base class for UML objects.
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 XMI element and saving the common XMI parts, it can use the save1() method.
|
explicit |
Creates a UMLObject.
other | object to created from |
|
explicit |
Creates a UMLObject.
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. |
|
explicit |
Creates a UMLObject.
parent | The parent of the object. |
|
explicit |
Creates a UMLObject.
name | The name of the object. |
id | The ID of the object (optional.) If omitted then a new ID will be assigned internally. |
|
virtual |
Standard destructor.
|
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.
UMLActor * UMLObject::asUMLActor | ( | ) |
const UMLActor * UMLObject::asUMLActor | ( | ) | const |
UMLArtifact * UMLObject::asUMLArtifact | ( | ) |
const UMLArtifact * UMLObject::asUMLArtifact | ( | ) | const |
UMLAssociation * UMLObject::asUMLAssociation | ( | ) |
const UMLAssociation * UMLObject::asUMLAssociation | ( | ) | const |
UMLAttribute * UMLObject::asUMLAttribute | ( | ) |
const UMLAttribute * UMLObject::asUMLAttribute | ( | ) | const |
UMLCanvasObject * UMLObject::asUMLCanvasObject | ( | ) |
const UMLCanvasObject * UMLObject::asUMLCanvasObject | ( | ) | const |
UMLCategory * UMLObject::asUMLCategory | ( | ) |
const UMLCategory * UMLObject::asUMLCategory | ( | ) | const |
UMLCheckConstraint * UMLObject::asUMLCheckConstraint | ( | ) |
const UMLCheckConstraint * UMLObject::asUMLCheckConstraint | ( | ) | const |
UMLClassifier * UMLObject::asUMLClassifier | ( | ) |
const UMLClassifier * UMLObject::asUMLClassifier | ( | ) | const |
UMLClassifierListItem * UMLObject::asUMLClassifierListItem | ( | ) |
const UMLClassifierListItem * UMLObject::asUMLClassifierListItem | ( | ) | const |
UMLClassifierSet * UMLObject::asUMLClassifierSet | ( | ) |
const UMLClassifierSet * UMLObject::asUMLClassifierSet | ( | ) | const |
UMLComponent * UMLObject::asUMLComponent | ( | ) |
const UMLComponent * UMLObject::asUMLComponent | ( | ) | const |
UMLDatatype * UMLObject::asUMLDatatype | ( | ) |
const UMLDatatype * UMLObject::asUMLDatatype | ( | ) | const |
UMLEntity * UMLObject::asUMLEntity | ( | ) |
const UMLEntity * UMLObject::asUMLEntity | ( | ) | const |
UMLEntityAttribute * UMLObject::asUMLEntityAttribute | ( | ) |
const UMLEntityAttribute * UMLObject::asUMLEntityAttribute | ( | ) | const |
UMLEntityConstraint * UMLObject::asUMLEntityConstraint | ( | ) |
const UMLEntityConstraint * UMLObject::asUMLEntityConstraint | ( | ) | const |
UMLEnum * UMLObject::asUMLEnum | ( | ) |
const UMLEnum * UMLObject::asUMLEnum | ( | ) | const |
UMLEnumLiteral * UMLObject::asUMLEnumLiteral | ( | ) |
const UMLEnumLiteral * UMLObject::asUMLEnumLiteral | ( | ) | const |
UMLFolder * UMLObject::asUMLFolder | ( | ) |
const UMLFolder * UMLObject::asUMLFolder | ( | ) | const |
UMLForeignKeyConstraint * UMLObject::asUMLForeignKeyConstraint | ( | ) |
const UMLForeignKeyConstraint * UMLObject::asUMLForeignKeyConstraint | ( | ) | const |
UMLInstance * UMLObject::asUMLInstance | ( | ) |
const UMLInstance * UMLObject::asUMLInstance | ( | ) | const |
UMLInstanceAttribute * UMLObject::asUMLInstanceAttribute | ( | ) |
const UMLInstanceAttribute * UMLObject::asUMLInstanceAttribute | ( | ) | const |
UMLNode * UMLObject::asUMLNode | ( | ) |
const UMLNode * UMLObject::asUMLNode | ( | ) | const |
UMLObject * UMLObject::asUMLObject | ( | ) |
const UMLObject * UMLObject::asUMLObject | ( | ) | const |
UMLOperation * UMLObject::asUMLOperation | ( | ) |
const UMLOperation * UMLObject::asUMLOperation | ( | ) | const |
UMLPackage * UMLObject::asUMLPackage | ( | ) |
const UMLPackage * UMLObject::asUMLPackage | ( | ) | const |
UMLPort * UMLObject::asUMLPort | ( | ) |
const UMLPort * UMLObject::asUMLPort | ( | ) | const |
UMLRole * UMLObject::asUMLRole | ( | ) |
const UMLRole * UMLObject::asUMLRole | ( | ) | const |
UMLStereotype * UMLObject::asUMLStereotype | ( | ) |
const UMLStereotype * UMLObject::asUMLStereotype | ( | ) | const |
UMLTemplate * UMLObject::asUMLTemplate | ( | ) |
const UMLTemplate * UMLObject::asUMLTemplate | ( | ) | const |
UMLUniqueConstraint * UMLObject::asUMLUniqueConstraint | ( | ) |
const UMLUniqueConstraint * UMLObject::asUMLUniqueConstraint | ( | ) | const |
UMLUseCase * UMLObject::asUMLUseCase | ( | ) |
const UMLUseCase * UMLObject::asUMLUseCase | ( | ) | const |
UMLObject::ObjectType UMLObject::baseType | ( | ) | const |
Returns the type of the object.
QLatin1String UMLObject::baseTypeStr | ( | ) | const |
|
virtual |
Reimplemented in UMLActor, UMLArtifact, UMLAssociation, UMLAttribute, UMLCategory, UMLCheckConstraint, UMLClassifier, UMLComponent, UMLEntity, UMLEntityAttribute, UMLEnum, UMLEnumLiteral, UMLFolder, UMLForeignKeyConstraint, UMLNode, UMLOperation, UMLPackage, UMLPort, UMLStereotype, UMLTemplate, UMLRole, UMLUniqueConstraint, UMLUseCase, UMLClassifierListItem, and UMLEntityConstraint.
|
virtual |
Copy the internal presentation of this object into the new object.
Reimplemented in UMLAttribute, UMLCategory, UMLCheckConstraint, UMLClassifier, UMLClassifierListItem, UMLEntity, UMLEntityAttribute, UMLEntityConstraint, UMLEnum, UMLEnumLiteral, UMLForeignKeyConstraint, UMLOperation, UMLPackage, UMLStereotype, UMLTemplate, UMLCanvasObject, and UMLUniqueConstraint.
QString UMLObject::doc | ( | ) | const |
Returns the documentation for the object.
|
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.
|
virtual |
Returns the fully qualified name, i.e. all package prefixes and then m_name.
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. |
bool UMLObject::hasDoc | ( | ) | const |
Returns state of documentation for the object.
|
virtual |
Returns the ID of the object.
|
protected |
Initializes key variables of the class.
bool UMLObject::isAbstract | ( | ) | const |
Returns the abstract state of the object.
bool UMLObject::isStatic | ( | ) | const |
Returns true if this UMLObject has classifier scope, otherwise false (the default).
|
inline |
|
inline |
|
inline |
|
inline |
|
inline |
|
inline |
|
inline |
|
inline |
|
inline |
|
inline |
|
inline |
|
inline |
|
inline |
|
inline |
|
inline |
|
inline |
|
inline |
|
inline |
|
inline |
|
inline |
|
inline |
|
inline |
|
inline |
|
inline |
|
inline |
|
inline |
|
inline |
|
inline |
|
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 UMLActor, UMLArtifact, UMLAssociation, UMLAttribute, UMLCategory, UMLCheckConstraint, UMLClassifier, UMLComponent, UMLDatatype, UMLEntity, UMLEntityAttribute, UMLEnum, UMLEnumLiteral, UMLFolder, UMLForeignKeyConstraint, UMLInstance, UMLInstanceAttribute, UMLNode, UMLOperation, UMLPackage, UMLPort, UMLStereotype, UMLTemplate, UMLRole, UMLUniqueConstraint, and UMLUseCase.
|
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.
element | The QDomElement from which to load. |
bool UMLObject::loadStereotype | ( | QDomElement & | element | ) |
Analyzes the given QDomElement for a reference to a stereotype.
element | QDomElement to analyze. |
|
protected |
Calls UMLDoc::signalUMLObjectCreated() if m_BaseType affords doing so.
|
signal |
QString UMLObject::name | ( | ) | const |
Returns a copy of m_name
bool UMLObject::operator== | ( | const UMLObject & | rhs | ) | const |
Overloaded '==' operator
QString UMLObject::package | ( | const QString & | separator = QString() , |
bool | includeRoot = false |
||
) | const |
Return the package(s) in which this UMLObject is contained as a text.
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. |
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.
includeRoot | Whether to prefix the root folder name. Default: false. |
|
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.
Reimplemented in UMLAssociation, UMLClassifier, UMLEntity, UMLForeignKeyConstraint, UMLInstance, UMLOperation, UMLPackage, and UMLCanvasObject.
void UMLObject::save1 | ( | QXmlStreamWriter & | writer, |
const QString & | type, | ||
const QString & | tag = QString() |
||
) |
Auxiliary to saveToXMI. Create an XML element 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. It is public because UMLOperation::saveToXMI invokes it for its <Parameter>s (cannot be done with protected access).
writer | The QXmlStreamWriter into which to write. |
type | In UML1 mode, it is used as the XML tag. In UML2 mode, it is used as the xmi:type attribute. |
tag | In UML2 mode, it is used as the XML tag. When given the special value "<use_type_as_tag>", the type is used as the XML tag just as in UML1 mode. In this case, no xmi:type attribute is generated. |
|
protected |
Auxiliary to saveToXMI. Save possible stereotype tagged values stored in m_TaggedValues and write the XML end element created in save1().
|
virtual |
Reimplemented in UMLActor, UMLArtifact, UMLAssociation, UMLAttribute, UMLCategory, UMLCheckConstraint, UMLClassifier, UMLComponent, UMLDatatype, UMLEntity, UMLEntityAttribute, UMLEnum, UMLEnumLiteral, UMLFolder, UMLForeignKeyConstraint, UMLInstance, UMLInstanceAttribute, UMLNode, UMLOperation, UMLPackage, UMLPort, UMLStereotype, UMLTemplate, UMLRole, UMLUniqueConstraint, and UMLUseCase.
QString UMLObject::secondaryFallback | ( | ) | const |
Return secondary ID fallback. Required by resolveRef() for imported model files.
QString UMLObject::secondaryId | ( | ) | const |
Return secondary ID. Required by resolveRef().
void UMLObject::setAbstract | ( | bool | bAbstract | ) |
Sets the paste state of the object.
|
virtual |
void UMLObject::setDoc | ( | const QString & | d | ) |
Sets the documentation for the object.
d | The documentation for the object. |
|
virtual |
Assigns a new Id to the object
|
virtual |
|
virtual |
Method used by setName: it is called by cmdSetName, Don't use it!
Reimplemented in UMLClassifier.
void UMLObject::setSecondaryFallback | ( | const QString & | id | ) |
Set the secondary ID fallback. Currently only used by petalTree2Uml().
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.
void UMLObject::setStatic | ( | bool | bStatic | ) |
Sets the value for m_bStatic.
void UMLObject::setStereotype | ( | const QString & | name | ) |
Sets the classes stereotype name. Internally uses setUMLStereotype().
name | Sets the classes stereotype name. |
void UMLObject::setStereotypeCmd | ( | const QString & | _name | ) |
bool UMLObject::setUMLPackage | ( | UMLPackage * | pPkg | ) |
Sets the UMLPackage in which this class is located.
pPkg | Pointer to the class' UMLPackage. |
void UMLObject::setUMLParent | ( | UMLObject * | parent | ) |
Set UML model parent.
parent | object to set as parent |
TODO prevent setting parent to myself
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.
stereo | Sets the classes UMLStereotype. |
void UMLObject::setVisibility | ( | Uml::Visibility::Enum | visibility | ) |
Sets the visibility of the object.
visibility | The visibility of the object. |
void UMLObject::setVisibilityCmd | ( | Uml::Visibility::Enum | visibility | ) |
Method used by setVisibility: it is called by cmdSetVisibility, Don't use it!
|
virtual |
Display the properties configuration dialog for the object.
parent | The parent widget. |
Reimplemented in UMLFolder, UMLInstance, UMLStereotype, UMLTemplate, UMLAssociation, UMLAttribute, UMLCheckConstraint, UMLEntityAttribute, UMLEnumLiteral, UMLForeignKeyConstraint, UMLInstanceAttribute, UMLOperation, UMLRole, and UMLUniqueConstraint.
QString UMLObject::stereotype | ( | bool | includeAdornments = false | ) | const |
Returns the stereotype.
QStringList & UMLObject::tags | ( | ) |
Returns the concrete values of stereotype attributes.
|
static |
Returns the given object type value as localized string.
t | ObjectType of which a string representation is wanted |
|
static |
Returns the given object type value as icon type.
t | ObjectType of which an icon type is wanted |
|
static |
Helper function for debug output. Returns the given enum value as string.
ot | ObjectType of which a string representation is wanted |
UMLPackage * UMLObject::umlPackage | ( | ) | const |
Returns the UMLPackage that this class is located in.
This method is a shortcut for calling umlParent()->asUMLPackage().
UMLObject * UMLObject::umlParent | ( | ) | const |
Return UML model parent.
Model classes of type UMLClassifierListItem and below uses QObject::parent to hold the model parent
UMLStereotype * UMLObject::umlStereotype | ( | ) | const |
Returns the classes UMLStereotype object.
Visibility::Enum UMLObject::visibility | ( | ) | const |
Returns the visibility of the object.
|
friend |
|
friend |
Print UML Object to debug output stream, so it can be used like uDebug() << "This object shouldn't be here: " << illegalObject;
|
protected |
state of whether the object is abstract or not
|
protected |
objects type
|
protected |
auxiliary to maybeSignalObjectCreated()
|
protected |
flag for instance scope
|
protected |
private data
|
protected |
object's documentation
|
protected |
objects name
|
protected |
object's id
|
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.
|
protected |
stereotype of the object if applicable
|
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.
|
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.
|
protected |
Concrete values of UMLStereotype::AttributeDefs if a stereotype is applied and has attributes. The order of elements is the same as in UMLStereotype::AttributeDefs. At most N_STEREOATTRS are used (see dialogs/n_stereoattrs.h)
|
protected |
objects visibility