umbrello API Documentation

UMLObject Class Reference

This class is the non-graphical version of UMLWidget. The base class for UML objects. More...

#include <umlobject.h>

Inheritance diagram for UMLObject:

UMLAssociation UMLCanvasObject UMLClassifierListItem UMLRole UMLStereotype UMLActor UMLArtifact UMLNode UMLPackage UMLUseCase UMLAttribute UMLEnumLiteral UMLOperation UMLTemplate List of all members.

Public Slots

void emitModified ()
 Forces the emission of the modified signal.

Signals

void modified ()
 Emitted when the UMLObject has changed.

Public Member Functions

 UMLObject (const UMLObject *parent, const QString &name, Uml::IDType id=Uml::id_None)
 Creates a UMLObject.
 UMLObject (const UMLObject *parent)
 Creates a UMLObject.
 UMLObject (const QString &name="", Uml::IDType id=Uml::id_None)
 Creates a UMLObject with a given name and unique ID.
virtual bool operator== (UMLObject &rhs)
 Overloaded '==' operator.
virtual ~UMLObject ()
 Standard deconstructor.
virtual void copyInto (UMLObject *rhs) const
 Copy the internal presentation of this object into the new object.
virtual UMLObjectclone () const =0
 Make a clone of this object.
Uml::Object_Type getBaseType () const
 Returns the type of the object.
virtual void setBaseType (Uml::Object_Type ot)
 Set the type of the object.
virtual Uml::IDType getID () const
 Returns the ID of the object.
void setDoc (const QString &d)
 Sets the documentation for the object.
QString getDoc () const
 Returns the documentation for the object.
Uml::Visibility getVisibility () const
 Returns the visibility of the object.
void setVisibility (Uml::Visibility s)
 Sets the visibility of the object.
void setStereotype (const QString &_name)
 Sets the classes stereotype name.
void setUMLStereotype (UMLStereotype *s)
 Sets the class' UMLStereotype.
void setPackage (const QString &_name)
 Sets the classes Package.
void setUMLPackage (UMLPackage *pPkg)
 Sets the UMLPackage in which this class is located.
const UMLStereotypegetUMLStereotype ()
 Returns the classes UMLStereotype object.
QString getStereotype (bool includeAdornments=false) const
 Returns the classes stereotype name.
QString getPackage (QString separator=QString::null, bool includeRoot=false)
 Return the package(s) in which this UMLObject is contained as a text.
UMLPackageList getPackages (bool includeRoot=false) const
 Return a list of the packages in which this class is embedded.
UMLPackagegetUMLPackage ()
 Returns the UMLPackage that this class is located in.
virtual void setID (Uml::IDType NewID)
 Assigns a new Id to the object.
QString getName () const
 Returns a copy of m_Name.
void setName (const QString &strName)
 Set the UMLObject's name.
virtual QString getFullyQualifiedName (QString separator=QString::null, bool includeRoot=false) const
 Returns the fully qualified name, i.e.
bool getAbstract () const
 Returns the abstract state of the object.
void setAbstract (bool bAbstract)
 Sets the abstract state of the object.
void setInPaste (bool bInPaste=true)
 Sets the abstract state of the object.
bool showProperties (int page=0, bool assoc=false)
 This method is called if you wish to see the properties of a UMLObject.
virtual bool resolveRef ()
 Resolve referenced objects (if any.) Needs to be called after all UML objects are loaded from file.
virtual void saveToXMI (QDomDocument &qDoc, QDomElement &qElement)=0
 This method saves the XMI attributes of each specific model class.
virtual bool loadFromXMI (QDomElement &element)
 This method loads the generic parts of the XMI common to most model classes.
bool getStatic () const
 Returns true if this UMLObject has classifier scope, otherwise false (the default).
void setStatic (bool bStatic)
 Sets the value for m_bStatic.
virtual bool acceptAssociationType (Uml::Association_Type)
 This should be reimplemented by subclasses if they wish to accept certain types of associations.
QString getSecondaryId () const
 Return secondary ID.
void setSecondaryId (const QString &id)
 Set the secondary ID.
QString getSecondaryFallback () const
 Return secondary ID fallback.
void setSecondaryFallback (const QString &id)
 Set the secondary ID fallback.
QDomElement save (const QString &tag, QDomDocument &qDoc)
 Auxiliary to saveToXMI.

Protected Member Functions

virtual void init ()
 Initializes key variables of the class.
void maybeSignalObjectCreated ()
 Calls UMLDoc::signalUMLObjectCreated() if m_BaseType affords doing so.
virtual bool load (QDomElement &element)
 Auxiliary to loadFromXMI.

Protected Attributes

Uml::IDType m_nId
 The object's id.
QString m_Doc
 The object's documentation.
UMLPackagem_pUMLPackage
 The package the object belongs to if applicable.
UMLStereotypem_pStereotype
 The stereotype of the object if applicable.
QString m_Name
 The objects name.
Uml::Object_Type m_BaseType
 The objects type.
Uml::Visibility m_Vis
 The objects visibility.
bool m_bAbstract
 The state of whether the object is abstract or not.
bool m_bStatic
 This attribute holds whether the UMLObject has instance scope (false - the default) or classifier scope (true).
bool m_bInPaste
 Caller sets this true when in paste operation.
bool m_bCreationWasSignalled
 Auxiliary to maybeSignalObjectCreated().
UMLObjectm_pSecondary
 Pointer to an associated object.
QString m_SecondaryId
 xmi.id of the secondary object for intermediate use during loading.
QString m_SecondaryFallback
 Last-chance backup for when m_SecondaryId is not found.

Detailed Description

This class is the non-graphical version of UMLWidget. The base class for UML objects.

These are created and maintained in the class UMLDoc. This class holds all the generic information needed for all UMLObjects.

Author:
Paul Hensgen <phensgen@techie.com> Bugs and comments to uml-devel@lists.sf.net or http://bugs.kde.org

Definition at line 36 of file umlobject.h.


Constructor & Destructor Documentation

UMLObject::UMLObject const UMLObject parent,
const QString &  name,
Uml::IDType  id = Uml::id_None
 

Creates a UMLObject.

Parameters:
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.

Definition at line 33 of file umlobject.cpp.

References init(), m_Name, and m_nId.

UMLObject::UMLObject const UMLObject parent  ) 
 

Creates a UMLObject.

Parameters:
parent The parent of the object.

Definition at line 53 of file umlobject.cpp.

References init().

UMLObject::UMLObject const QString &  name = "",
Uml::IDType  id = Uml::id_None
[explicit]
 

Creates a UMLObject with a given name and unique ID.

Parameters:
name The name of the object.
id The unique ID of the object.

Definition at line 43 of file umlobject.cpp.

References init(), m_Name, and m_nId.

UMLObject::~UMLObject  )  [virtual]
 

Standard deconstructor.

Definition at line 58 of file umlobject.cpp.


Member Function Documentation

bool UMLObject::operator== UMLObject rhs  )  [virtual]
 

Overloaded '==' operator.

Definition at line 131 of file umlobject.cpp.

References m_BaseType, m_Name, and m_pUMLPackage.

Referenced by UMLOperation::operator==(), UMLEntityAttribute::operator==(), and UMLAttribute::operator==().

void UMLObject::copyInto UMLObject rhs  )  const [virtual]
 

Copy the internal presentation of this object into the new object.

Definition at line 185 of file umlobject.cpp.

References m_bAbstract, m_BaseType, m_bStatic, m_Doc, m_Name, m_nId, m_pStereotype, m_pUMLPackage, m_Vis, and Model_Utils::uniqObjectName().

Referenced by UMLUseCase::clone(), UMLNode::clone(), UMLFolder::clone(), UMLComponent::clone(), UMLArtifact::clone(), UMLActor::clone(), UMLCanvasObject::copyInto(), UMLStereotype::copyInto(), and UMLClassifierListItem::copyInto().

virtual UMLObject* UMLObject::clone  )  const [pure virtual]
 

Make a clone of this object.

To be implemented by inheriting classes.

Implemented in UMLActor, UMLArtifact, UMLAssociation, UMLAttribute, UMLClassifier, UMLClassifierListItem, UMLComponent, UMLEntity, UMLEntityAttribute, UMLEnum, UMLEnumLiteral, UMLFolder, UMLNode, UMLOperation, UMLPackage, UMLStereotype, UMLTemplate, UMLRole, and UMLUseCase.

Referenced by UMLObjectList::copyInto(), and UMLWidget::slotMenuSelection().

Uml::Object_Type UMLObject::getBaseType  )  const
 

Returns the type of the object.

Returns:
Returns the type of the object.

Definition at line 245 of file umlobject.cpp.

References m_BaseType.

Referenced by AssociationWidget::activate(), UMLFolder::activateViews(), UMLClassifier::addAttribute(), UMLDoc::addUMLObject(), UMLPackage::appendClasses(), UMLPackage::appendClassesAndInterfaces(), UMLPackage::appendClassifiers(), UMLPackage::appendInterfaces(), UMLFolder::appendViews(), UMLCanvasObject::associations(), AssociationWidget::cleanup(), UMLListViewItem::compare(), UMLView::contentsDragEnterEvent(), Model_Utils::convert_OT_LVT(), UMLView::createAutoAssociations(), UMLView::createAutoAttributeAssociations(), Import_Utils::createUMLObject(), UMLDrag::decodeClip1(), UMLDrag::decodeClip2(), UMLCanvasObject::findChildObject(), Model_Utils::findObjectInList(), CodeGenerator::findObjectsRelated(), UMLClassifier::findOperations(), Model_Utils::findUMLObject(), UMLFolder::findView(), AssociationWidget::getAssociation(), UMLCanvasObject::getAssociations(), AssociationWidget::getAssocType(), AssociationWidget::getAttribute(), UMLClassifier::getAttributeList(), AssociationWidget::getChangeability(), UMLDoc::getDatatypes(), UMLClassifier::getFilteredList(), UMLAttribute::getFullyQualifiedName(), UMLClassifier::getOpList(), AssociationWidget::getRoleDoc(), UMLCanvasObject::getSpecificAssocs(), UMLClassifier::getTemplateList(), AssociationWidget::getWidgetID(), Import_Utils::insertAttribute(), UMLClassifier::load(), UMLAssociation::load(), AssociationWidget::loadFromXMI(), UMLDoc::loadUMLObjectsFromXMI(), UMLClassifier::makeChildObject(), ClassifierCodeDocument::parentIsClass(), ClassifierCodeDocument::parentIsInterface(), AdaImport::parseStmt(), UMLListView::popupMenuSel(), UMLCanvasObject::removeAllAssociationEnds(), UMLFolder::removeAllViews(), UMLDoc::removeUMLObject(), resolveRef(), UMLPackage::resolveRef(), UMLEntity::resolveRef(), UMLClassifier::resolveRef(), UMLAssociation::resolveRef(), UMLListViewItem::saveToXMI(), AssociationWidget::setAssocType(), AssociationWidget::setChangeability(), AssociationWidget::setMulti(), setPackage(), AssociationWidget::setRoleDoc(), AssociationWidget::setRoleName(), AssociationWidget::setVisibility(), AssociationWidget::setWidget(), UMLClassifier::takeItem(), UMLAttribute::toString(), CPPHeaderCodeDocument::updateContent(), UMLListViewItem::updateObject(), ClassGenPage::updateObject(), and AdaWriter::writeClass().

void UMLObject::setBaseType Uml::Object_Type  ot  )  [virtual]
 

Set the type of the object.

Parameters:
ot The Uml::Object_Type to set.

Reimplemented in UMLClassifier.

Definition at line 249 of file umlobject.cpp.

References m_BaseType.

Referenced by UMLClassifier::copyInto(), Import_Utils::createGeneralization(), and UMLEntityAttribute::UMLEntityAttribute().

Uml::IDType UMLObject::getID  )  const [virtual]
 

Returns the ID of the object.

Returns:
Returns the ID of the object.

Definition at line 253 of file umlobject.cpp.

References m_nId.

Referenced by UMLPackage::addAssocToConcepts(), UMLClassifier::addOperation(), UMLDoc::assignNewIDs(), UMLView::createAutoAssociations(), UMLView::findAssocWidget(), UMLCanvasObject::findChildObjectById(), Model_Utils::findObjectInList(), UMLClassifier::findSubClassConcepts(), UMLClassifier::findSuperClassConcepts(), WidgetBase::getID(), UMLListViewItem::getID(), UMLAssociation::getObjectId(), UMLCanvasObject::getSubClasses(), UMLCanvasObject::getSuperClasses(), UMLClassifier::getUniAssociationToBeImplemented(), AssociationWidget::getWidgetID(), UMLAssociation::load(), UMLDoc::loadUMLObjectsFromXMI(), UMLView::removeAssocInViewAndDoc(), UMLDoc::resolveTypes(), save(), UMLRole::saveToXMI(), UMLListViewItem::saveToXMI(), UMLDoc::saveToXMI(), UMLTemplate::saveToXMI(), UMLOperation::saveToXMI(), MessageWidget::saveToXMI(), UMLFolder::saveToXMI(), UMLEntityAttribute::saveToXMI(), UMLClassifier::saveToXMI(), UMLAttribute::saveToXMI(), AssociationWidget::saveToXMI(), OwnedCodeBlock::setAttributesOnNode(), CodeDocument::setAttributesOnNode(), WidgetBase::setID(), UMLListViewItem::setID(), UMLListViewItem::UMLListViewItem(), UMLWidget::UMLWidget(), and SQLWriter::writeClass().

void UMLObject::setDoc const QString &  d  ) 
 

Sets the documentation for the object.

Parameters:
d The documentation for the object.

Definition at line 240 of file umlobject.cpp.

References m_Doc.

Referenced by Import_Utils::addEnumLiteral(), Import_Utils::createUMLObject(), Import_Utils::insertAttribute(), Import_Utils::insertMethod(), UMLDoc::loadFromXMI(), WidgetBase::setDoc(), UMLAssociation::setRoleDoc(), ClassifierListPage::slotClicked(), Import_Rose::umbrellify(), and UMLRoleProperties::updateObject().

QString UMLObject::getDoc  )  const
 

Returns the documentation for the object.

Returns:
Returns the documentation for the object.

Definition at line 257 of file umlobject.cpp.

References m_Doc.

Referenced by WidgetBase::getDoc(), UMLAssociation::getRoleDoc(), Import_Utils::insertMethod(), ClassifierListPage::slotClicked(), JSWriter::writeClass(), and ASWriter::writeClass().

Uml::Visibility UMLObject::getVisibility  )  const
 

Returns the visibility of the object.

Returns:
Returns the visibility of the object.

Definition at line 261 of file umlobject.cpp.

References m_Vis.

Referenced by CodeParameter::getVisibility(), AssociationWidget::getVisibility(), UMLAssociation::getVisibility(), Import_Utils::insertMethod(), UMLListView::moveObject(), UMLRole::saveToXMI(), UMLAttributeDialog::setupDialog(), AssociationWidget::syncToModel(), UMLListViewItem::updateObject(), PascalWriter::writeClass(), IDLWriter::writeClass(), and AdaWriter::writeClass().

void UMLObject::setVisibility Uml::Visibility  s  ) 
 

Sets the visibility of the object.

Parameters:
s The visibility of the object.

Definition at line 265 of file umlobject.cpp.

References emitModified(), and m_Vis.

Referenced by UMLAttributeDialog::apply(), Import_Utils::insertMethod(), UMLListView::moveObject(), UMLListViewItem::okRename(), JavaImport::parseStmt(), AssociationWidget::setVisibility(), UMLAssociation::setVisibility(), and UMLRoleProperties::updateObject().

void UMLObject::setStereotype const QString &  _name  ) 
 

Sets the classes stereotype name.

Internally uses setUMLStereotype().

Parameters:
_name Sets the classes stereotype name.

Definition at line 289 of file umlobject.cpp.

References UMLDoc::findOrCreateStereotype(), UMLApp::getDocument(), and setUMLStereotype().

Referenced by UMLTemplateDialog::apply(), UMLOperationDialog::apply(), UMLEntityAttributeDialog::apply(), UMLAttributeDialog::apply(), Import_Utils::createUMLObject(), UMLFolder::init(), Import_Utils::insertMethod(), UMLListView::itemRenamed(), loadFromXMI(), PascalImport::parseStmt(), IDLImport::parseStmt(), AdaImport::parseStmt(), UMLClassifier::setBaseType(), Import_Rose::umbrellify(), and ClassGenPage::updateObject().

void UMLObject::setUMLStereotype UMLStereotype s  ) 
 

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.

Parameters:
s Sets the classes UMLStereotype.

Definition at line 270 of file umlobject.cpp.

References UMLStereotype::decrRefCount(), emitModified(), UMLApp::getDocument(), m_pStereotype, UMLStereotype::refCount(), and UMLDoc::removeStereotype().

Referenced by setStereotype().

void UMLObject::setPackage const QString &  _name  ) 
 

Sets the classes Package.

DEPRECATED - use SetUMLPackage instead.

Parameters:
_name The classes Package name.

Definition at line 299 of file umlobject.cpp.

References Import_Utils::createUMLObject(), UMLDoc::findUMLObject(), getBaseType(), UMLApp::getDocument(), m_Name, and setUMLPackage().

void UMLObject::setUMLPackage UMLPackage pPkg  ) 
 

Sets the UMLPackage in which this class is located.

Parameters:
pPkg Pointer to the class' UMLPackage.

Definition at line 322 of file umlobject.cpp.

References emitModified(), and m_pUMLPackage.

Referenced by UMLListView::addAtContainer(), UMLDoc::addUMLObject(), UMLDoc::closeDocument(), Import_Utils::createGeneralization(), UMLListView::createUMLObject(), Import_Utils::createUMLObject(), UMLDoc::init(), UMLPackage::load(), UMLFolder::load(), UMLComponent::load(), UMLClassifier::load(), UMLDoc::loadUMLObjectsFromXMI(), UMLListView::moveObject(), AdaImport::parseStmt(), setPackage(), UMLClassifierListItem::UMLClassifierListItem(), and ClassGenPage::updateObject().

const UMLStereotype * UMLObject::getUMLStereotype  ) 
 

Returns the classes UMLStereotype object.

Returns:
Returns the classes UMLStereotype object.

Definition at line 327 of file umlobject.cpp.

References m_pStereotype.

QString UMLObject::getStereotype bool  includeAdornments = false  )  const
 

Returns the classes stereotype name.

Returns an empty string if no stereotype object is set.

Parameters:
includeAdornments Include surrounding angled brackets "«" and "»".
Returns:
Returns the classes stereotype name.

Definition at line 331 of file umlobject.cpp.

References getName(), and m_pStereotype.

Referenced by PackageWidget::calculateSize(), NodeWidget::calculateSize(), EnumWidget::calculateSize(), EntityWidget::calculateSize(), DatatypeWidget::calculateSize(), ComponentWidget::calculateSize(), ClassifierWidget::calculateSize(), ClassGenPage::ClassGenPage(), UMLView::contentsDragEnterEvent(), PackageWidget::draw(), NodeWidget::draw(), EnumWidget::draw(), EntityWidget::draw(), DatatypeWidget::draw(), ComponentWidget::draw(), ClassifierWidget::draw(), UMLOperation::isConstructorOperation(), UMLOperation::isDestructorOperation(), ParmPropDlg::ParmPropDlg(), AdaImport::parseStmt(), UMLTemplateDialog::setupDialog(), UMLOperationDialog::setupDialog(), UMLEntityAttributeDialog::setupDialog(), UMLAttributeDialog::setupDialog(), UMLListViewItem::updateObject(), and IDLWriter::writeClass().

QString UMLObject::getPackage QString  separator = QString::null,
bool  includeRoot = false
 

Return the package(s) in which this UMLObject is contained as a text.

Parameters:
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.
Returns:
The UMLObject's enclosing package(s) as a text.

Definition at line 340 of file umlobject.cpp.

References UMLApp::activeLanguageScopeSeparator(), getFullyQualifiedName(), and m_Name.

Referenced by CPPHeaderCodeDocument::updateContent(), and PerlWriter::writeClass().

UMLPackageList UMLObject::getPackages bool  includeRoot = false  )  const
 

Return a list of the packages in which this class is embedded.

The outermost package is first in the list.

Parameters:
includeRoot Whether to prefix the root folder name. Default: false.
Returns:
UMLPackageList of the containing packages.

Definition at line 350 of file umlobject.cpp.

References getUMLPackage(), and m_pUMLPackage.

Referenced by CPPHeaderCodeDocument::updateContent(), and IDLWriter::writeClass().

UMLPackage * UMLObject::getUMLPackage  ) 
 

Returns the UMLPackage that this class is located in.

Returns:
Pointer to the UMLPackage of this class.

Definition at line 362 of file umlobject.cpp.

References m_pUMLPackage.

Referenced by UMLDoc::addAssociation(), UMLPackage::addObject(), UMLDoc::addUMLObject(), Model_Utils::convert_OT_LVT(), UMLView::createAutoAssociations(), Import_Utils::createUMLObject(), UMLDoc::currentRoot(), UMLDrag::decodeClip1(), Model_Utils::findUMLObject(), getPackages(), UMLClassifierListItem::getTypeName(), Model_Utils::guessContainer(), UMLDoc::loadUMLObjectsFromXMI(), UMLListView::moveObject(), UMLDoc::removeAssociation(), UMLDoc::removeUMLObject(), UMLOperation::toString(), UMLAttribute::toString(), CPPHeaderCodeDocument::updateContent(), ClassGenPage::updateObject(), and CSharpWriter::writeClass().

