umbrello  2.32.0
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:
UMLPackage UMLCanvasObject UMLObject

Public Member Functions

 UMLFolder (const QString &name=QString(), Uml::ID::Type id=Uml::ID::None)
 
virtual ~UMLFolder ()
 
virtual UMLObjectclone () 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 ()
 
UMLViewfindView (Uml::ID::Type id)
 
UMLViewfindView (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
 
bool addObject (UMLObject *pObject, bool interactOnConflict=true)
 
void removeObject (UMLObject *pObject)
 
virtual void removeAllObjects ()
 
UMLObjectList containedObjects (bool includeInactive=false)
 
void addAssocToConcepts (UMLAssociation *assoc)
 
void removeAssocFromConcepts (UMLAssociation *assoc)
 
UMLObjectfindObject (const QString &name)
 
UMLObjectfindObjectById (Uml::ID::Type id)
 
void appendPackages (UMLPackageList &packages, bool includeNested=true)
 
void appendClassifiers (UMLClassifierList &classifiers, bool includeNested=true)
 
void appendClassesAndInterfaces (UMLClassifierList &classifiers, bool includeNested=true)
 
void appendEntities (UMLEntityList &entities, bool includeNested=true)
 
virtual bool resolveRef ()
 
- 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
 
bool addAssociationEnd (UMLAssociation *assoc)
 
bool hasAssociation (UMLAssociation *assoc)
 
int removeAssociationEnd (UMLAssociation *assoc)
 
void removeAllAssociationEnds ()
 
int associations ()
 
UMLAssociationList getAssociations ()
 
UMLAssociationList getSpecificAssocs (Uml::AssociationType::Enum assocType)
 
UMLClassifierList getSuperClasses (bool withRealizations=true)
 
UMLClassifierList getSubClasses ()
 
virtual UMLAssociationList getRealizations ()
 
UMLAssociationList getAggregations ()
 
UMLAssociationList getCompositions ()
 
UMLAssociationList getRelationships ()
 
virtual UMLObjectfindChildObject (const QString &n, UMLObject::ObjectType t=UMLObject::ot_UMLObject)
 
virtual UMLObjectfindChildObjectById (Uml::ID::Type id, bool considerAncestors=false)
 
virtual QString uniqChildName (const UMLObject::ObjectType type, const QString &prefix=QString())
 
virtual void removeAllChildObjects ()
 
UMLObjectListsubordinates () const
 
- 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 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)
 
UMLStereotypeumlStereotype ()
 
QStringList & tags ()
 
QString package (const QString &separator=QString(), bool includeRoot=false)
 
UMLPackageList packages (bool includeRoot=false) const
 
bool setUMLPackage (UMLPackage *pPkg)
 
UMLPackageumlPackage () const
 
void setUMLParent (UMLObject *parent)
 
UMLObjectumlParent () 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 loadFromXMI1 (QDomElement &element)
 
bool loadStereotype (QDomElement &element)
 
void setStatic (bool bStatic)
 
bool isStatic () const
 
virtual bool acceptAssociationType (Uml::AssociationType::Enum)
 
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 ()
 
bool isUMLArtifact ()
 
bool isUMLAssociation ()
 
bool isUMLAttribute ()
 
bool isUMLCategory ()
 
bool isUMLCheckConstraint ()
 
bool isUMLClassifier ()
 
bool isUMLComponent ()
 
bool isUMLDatatype ()
 
bool isUMLEntity ()
 
bool isUMLEntityAttribute ()
 
bool isUMLEntityConstraint ()
 
bool isUMLEnum ()
 
bool isUMLEnumLiteral ()
 
bool isUMLFolder ()
 
bool isUMLForeignKeyConstraint ()
 
bool isUMLInstance ()
 
bool isUMLInstanceAttribute ()
 
bool isUMLNode ()
 
bool isUMLObject ()
 
bool isUMLOperation ()
 
bool isUMLPackage ()
 
bool isUMLPort ()
 
bool isUMLRole ()
 
bool isUMLStereotype ()
 
bool isUMLTemplate ()
 
bool isUMLUniqueConstraint ()
 
bool isUMLUseCase ()
 
UMLActorasUMLActor ()
 
UMLArtifactasUMLArtifact ()
 
UMLAssociationasUMLAssociation ()
 
UMLAttributeasUMLAttribute ()
 
UMLCanvasObjectasUMLCanvasObject ()
 
UMLCategoryasUMLCategory ()
 
UMLCheckConstraintasUMLCheckConstraint ()
 
UMLClassifierasUMLClassifier ()
 
UMLClassifierListItemasUMLClassifierListItem ()
 
UMLClassifierSetasUMLClassifierSet ()
 
UMLComponentasUMLComponent ()
 
UMLDatatypeasUMLDatatype ()
 
UMLEntityasUMLEntity ()
 
UMLEntityAttributeasUMLEntityAttribute ()
 
UMLEntityConstraintasUMLEntityConstraint ()
 
UMLEnumasUMLEnum ()
 
UMLEnumLiteralasUMLEnumLiteral ()
 
UMLFolderasUMLFolder ()
 
UMLForeignKeyConstraintasUMLForeignKeyConstraint ()
 
UMLInstanceasUMLInstance ()
 
UMLInstanceAttributeasUMLInstanceAttribute ()
 
UMLNodeasUMLNode ()
 
UMLObjectasUMLObject ()
 
UMLOperationasUMLOperation ()
 
UMLPackageasUMLPackage ()
 
UMLPortasUMLPort ()
 
UMLRoleasUMLRole ()
 
UMLStereotypeasUMLStereotype ()
 
UMLTemplateasUMLTemplate ()
 
UMLUniqueConstraintasUMLUniqueConstraint ()
 
UMLUseCaseasUMLUseCase ()
 

Protected Member Functions

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

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< UMLStereotypem_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< UMLObjectm_pSecondary
 
QString m_SecondaryId
 
QString m_SecondaryFallback
 
QStringList m_TaggedValues
 
UMLObjectPrivatem_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
nameThe name of the Folder.
idThe 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
viewListThe UMLViewList to which to append the diagrams.
includeNestedWhether 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
typeThe type of view to find.
nameThe name of the view to find.
searchAllScopesSearch 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
idID 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
pathFully 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
parentThe 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: