umbrello 2.34.70-5524f40e1
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:
Collaboration diagram for UMLFolder:

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 saveToXMI (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) const
 
void addAssocToConcepts (UMLAssociation *assoc)
 
void removeAssocFromConcepts (UMLAssociation *assoc)
 
UMLObjectfindObject (const QString &name) const
 
UMLObjectfindObjectById (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 ()
 
- 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) 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 UMLObjectfindChildObject (const QString &n, UMLObject::ObjectType t=UMLObject::ot_UMLObject) const
 
virtual UMLObjectfindChildObjectById (Uml::ID::Type id, bool considerAncestors=false) const
 
virtual QString uniqChildName (const UMLObject::ObjectType type, const QString &prefix=QString()) const
 
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 () const
 
QStringList & tags ()
 
QString package (const QString &separator=QString(), bool includeRoot=false) const
 
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 loadFromXMI (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 (QXmlStreamWriter &writer, const QString &type, const QString &tag=QString())
 
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
 
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 ()
 
const UMLActorasUMLActor () const
 
const UMLArtifactasUMLArtifact () const
 
const UMLAssociationasUMLAssociation () const
 
const UMLAttributeasUMLAttribute () const
 
const UMLCanvasObjectasUMLCanvasObject () const
 
const UMLCategoryasUMLCategory () const
 
const UMLCheckConstraintasUMLCheckConstraint () const
 
const UMLClassifierasUMLClassifier () const
 
const UMLClassifierListItemasUMLClassifierListItem () const
 
const UMLClassifierSetasUMLClassifierSet () const
 
const UMLComponentasUMLComponent () const
 
const UMLDatatypeasUMLDatatype () const
 
const UMLEntityasUMLEntity () const
 
const UMLEntityAttributeasUMLEntityAttribute () const
 
const UMLEntityConstraintasUMLEntityConstraint () const
 
const UMLEnumasUMLEnum () const
 
const UMLEnumLiteralasUMLEnumLiteral () const
 
const UMLFolderasUMLFolder () const
 
const UMLForeignKeyConstraintasUMLForeignKeyConstraint () const
 
const UMLInstanceasUMLInstance () const
 
const UMLInstanceAttributeasUMLInstanceAttribute () const
 
const UMLNodeasUMLNode () const
 
const UMLObjectasUMLObject () const
 
const UMLOperationasUMLOperation () const
 
const UMLPackageasUMLPackage () const
 
const UMLPortasUMLPort () const
 
const UMLRoleasUMLRole () const
 
const UMLStereotypeasUMLStereotype () const
 
const UMLTemplateasUMLTemplate () const
 
const UMLUniqueConstraintasUMLUniqueConstraint () const
 
const UMLUseCaseasUMLUseCase () const
 

Protected Member Functions

void saveContents (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_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.
Here is the call graph for this function:

◆ ~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.

Here is the call graph for this function:

◆ 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.)
Here is the call graph for this function:

◆ clone()

UMLObject * UMLFolder::clone ( ) const
virtual

Make a clone of this object.

Reimplemented from UMLPackage.

Here is the call graph for this function:

◆ 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.
Here is the call graph for this function:

◆ 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.
Here is the call graph for this function:

◆ 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 <packagedElement xmi:type="uml:Model"> (in UML2 mode) or <UML:Model> (in UML1 mode).

Reimplemented from UMLPackage.

Here is the call graph for this function:

◆ loadDiagramsFromXMI1()

bool UMLFolder::loadDiagramsFromXMI1 ( QDomNode &  node)
protected

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

Here is the call graph for this function:

◆ 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.
Here is the call graph for this function:

◆ 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.

Here is the call graph for this function:

◆ removeView()

void UMLFolder::removeView ( UMLView view)

Remove a view from the diagram list.

◆ save1()

void UMLFolder::save1 ( QXmlStreamWriter &  writer)
protected

Auxiliary to saveToXMI():

  • In UML1 mode it creates a <UML:Model> element when saving a predefined modelview, or a <UML:Package> element when saving a user created folder.
  • In UML2 mode it creates a <packagedElement xmi:type="uml:Model"> when saving a predefined view, or a <packagedElement xmi:type="uml:Package"> when saving a user created folder. Invokes saveContents() with the newly created element.
Here is the call graph for this function:

◆ saveContents()

void UMLFolder::saveContents ( QXmlStreamWriter &  writer)
protected

Auxiliary to saveToXMI(): 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.)

Here is the call graph for this function:

◆ saveToXMI()

void UMLFolder::saveToXMI ( QXmlStreamWriter &  writer)
virtual

Saves the folder in XMI representation: If m_folderFile is empty then calls save1(). If m_folderFile is non empty then

  • creates an XMI Extension stub for the folder in the main XMI file;
  • creates the external file for the submodel and writes its XMI.

Reimplemented from UMLPackage.

Here is the call graph for this function:

◆ 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.)

Here is the call graph for this function:

◆ setViewOptions()

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

Set the options for the views in this folder.

Here is the call graph for this function:

◆ 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.

Here is the call graph for this function:

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: