umbrello API Documentation

UMLFolder Class Reference

This class manages the UMLObjects and UMLViews of a Folder. Non-graphical management of objects and diagrams of a Folder. More...

#include <folder.h>

Inheritance diagram for UMLFolder:

UMLPackage UMLCanvasObject UMLObject List of all members.

Public Member Functions

 UMLFolder (const QString &name="", Uml::IDType id=Uml::id_None)
 Sets up a Folder.
virtual ~UMLFolder ()
 Empty deconstructor.
virtual void init ()
 Initializes key variables of the class.
virtual UMLObjectclone () const
 Make a clone of this object.
void setLocalName (const QString &localName)
 Set the localized name of this folder.
QString getLocalName ()
 Return the localized name of this folder.
void addView (UMLView *view)
 Add a view to the diagram list.
void removeView (UMLView *view)
 Remove a view from the diagram list.
void appendViews (UMLViewList &viewList, bool includeNested=true)
 Append the views in this folder to the given diagram list.
void activateViews ()
 Acivate the views in this folder.
UMLViewfindView (Uml::IDType id)
 Seek a view of the given ID in this folder.
UMLViewfindView (Uml::Diagram_Type type, const QString &name, bool searchAllScopes=true)
 Seek a view by the type and name given.
void setViewOptions (const Settings::OptionState &optionState)
 Set the options for the views in this folder.
void removeAllViews ()
 Remove all views in this folder.
void setFolderFile (const QString &fileName)
 Set the folder file name for a separate submodel.
QString getFolderFile ()
 Get the folder file name for a separate submodel.
void saveToXMI (QDomDocument &qDoc, QDomElement &qElement)
 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.

Protected Member Functions

void saveContents (QDomDocument &qDoc, QDomElement &qElement)
 Auxiliary to saveToXMI(): Save the contained objects and diagrams.
void save (QDomDocument &qDoc, QDomElement &qElement)
 Auxiliary to saveToXMI(): Creates a <UML:Model> element when saving a predefined modelview, or a <UML:Package> element when saving a user created folder.
bool loadDiagramsFromXMI (QDomNode &diagrams)
 Auxiliary to load(): Load the diagrams from the <diagrams> in the <XMI.extension>.
bool loadFolderFile (const QString &path)
 Folders in the listview can be marked such that their contents are saved to a separate file.
bool load (QDomElement &element)
 Loads the UML:Component element.

Detailed Description

This class manages the UMLObjects and UMLViews of a Folder. Non-graphical management of objects and diagrams 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 uml-devel@lists.sf.net or http://bugs.kde.org

Definition at line 34 of file folder.h.


Constructor & Destructor Documentation

UMLFolder::UMLFolder const QString &  name = "",
Uml::IDType  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.

Definition at line 28 of file folder.cpp.

References init().

Referenced by clone().

UMLFolder::~UMLFolder  )  [virtual]
 

Empty deconstructor.

Definition at line 33 of file folder.cpp.


Member Function Documentation

void UMLFolder::init  )  [virtual]
 

Initializes key variables of the class.

Reimplemented from UMLPackage.

Definition at line 36 of file folder.cpp.

References UMLObject::setStereotype().

Referenced by UMLFolder().

UMLObject * UMLFolder::clone  )  const [virtual]
 

Make a clone of this object.

Reimplemented from UMLPackage.

Definition at line 42 of file folder.cpp.

References clone(), UMLObject::copyInto(), and UMLFolder().

Referenced by clone().

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

Definition at line 48 of file folder.cpp.

Referenced by UMLDoc::closeDocument(), and UMLDoc::init().

QString UMLFolder::getLocalName  ) 
 

Return the localized name of this folder.

Only useful for the predefined root folders.

Definition at line 52 of file folder.cpp.

Referenced by UMLListView::init().

void UMLFolder::addView UMLView view  ) 
 

Add a view to the diagram list.

Definition at line 56 of file folder.cpp.

Referenced by UMLDoc::addView().

void UMLFolder::removeView UMLView view  ) 
 

Remove a view from the diagram list.

Definition at line 60 of file folder.cpp.

Referenced by UMLDoc::removeView().

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

Definition at line 65 of file folder.cpp.

