umbrello: UMLFolder Class Reference

umbrello 2.32.2 Umbrello UML Modeller is a Unified Modelling Language (UML) diagram program based on KDE Technology

Public Member Functions | Protected Member Functions | Private Attributes | Friends | List of all members
UMLFolder Class Reference

Non-graphical management of objects and diagrams of a Folder. More...

`#include <folder.h>`

Inheritance diagram for UMLFolder:

## Public Member Functions
| UMLFolder (const QString &name=QString(), Uml::ID::Type id=Uml::ID::None)
virtual | ~UMLFolder ()
virtual UMLObject * | clone () const
void | setLocalName (const QString &localName)
QString | localName () const
void | addView (UMLView *view)
void | removeView (UMLView *view)
void | appendViews (UMLViewList &viewList, bool includeNested=true)
void | activateViews ()
UMLView * | findView (Uml::ID::Type id)
UMLView * | findView (Uml::DiagramType::Enum type, const QString &name, bool searchAllScopes=true)
void | setViewOptions (const Settings::OptionState &optionState)
void | removeAllViews ()
void | setFolderFile (const QString &fileName)
QString | folderFile () const
bool | showPropertiesDialog (QWidget *parent)
void | saveToXMI1 (QXmlStreamWriter &writer)
Public Member Functions inherited from UMLPackage
| UMLPackage (const QString &name=QString(), Uml::ID::Type id=Uml::ID::None)
virtual | ~UMLPackage ()
virtual void | copyInto (UMLObject *lhs) const
virtual UMLObject * | clone () const
bool | addObject (UMLObject *pObject, bool interactOnConflict=true)
void | removeObject (UMLObject *pObject)
virtual void | removeAllObjects ()
UMLObjectList | containedObjects (bool includeInactive=false) const
void | addAssocToConcepts (UMLAssociation *assoc)
void | removeAssocFromConcepts (UMLAssociation *assoc)
UMLObject * | findObject (const QString &name) const
UMLObject * | findObjectById (Uml::ID::Type id) const
void | appendPackages (UMLPackageList &packages, bool includeNested=true) const
void | appendClassifiers (UMLClassifierList &classifiers, bool includeNested=true) const
void | appendClassesAndInterfaces (UMLClassifierList &classifiers, bool includeNested=true) const
void | appendEntities (UMLEntityList &entities, bool includeNested=true) const
virtual bool | resolveRef ()
virtual void | saveToXMI1 (QXmlStreamWriter &writer)
Public Member Functions inherited from UMLCanvasObject
| UMLCanvasObject (const QString &name=QString(), Uml::ID::Type id=Uml::ID::None)
virtual | ~UMLCanvasObject ()
bool | operator== (const UMLCanvasObject &rhs) const
virtual void | copyInto (UMLObject *lhs) const
bool | addAssociationEnd (UMLAssociation *assoc)
bool | hasAssociation (UMLAssociation *assoc) const
int | removeAssociationEnd (UMLAssociation *assoc)
void | removeAllAssociationEnds ()
int | associations () const
UMLAssociationList | getAssociations () const
UMLAssociationList | getSpecificAssocs (Uml::AssociationType::Enum assocType) const
UMLClassifierList | getSuperClasses (bool withRealizations=true) const
UMLClassifierList | getSubClasses () const
virtual UMLAssociationList | getRealizations () const
UMLAssociationList | getAggregations () const
UMLAssociationList | getCompositions () const
UMLAssociationList | getRelationships () const
virtual UMLObject * | findChildObject (const QString &n, UMLObject::ObjectType t=UMLObject::ot_UMLObject) const
virtual UMLObject * | findChildObjectById (Uml::ID::Type id, bool considerAncestors=false) const
virtual QString | uniqChildName (const UMLObject::ObjectType type, const QString &prefix=QString()) const
virtual void | removeAllChildObjects ()
UMLObjectList & | subordinates () const
virtual bool | resolveRef ()
Public Member Functions inherited from UMLObject
| UMLObject (const UMLObject &other)
| 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 ()
bool | operator== (const UMLObject &rhs) const
virtual void | copyInto (UMLObject *lhs) const
virtual UMLObject * | clone () const
virtual void | setBaseType (ObjectType ot)
ObjectType | baseType () const
QLatin1String | baseTypeStr () const
virtual void | setID (Uml::ID::Type NewID)
virtual Uml::ID::Type | id () const
QString | doc () const
bool | hasDoc () const
void | setDoc (const QString &d)
void | setVisibility (Uml::Visibility::Enum visibility)
void | setVisibilityCmd (Uml::Visibility::Enum visibility)
Uml::Visibility::Enum | visibility () const
void | setStereotype (const QString &_name)
void | setStereotypeCmd (const QString &_name)
QString | stereotype (bool includeAdornments=false) const
void | setUMLStereotype (UMLStereotype *stereo)
UMLStereotype * | umlStereotype () const
QStringList & | tags ()
QString | package (const QString &separator=QString(), bool includeRoot=false) const
UMLPackageList | packages (bool includeRoot=false) const
bool | setUMLPackage (UMLPackage *pPkg)
UMLPackage * | umlPackage () const
void | setUMLParent (UMLObject *parent)
UMLObject * | umlParent () const
virtual void | setName (const QString &strName)
virtual void | setNameCmd (const QString &strName)
QString | name () const
virtual QString | fullyQualifiedName (const QString &separator=QString(), bool includeRoot=false) const
void | setAbstract (bool bAbstract)
bool | isAbstract () const
virtual bool | showPropertiesDialog (QWidget *parent=0)
virtual bool | resolveRef ()
virtual void | saveToXMI1 (QXmlStreamWriter &writer)
virtual bool | loadFromXMI1 (QDomElement &element)
bool | loadStereotype (QDomElement &element)
void | setStatic (bool bStatic)
bool | isStatic () const
virtual bool | acceptAssociationType (Uml::AssociationType::Enum) const
void | setSecondaryId (const QString &id)
QString | secondaryId () const
void | setSecondaryFallback (const QString &id)
QString | secondaryFallback () const
void | save1 (const QString &tag, QXmlStreamWriter &writer)
bool | isUMLActor () const
bool | isUMLArtifact () const
bool | isUMLAssociation () const
bool | isUMLAttribute () const
bool | isUMLCategory () const
bool | isUMLCheckConstraint () const
bool | isUMLClassifier () const
bool | isUMLComponent () const
bool | isUMLDatatype () const
bool | isUMLEntity () const
bool | isUMLEntityAttribute () const
bool | isUMLEntityConstraint () const
bool | isUMLEnum () const
bool | isUMLEnumLiteral () const
bool | isUMLFolder () const
bool | isUMLForeignKeyConstraint () const
bool | isUMLInstance () const
bool | isUMLInstanceAttribute () const
bool | isUMLNode () const
bool | isUMLObject () const
bool | isUMLOperation () const
bool | isUMLPackage () const
bool | isUMLPort () const
bool | isUMLRole () const
bool | isUMLStereotype () const
bool | isUMLTemplate () const
bool | isUMLUniqueConstraint () const
bool | isUMLUseCase () const
UMLActor * | asUMLActor ()
UMLArtifact * | asUMLArtifact ()
UMLAssociation * | asUMLAssociation ()
UMLAttribute * | asUMLAttribute ()
UMLCanvasObject * | asUMLCanvasObject ()
UMLCategory * | asUMLCategory ()
UMLCheckConstraint * | asUMLCheckConstraint ()
UMLClassifier * | asUMLClassifier ()
UMLClassifierListItem * | asUMLClassifierListItem ()
UMLClassifierSet * | asUMLClassifierSet ()
UMLComponent * | asUMLComponent ()
UMLDatatype * | asUMLDatatype ()
UMLEntity * | asUMLEntity ()
UMLEntityAttribute * | asUMLEntityAttribute ()
UMLEntityConstraint * | asUMLEntityConstraint ()
UMLEnum * | asUMLEnum ()
UMLEnumLiteral * | asUMLEnumLiteral ()
UMLFolder * | asUMLFolder ()
UMLForeignKeyConstraint * | asUMLForeignKeyConstraint ()
UMLInstance * | asUMLInstance ()
UMLInstanceAttribute * | asUMLInstanceAttribute ()
UMLNode * | asUMLNode ()
UMLObject * | asUMLObject ()
UMLOperation * | asUMLOperation ()
UMLPackage * | asUMLPackage ()
UMLPort * | asUMLPort ()
UMLRole * | asUMLRole ()
UMLStereotype * | asUMLStereotype ()
UMLTemplate * | asUMLTemplate ()
UMLUniqueConstraint * | asUMLUniqueConstraint ()
UMLUseCase * | asUMLUseCase ()