void UMLObject::setID Uml::IDType  NewID  )  [virtual]
 

Assigns a new Id to the object.

Definition at line 95 of file umlobject.cpp.

References emitModified(), and m_nId.

Referenced by UMLDoc::assignNewIDs(), UMLListViewItem::okRename(), WidgetBase::setID(), Import_Rose::umbrellify(), and UMLAssociation::UMLAssociation().

QString UMLObject::getName  )  const
 

Returns a copy of m_Name.

Definition at line 105 of file umlobject.cpp.

References m_Name.

Referenced by UMLDoc::addAssociation(), UMLPackage::addAssocToConcepts(), UMLClassifier::addAttribute(), UMLEntity::addEntityAttribute(), UMLEnum::addEnumLiteral(), UMLPackage::addObject(), UMLClassifier::addOperation(), UMLClassifier::addTemplate(), UMLDoc::addUMLObject(), UMLTemplateDialog::apply(), UMLOperationDialog::apply(), UMLEntityAttributeDialog::apply(), UMLAttributeDialog::apply(), ClassifierWidget::calculateAsCircleSize(), PackageWidget::calculateSize(), ObjectWidget::calculateSize(), NodeWidget::calculateSize(), EnumWidget::calculateSize(), EntityWidget::calculateSize(), ComponentWidget::calculateSize(), ClassifierWidget::calculateSize(), ClassGenPage::ClassGenPage(), UMLEntity::createAttribute(), UMLClassifier::createAttribute(), UMLListView::createDiagramItem(), UMLEnum::createEnumLiteral(), UMLClassifier::createOperation(), UMLClassifier::createTemplate(), UMLListView::createUMLObject(), UMLDrag::decodeClip1(), UMLListView::determineParentItem(), EnumWidget::draw(), EntityWidget::draw(), UMLCanvasObject::findChildObject(), UMLPackage::findObject(), UMLClassifier::findOperation(), UMLClassifier::findOperations(), UMLOperation::findParm(), UMLDoc::findStereotype(), Model_Utils::findUMLObject(), UMLAttribute::getFullyQualifiedName(), UMLWidget::getName(), CodeParameter::getName(), UMLClassifier::getOpList(), CodeDocument::getPackage(), UMLAssociation::getRoleName(), getStereotype(), UMLAttribute::getTemplateParams(), UMLTemplate::getTypeName(), CodeClassField::getTypeName(), UMLClassifierListItem::getTypeName(), CodeClassField::getUMLObjectName(), Import_Utils::insertMethod(), UMLOperation::isConstructorOperation(), UMLOperation::isDestructorOperation(), UMLDoc::loadUMLObjectsFromXMI(), UMLListView::moveObject(), UMLOperation::moveParmLeft(), ParmPropDlg::ParmPropDlg(), JavaImport::parseStmt(), UMLCanvasObject::removeAllAssociationEnds(), UMLDoc::removeAssociation(), UMLDoc::removeUMLObject(), UMLDoc::resolveTypes(), UMLDoc::saveToXMI(), ClassifierCodeDocument::saveToXMI(), UMLTemplateDialog::setupDialog(), UMLOperationDialog::setupDialog(), UMLEntityAttributeDialog::setupDialog(), UMLAttributeDialog::setupDialog(), UMLStereotype::showPropertiesDialog(), UMLEnumLiteral::showPropertiesDialog(), ClassifierListPage::slotBottomClicked(), ClassifierListPage::slotDownClicked(), ClassifierListPage::slotTopClicked(), ClassifierListPage::slotUpClicked(), AssociationWidget::syncToModel(), UMLClassifier::takeItem(), UMLTemplate::toString(), UMLOperation::toString(), UMLEntityAttribute::toString(), UMLClassifierListItem::toString(), UMLAttribute::toString(), UMLAssociation::toString(), Import_Rose::umbrellify(), CPPHeaderCodeDocument::updateContent(), UMLListViewItem::updateObject(), SQLWriter::writeClass(), RubyWriter::writeClass(), PhpWriter::writeClass(), Php5Writer::writeClass(), PascalWriter::writeClass(), JSWriter::writeClass(), IDLWriter::writeClass(), CSharpWriter::writeClass(), ASWriter::writeClass(), and AdaWriter::writeClass().

void UMLObject::setName const QString &  strName  ) 
 

Set the UMLObject's name.

Definition at line 100 of file umlobject.cpp.

References emitModified(), and m_Name.

Referenced by UMLTemplateDialog::apply(), UMLEntityAttributeDialog::apply(), UMLAttributeDialog::apply(), UMLClassifier::createOperation(), UMLDrag::decodeClip1(), UMLListViewItem::okRename(), AdaImport::parseStmt(), UMLWidget::setName(), AssociationWidget::setName(), UMLAssociation::setRoleName(), UMLStereotype::showPropertiesDialog(), UMLEnumLiteral::showPropertiesDialog(), Import_Rose::umbrellify(), UMLRoleProperties::updateObject(), and ClassGenPage::updateObject().

QString UMLObject::getFullyQualifiedName QString  separator = QString::null,
bool  includeRoot = false
const [virtual]
 

Returns the fully qualified name, i.e.

all package prefixes and then m_Name.

Parameters:
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.
Returns:
The fully qualified name of this UMLObject.

Reimplemented in UMLAttribute.

Definition at line 109 of file umlobject.cpp.

References UMLApp::activeLanguageScopeSeparator(), UMLDoc::getDatatypeFolder(), UMLApp::getDocument(), m_Name, m_pUMLPackage, and UMLDoc::rootFolderType().

Referenced by ClassifierWidget::calculateAsCircleSize(), EnumWidget::calculateSize(), DatatypeWidget::calculateSize(), ClassifierWidget::calculateSize(), EnumWidget::draw(), ClassifierWidget::draw(), ClassifierWidget::drawAsCircle(), UMLAttribute::getFullyQualifiedName(), getPackage(), UMLClassifierListItem::getTypeName(), ParmPropDlg::ParmPropDlg(), JavaImport::parseStmt(), AdaImport::parseStmt(), UMLFolder::saveToXMI(), UMLOperationDialog::setupDialog(), UMLAttributeDialog::setupDialog(), UMLOperation::toString(), UMLAttribute::toString(), IDLWriter::writeClass(), and CSharpWriter::writeClass().

bool UMLObject::getAbstract  )  const
 

Returns the abstract state of the object.

Definition at line 208 of file umlobject.cpp.

References m_bAbstract.

Referenced by UseCaseWidget::calculateSize(), ClassifierWidget::calculateSize(), UMLView::contentsDragEnterEvent(), UseCaseWidget::draw(), DatatypeWidget::draw(), ClassifierWidget::draw(), CodeParameter::getAbstract(), UMLClassifier::hasAbstractOps(), Import_Utils::insertMethod(), ListPopupMenu::ListPopupMenu(), ClassifierWidget::saveToXMI(), and UMLOperationDialog::setupDialog().

void UMLObject::setAbstract bool  bAbstract  ) 
 

Sets the abstract state of the object.

Definition at line 212 of file umlobject.cpp.

References emitModified(), and m_bAbstract.

Referenced by UMLOperationDialog::apply(), Import_Utils::insertMethod(), JavaImport::parseStmt(), IDLImport::parseStmt(), and AdaImport::parseStmt().

void UMLObject::setInPaste bool  bInPaste = true  ) 
 

Sets the abstract state of the object.

Definition at line 217 of file umlobject.cpp.

References m_bInPaste.

Referenced by UMLDrag::decodeClip1().

bool UMLObject::showProperties int  page = 0,
bool  assoc = false
 

This method is called if you wish to see the properties of a UMLObject.

A dialog box will be displayed from which you can change the object's properties.

Parameters:
page The page to show.
assoc Whether to show association page.
Returns:
True if we modified the object.

Definition at line 76 of file umlobject.cpp.

References UMLApp::getDocument(), UMLApp::getDocWindow(), modified(), UMLDoc::setModified(), DocWindow::showDocumentation(), and DocWindow::updateDocumentation().

Referenced by UMLListView::popupMenuSel(), and UMLWidget::slotMenuSelection().

bool UMLObject::resolveRef  )  [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.

Returns:
True for success.

Reimplemented in UMLAssociation, UMLClassifier, UMLEntity, UMLOperation, UMLPackage, and UMLCanvasObject.

Definition at line 393 of file umlobject.cpp.

References Import_Utils::createUMLObject(), UMLDoc::findObjectById(), UMLDoc::findUMLObject(), getBaseType(), UMLDoc::getDatatypeFolder(), UMLApp::getDocument(), UMLStereotype::incrRefCount(), m_Name, m_pSecondary, m_pStereotype, m_SecondaryFallback, m_SecondaryId, and maybeSignalObjectCreated().

Referenced by UMLDrag::decodeClip1(), UMLDrag::decodeClip5(), UMLCanvasObject::resolveRef(), UMLPackage::resolveRef(), UMLOperation::resolveRef(), UMLEntity::resolveRef(), UMLClassifier::resolveRef(), and UMLAssociation::resolveRef().

virtual void UMLObject::saveToXMI QDomDocument &  qDoc,
QDomElement &  qElement
[pure virtual]
 

This method saves the XMI attributes of each specific model class.

It needs to be implemented by each child class. For creating the QDomElement and saving the common XMI parts, it can use the save() method.

Implemented in UMLActor, UMLArtifact, UMLAssociation, UMLAttribute, UMLClassifier, UMLComponent, UMLEntity, UMLEntityAttribute, UMLEnum, UMLEnumLiteral, UMLFolder, UMLNode, UMLOperation, UMLPackage, UMLStereotype, UMLTemplate, UMLRole, and UMLUseCase.

Referenced by UMLFolder::saveContents(), UMLPackage::saveToXMI(), UMLEnum::saveToXMI(), UMLEntity::saveToXMI(), UMLClassifier::saveToXMI(), UMLDrag::setUMLDataClip1(), UMLDrag::setUMLDataClip2(), UMLDrag::setUMLDataClip4(), and UMLDrag::setUMLDataClip5().

bool UMLObject::loadFromXMI QDomElement &  element  )  [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.

Parameters:
element The QDomElement from which to load.

Definition at line 545 of file umlobject.cpp.

References UMLPackage::addObject(), UMLDoc::findStereotypeById(), UMLApp::getDocument(), UMLApp::getListView(), UMLListViewItem::getType(), UMLListViewItem::getUMLObject(), UMLStereotype::incrRefCount(), load(), m_bAbstract, m_BaseType, m_bInPaste, m_bStatic, m_Doc, m_Name, m_nId, m_pStereotype, m_pUMLPackage, m_SecondaryId, m_Vis, UMLDoc::rootFolderType(), and setStereotype().

Referenced by UMLDrag::decodeClip1(), UMLDrag::decodeClip2(), UMLDrag::decodeClip4(), UMLDrag::decodeClip5(), UMLPackage::load(), UMLOperation::load(), UMLFolder::load(), UMLEnum::load(), UMLEntity::load(), UMLComponent::load(), UMLClassifier::load(), UMLAssociation::load(), RubyClassifierCodeDocument::loadChildTextBlocksFromNode(), JavaClassifierCodeDocument::loadChildTextBlocksFromNode(), JavaANTCodeDocument::loadChildTextBlocksFromNode(), CPPHeaderCodeDocument::loadChildTextBlocksFromNode(), CodeGenObjectWithTextBlocks::loadChildTextBlocksFromNode(), and UMLDoc::loadUMLObjectsFromXMI().

bool UMLObject::getStatic  )  const
 

Returns true if this UMLObject has classifier scope, otherwise false (the default).

Definition at line 222 of file umlobject.cpp.

References m_bStatic.

Referenced by CodeParameter::getStatic(), Import_Utils::insertMethod(), UMLOperationDialog::setupDialog(), UMLAttributeDialog::setupDialog(), and AdaWriter::writeClass().

void UMLObject::setStatic bool  bStatic  ) 
 

Sets the value for m_bStatic.

Definition at line 227 of file umlobject.cpp.

References emitModified(), and m_bStatic.

Referenced by UMLOperationDialog::apply(), UMLAttributeDialog::apply(), Import_Utils::insertAttribute(), Import_Utils::insertMethod(), and JavaImport::parseStmt().

bool UMLObject::acceptAssociationType Uml::Association_Type   )  [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.

Definition at line 90 of file umlobject.cpp.

QString UMLObject::getSecondaryId  )  const
 

Return secondary ID.

Required by resolveRef().

Definition at line 366 of file umlobject.cpp.

References m_SecondaryId.

Referenced by UMLAssociation::getObjectId().

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.

Definition at line 370 of file umlobject.cpp.

References m_SecondaryId.

Referenced by UMLAssociation::load(), and Import_Rose::umbrellify().

QString UMLObject::getSecondaryFallback  )  const
 

Return secondary ID fallback.

Required by resolveRef() for imported model files.

Definition at line 374 of file umlobject.cpp.

References m_SecondaryFallback.

void UMLObject::setSecondaryFallback const QString &  id  ) 
 

Set the secondary ID fallback.

Currently only used by petalTree2Uml().

Definition at line 378 of file umlobject.cpp.

References m_SecondaryFallback.

Referenced by Import_Rose::umbrellify().

QDomElement UMLObject::save const QString &  tag,
QDomDocument &  qDoc
 

Auxiliary to saveToXMI.

Create a QDomElement 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.

Definition at line 492 of file umlobject.cpp.

References UMLApp::getDocument(), getID(), UMLDoc::getModelID(), m_bAbstract, m_BaseType, m_bStatic, m_Doc, m_Name, m_nId, m_pStereotype, m_pUMLPackage, and m_Vis.

Referenced by UMLFolder::save(), UMLUseCase::saveToXMI(), UMLRole::saveToXMI(), UMLTemplate::saveToXMI(), UMLStereotype::saveToXMI(), UMLPackage::saveToXMI(), UMLOperation::saveToXMI(), UMLNode::saveToXMI(), UMLFolder::saveToXMI(), UMLEnumLiteral::saveToXMI(), UMLEnum::saveToXMI(), UMLEntityAttribute::saveToXMI(), UMLEntity::saveToXMI(), UMLComponent::saveToXMI(), UMLClassifier::saveToXMI(), UMLAttribute::saveToXMI(), UMLAssociation::saveToXMI(), UMLArtifact::saveToXMI(), and UMLActor::saveToXMI().

void UMLObject::emitModified  )  [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.

Definition at line 233 of file umlobject.cpp.

References UMLApp::getDocument(), UMLDoc::loading(), and modified().

Referenced by UMLCanvasObject::addAssociationEnd(), UMLClassifier::addAttribute(), UMLEntity::addEntityAttribute(), UMLEnum::addEnumLiteral(), UMLClassifier::addOperation(), UMLOperation::addParm(), UMLClassifier::addTemplate(), UMLCanvasObject::removeAssociationEnd(), UMLClassifier::removeAttribute(), UMLEntity::removeEntityAttribute(), UMLEnum::removeEnumLiteral(), UMLClassifier::removeOperation(), UMLClassifier::removeTemplate(), setAbstract(), UMLRole::setChangeability(), setID(), UMLAttribute::setInitialValue(), UMLRole::setMultiplicity(), setName(), UMLRole::setObject(), setStatic(), UMLClassifierListItem::setType(), UMLClassifierListItem::setTypeName(), setUMLPackage(), setUMLStereotype(), setVisibility(), and UMLRoleProperties::updateObject().

void UMLObject::modified  )  [signal]
 

Emitted when the UMLObject has changed.

Note that some objects emit this signal when one of its children changes, for example, a UMLClass emits a modified() signal when one of its operation changes while the Operation itself emits the corresponding signal as well.

Referenced by UMLClassifier::addAttribute(), UMLEntity::addEntityAttribute(), UMLEnum::addEnumLiteral(), UMLClassifier::addOperation(), UMLOperation::addParm(), UMLClassifier::addTemplate(), emitModified(), UMLOperation::moveParmLeft(), UMLOperation::moveParmRight(), UMLClassifier::removeOperation(), UMLOperation::removeParm(), UMLClassifier::removeTemplate(), UMLAssociation::setAssocType(), showProperties(), and UMLClassifier::takeItem().

void UMLObject::init  )  [protected, virtual]
 

Initializes key variables of the class.

Reimplemented in UMLActor, UMLArtifact, UMLComponent, UMLEntityAttribute, UMLFolder, UMLNode, UMLPackage, and UMLUseCase.

Definition at line 61 of file umlobject.cpp.

References m_bAbstract, m_BaseType, m_bCreationWasSignalled, m_bInPaste, m_bStatic, m_Doc, m_Name, m_nId, m_pSecondary, m_pStereotype, m_pUMLPackage, and m_Vis.

Referenced by UMLAssociation::UMLAssociation(), UMLCanvasObject::UMLCanvasObject(), UMLObject(), and UMLRole::UMLRole().

void UMLObject::maybeSignalObjectCreated  )  [protected]
 

Calls UMLDoc::signalUMLObjectCreated() if m_BaseType affords doing so.

Definition at line 382 of file umlobject.cpp.

References UMLApp::getDocument(), m_BaseType, m_bCreationWasSignalled, and UMLDoc::signalUMLObjectCreated().

Referenced by resolveRef().

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

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, UMLClassifier, UMLComponent, UMLEntity, UMLEntityAttribute, UMLEnum, UMLEnumLiteral, UMLFolder, UMLNode, UMLOperation, UMLPackage, UMLTemplate, UMLRole, and UMLUseCase.

Definition at line 539 of file umlobject.cpp.

Referenced by loadFromXMI().


Member Data Documentation

Uml::IDType UMLObject::m_nId [protected]
 

The object's id.

Definition at line 402 of file umlobject.h.

Referenced by copyInto(), getID(), init(), loadFromXMI(), save(), setID(), and UMLObject().

QString UMLObject::m_Doc [protected]
 

The object's documentation.

Definition at line 407 of file umlobject.h.

Referenced by copyInto(), getDoc(), init(), loadFromXMI(), save(), and setDoc().

UMLPackage* UMLObject::m_pUMLPackage [protected]
 

The package the object belongs to if applicable.

Definition at line 412 of file umlobject.h.

Referenced by copyInto(), getFullyQualifiedName(), getPackages(), getUMLPackage(), init(), loadFromXMI(), operator==(), save(), and setUMLPackage().

UMLStereotype* UMLObject::m_pStereotype [protected]
 

The stereotype of the object if applicable.

Definition at line 417 of file umlobject.h.

Referenced by copyInto(), getStereotype(), getUMLStereotype(), init(), loadFromXMI(), resolveRef(), save(), and setUMLStereotype().

QString UMLObject::m_Name [protected]
 

The objects name.

Reimplemented in UMLAssociation.

Definition at line 422 of file umlobject.h.

Referenced by copyInto(), getFullyQualifiedName(), getName(), getPackage(), init(), loadFromXMI(), operator==(), resolveRef(), save(), setName(), setPackage(), and UMLObject().

Uml::Object_Type UMLObject::m_BaseType [protected]
 

The objects type.

Definition at line 427 of file umlobject.h.

Referenced by copyInto(), getBaseType(), init(), loadFromXMI(), maybeSignalObjectCreated(), operator==(), save(), and setBaseType().

Uml::Visibility UMLObject::m_Vis [protected]
 

The objects visibility.

Definition at line 432 of file umlobject.h.

Referenced by copyInto(), getVisibility(), init(), loadFromXMI(), save(), and setVisibility().

bool UMLObject::m_bAbstract [protected]
 

The state of whether the object is abstract or not.

Definition at line 437 of file umlobject.h.

Referenced by copyInto(), getAbstract(), init(), loadFromXMI(), save(), and setAbstract().

bool UMLObject::m_bStatic [protected]
 

This attribute holds whether the UMLObject has instance scope (false - the default) or classifier scope (true).

Definition at line 443 of file umlobject.h.

Referenced by copyInto(), getStatic(), init(), loadFromXMI(), save(), and setStatic().

bool UMLObject::m_bInPaste [protected]
 

Caller sets this true when in paste operation.

Definition at line 448 of file umlobject.h.

Referenced by init(), loadFromXMI(), and setInPaste().

bool UMLObject::m_bCreationWasSignalled [protected]
 

Auxiliary to maybeSignalObjectCreated().

Definition at line 453 of file umlobject.h.

Referenced by init(), and maybeSignalObjectCreated().

UMLObject* UMLObject::m_pSecondary [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.

Definition at line 461 of file umlobject.h.

Referenced by UMLEntityAttribute::copyInto(), UMLAttribute::copyInto(), init(), UMLTemplate::operator==(), UMLEntityAttribute::operator==(), UMLAttribute::operator==(), and resolveRef().

QString UMLObject::m_SecondaryId [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.

Definition at line 468 of file umlobject.h.

Referenced by UMLEntityAttribute::copyInto(), UMLAttribute::copyInto(), getSecondaryId(), loadFromXMI(), resolveRef(), and setSecondaryId().

QString UMLObject::m_SecondaryFallback [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.

Definition at line 478 of file umlobject.h.

Referenced by getSecondaryFallback(), resolveRef(), and setSecondaryFallback().


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