References UMLObject::getBaseType().

Referenced by UMLDoc::getViewIterator(), and UMLDoc::removeView().

void UMLFolder::activateViews  ) 
 

Acivate the views in this folder.

"Activation": Some widgets require adjustments after loading from file, those are done here.

Definition at line 80 of file folder.cpp.

References UMLView::activateAfterLoad(), UMLListView::createDiagramItem(), UMLListView::findItem(), UMLObject::getBaseType(), UMLView::getID(), and UMLApp::getListView().

Referenced by UMLDoc::activateAllViews().

UMLView * UMLFolder::findView Uml::IDType  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.

Definition at line 104 of file folder.cpp.

References UMLObject::getBaseType(), and UMLView::getID().

Referenced by UMLDoc::findView(), and findView().

UMLView * UMLFolder::findView Uml::Diagram_Type  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.

Definition at line 122 of file folder.cpp.

References findView(), UMLObject::getBaseType(), UMLView::getName(), and UMLView::getType().

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

Set the options for the views in this folder.

Definition at line 142 of file folder.cpp.

References UMLView::setOptionState().

Referenced by UMLDoc::settingsChanged().

void UMLFolder::removeAllViews  ) 
 

Remove all views in this folder.

Definition at line 149 of file folder.cpp.

References UMLObject::getBaseType(), UMLApp::getDocument(), UMLView::removeAllAssociations(), and UMLDoc::removeView().

Referenced by UMLDoc::removeAllViews().

void UMLFolder::setFolderFile const QString &  fileName  ) 
 

Set the folder file name for a separate submodel.

Definition at line 169 of file folder.cpp.

Referenced by UMLListView::popupMenuSel().

QString UMLFolder::getFolderFile  ) 
 

Get the folder file name for a separate submodel.

Definition at line 173 of file folder.cpp.

Referenced by UMLView::isSavedInSeparateFile(), UMLListViewItem::saveToXMI(), and UMLListView::slotObjectCreated().

void UMLFolder::saveToXMI QDomDocument &  qDoc,
QDomElement &  qElement
[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.

Definition at line 212 of file folder.cpp.

References UMLApp::getDocument(), UMLObject::getFullyQualifiedName(), UMLObject::getID(), UMLObject::save(), save(), saveContents(), and UMLDoc::URL().

Referenced by UMLDoc::saveToXMI().

void UMLFolder::saveContents QDomDocument &  qDoc,
QDomElement &  qElement
[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.)

Definition at line 177 of file folder.cpp.

References UMLView::saveToXMI(), and UMLObject::saveToXMI().

Referenced by save(), and saveToXMI().

void UMLFolder::save QDomDocument &  qDoc,
QDomElement &  qElement
[protected]
 

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

Definition at line 201 of file folder.cpp.

References UMLApp::getDocument(), UMLDoc::rootFolderType(), UMLObject::save(), and saveContents().

Referenced by saveToXMI().

bool UMLFolder::loadDiagramsFromXMI QDomNode &  diagrams  )  [protected]
 

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

Definition at line 261 of file folder.cpp.

References UMLDoc::addView(), UMLApp::getDocument(), UMLView::loadFromXMI(), and UMLView::setOptionState().

Referenced by load().

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.

Definition at line 286 of file folder.cpp.

References load().

Referenced by load().

bool UMLFolder::load QDomElement &  element  )  [protected, virtual]
 

Loads the UML:Component element.

Reimplemented from UMLPackage.

Definition at line 325 of file folder.cpp.

References UMLDoc::findObjectById(), UMLDoc::getDatatypeFolder(), UMLApp::getDocument(), UMLDoc::getRootFolder(), loadDiagramsFromXMI(), loadFolderFile(), UMLObject::loadFromXMI(), UMLPackage::removeObject(), UMLObject::setUMLPackage(), and UMLDoc::URL().

Referenced by loadFolderFile().


The documentation for this class was generated from the following files:
KDE Logo
This file is part of the documentation for umbrello Version 3.1.0.
Documentation copyright © 1996-2004 the KDE developers.
Generated on Tue Jun 26 08:08:07 2007 by doxygen 1.4.1 written by Dimitri van Heesch, © 1997-2003