## Protected Member Functions
void | saveContents1 (QXmlStreamWriter &writer)
void | save1 (QXmlStreamWriter &writer)
bool | loadDiagramsFromXMI1 (QDomNode &node)
bool | loadFolderFile (const QString &path)
bool | load1 (QDomElement &element)
virtual bool | load1 (QDomElement &element)
Protected Member Functions inherited from UMLObject
void | init ()
void | maybeSignalObjectCreated ()
void | save1end (QXmlStreamWriter &writer)
virtual bool | load1 (QDomElement &element)

## Private Attributes
QString | m_localName
| i18n name, only used for predefined root folders More...
QString | m_folderFile
UMLViewList | m_diagrams

## Friends
class | UMLDoc
QDebug | operator<< (QDebug out, const UMLFolder &item)

## Additional Inherited Members
Public Types inherited from UMLObject
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 inherited from UMLObject
void | emitModified ()
Signals inherited from UMLCanvasObject
void | sigAssociationEndAdded (UMLAssociation *assoc)
void | sigAssociationEndRemoved (UMLAssociation *assoc)
Signals inherited from UMLObject
void | modified ()
Static Public Member Functions inherited from UMLObject
static QString | toString (ObjectType ot)
static QString | toI18nString (ObjectType t)
static Icon_Utils::IconType | toIcon (ObjectType t)
Protected Attributes inherited from UMLPackage
UMLObjectList | m_objects
Protected Attributes inherited from UMLObject
Uml::ID::Type | m_nId
| object's id More...
QString | m_Doc
| object's documentation More...
QPointer< UMLStereotype > | m_pStereotype
| stereotype of the object if applicable More...
QString | m_name
| objects name More...
ObjectType | m_BaseType
| objects type More...
Uml::Visibility::Enum | m_visibility
| objects visibility More...
bool | m_bAbstract
| state of whether the object is abstract or not More...
bool | m_bStatic
| flag for instance scope More...
bool | m_bInPaste
| caller sets this true when in paste operation More...
bool | m_bCreationWasSignalled
| auxiliary to maybeSignalObjectCreated() More...
QPointer< UMLObject > | m_pSecondary
QString | m_SecondaryId
QString | m_SecondaryFallback
QStringList | m_TaggedValues
UMLObjectPrivate * | m_d
| private data More...

## Detailed Description

Non-graphical management of objects and diagrams of a Folder.

This class manages the UMLObjects and UMLViews of a Folder. This class inherits from UMLPackage which contains most of the information.

The UMLDoc class allocates a fixed instance of this class for each of the predefined Logical, UseCase, Component, Deployment, and Entity-Relationship folders. Further instances are created on demand for user folders.

Author
  Oliver Kellogg Bugs and comments to umbre.nosp@m.llo-.nosp@m.devel.nosp@m.@kde.nosp@m..org or https://bugs.kde.org

TODO: This whole class needs a relook regarding view/scene.

## Constructor & Destructor Documentation

## ◆ UMLFolder()

UMLFolder::UMLFolder | ( | const QString & | name = `QString()`,
|  | Uml::ID::Type | id = `Uml::ID::None`
| ) |  |
| explicit

Sets up a Folder.

Parameters

  name | The name of the Folder.
  id | The unique id of the Folder. A new ID will be generated if this argument is left away.

## ◆ ~UMLFolder()

UMLFolder::~UMLFolder | ( |  | ) |
| virtual

Empty destructor.

## Member Function Documentation

## ◆ activateViews()

void UMLFolder::activateViews | ( |  | ) |

Activate the views in this folder. "Activation": Some widgets require adjustments after loading from file, those are done here.

## ◆ addView()

void UMLFolder::addView | ( | UMLView * | view | ) |

Add a view to the diagram list.

## ◆ appendViews()

void UMLFolder::appendViews | ( | UMLViewList & | viewList,
|  | bool | includeNested = `true`
| ) |  |

Append the views in this folder to the given diagram list.

Parameters

  viewList | The UMLViewList to which to append the diagrams.
  includeNested | Whether to include diagrams from nested folders (default: true.)

## ◆ clone()

UMLObject * UMLFolder::clone | ( |  | ) | const
| virtual

Make a clone of this object.

Reimplemented from UMLPackage.

## ◆ findView() [1/2]

UMLView * UMLFolder::findView | ( | Uml::DiagramType::Enum | type,
|  | const QString & | name,
|  | bool | searchAllScopes = `true`
| ) |  |

Seek a view by the type and name given.

Parameters

  type | The type of view to find.
  name | The name of the view to find.
  searchAllScopes | Search in all subfolders (default: true.)

Returns
  Pointer to the view found, or NULL if not found.

## ◆ findView() [2/2]

UMLView * UMLFolder::findView | ( | Uml::ID::Type | id | ) |

Seek a view of the given ID in this folder.

Parameters

  id | ID of the view to find.

Returns
  Pointer to the view if found, NULL if no view found.

## ◆ folderFile()

QString UMLFolder::folderFile | ( |  | ) | const

Get the folder file name for a separate submodel.

## ◆ load1()

bool UMLFolder::load1 | ( | QDomElement & | element | ) |
| protectedvirtual

Loads the owned elements of the <UML:Model>.

Reimplemented from UMLPackage.

## ◆ loadDiagramsFromXMI1()

bool UMLFolder::loadDiagramsFromXMI1 | ( | QDomNode & | node | ) |
| protected

Auxiliary to load(): Load the diagrams from the "diagrams" in the <XMI.extension>

## ◆ loadFolderFile()

bool UMLFolder::loadFolderFile | ( | const QString & | path | ) |
| protected

Folders in the listview can be marked such that their contents are saved to a separate file. This method loads the separate folder file. CAVEAT: This is not XMI standard compliant. If standard compliance is an issue then avoid folder files.

Parameters

  path | Fully qualified file name, i.e. absolute directory plus file name.

Returns
  True for success.

## ◆ localName()

QString UMLFolder::localName | ( |  | ) | const

Return the localized name of this folder. Only useful for the predefined root folders.

## ◆ removeAllViews()

void UMLFolder::removeAllViews | ( |  | ) |

Remove all views in this folder.

## ◆ removeView()

void UMLFolder::removeView | ( | UMLView * | view | ) |

Remove a view from the diagram list.

## ◆ save1()

void UMLFolder::save1 | ( | QXmlStreamWriter & | writer | ) |
| protected

Auxiliary to saveToXMI1(): Creates a <UML:Model> element when saving a predefined modelview, or a <UML:Package> element when saving a user created folder. Invokes saveContents() with the newly created element.

## ◆ saveContents1()

void UMLFolder::saveContents1 | ( | QXmlStreamWriter & | writer | ) |
| protected

Auxiliary to saveToXMI1(): Save the contained objects and diagrams. Can be used regardless of whether saving to the main model file or to an external folder file (see m_folderFile.)

## ◆ saveToXMI1()

void UMLFolder::saveToXMI1 | ( | QXmlStreamWriter & | writer | ) |
| virtual

Creates a UML:Model or UML:Package element: UML:Model is created for the predefined fixed folders, UML:Package with stereotype "folder" is created for all else.

Reimplemented from UMLPackage.

## ◆ setFolderFile()

void UMLFolder::setFolderFile | ( | const QString & | fileName | ) |

Set the folder file name for a separate submodel.

## ◆ setLocalName()

void UMLFolder::setLocalName | ( | const QString & | localName | ) |

Set the localized name of this folder. This is set for the predefined root views (Logical, UseCase, Component, Deployment, EntityRelationship, and the Datatypes folder inside the Logical View.)

## ◆ setViewOptions()

void UMLFolder::setViewOptions | ( | const Settings::OptionState & | optionState | ) |

Set the options for the views in this folder.

## ◆ showPropertiesDialog()

bool UMLFolder::showPropertiesDialog | ( | QWidget * | parent | ) |
| virtual

Display the properties configuration dialog for the object.

Parameters

  parent | The parent widget.

Returns
  True for success of this operation.

Reimplemented from UMLObject.

## Friends And Related Function Documentation

## ◆ operator<<

QDebug operator<< | ( | QDebug | out,
|  | const UMLFolder & | item
| ) |  |
| friend

Overloading operator for debugging output.

## ◆ UMLDoc

friend class UMLDoc
| friend

## Member Data Documentation

## ◆ m_diagrams

UMLViewList UMLFolder::m_diagrams
| private

## ◆ m_folderFile

QString UMLFolder::m_folderFile
| private

If m_folderFile is not empty then it contains a file name to which this folder is saved. In this case the folder file acts as a physically separate submodel. What is saved in the main model is not the folder contents but a reference to the folder file.

## ◆ m_localName

QString UMLFolder::m_localName
| private

i18n name, only used for predefined root folders

The documentation for this class was generated from the following files:

- umbrello/uml1model/folder.h
- umbrello/uml1model/folder.cpp