umbrello API Documentation

UMLCanvasObject Class Reference

This class contains the non-graphical information required for UMLObjects which appear as moveable widgets on the canvas. Non-graphical information for a UMLCanvasObject. More...

#include <umlcanvasobject.h>

Inheritance diagram for UMLCanvasObject:

UMLObject UMLActor UMLArtifact UMLNode UMLPackage UMLUseCase UMLClassifier UMLComponent UMLFolder UMLEntity UMLEnum List of all members.

Signals

void sigAssociationEndAdded (UMLAssociation *assoc)
 Emit when new association is added.
void sigAssociationEndRemoved (UMLAssociation *assoc)
 Emit when new association is removed.

Public Member Functions

 UMLCanvasObject (const QString &name="", Uml::IDType id=Uml::id_None)
 Sets up a UMLCanvasObject.
virtual ~UMLCanvasObject ()
 Standard deconstructor.
virtual bool operator== (UMLCanvasObject &rhs)
 Overloaded '==' operator.
virtual void copyInto (UMLCanvasObject *rhs) const
 Copy the internal presentation of this object into the new object.
bool addAssociationEnd (UMLAssociation *assoc)
 Adds an association end to m_List.
bool hasAssociation (UMLAssociation *assoc)
 Determine if this canvasobject has the given association.
int removeAssociationEnd (UMLAssociation *assoc)
 Remove an association end from the CanvasObject.
void removeAllAssociationEnds ()
 Remove all association ends from the CanvasObject.
int associations ()
 Returns the number of associations for the CanvasObject.
UMLAssociationList getAssociations ()
 Return the list of associations for the CanvasObject.
UMLAssociationList getSpecificAssocs (Uml::Association_Type assocType)
 Return the subset of m_List that matches the given type.
UMLClassifierList getSuperClasses ()
 Return a list of the superclasses of this concept.
UMLClassifierList getSubClasses ()
 Return a list of the classes that inherit from this concept.
virtual UMLAssociationList getRealizations ()
 Shorthand for getSpecificAssocs(Uml::at_Realization).
UMLAssociationList getAggregations ()
 Shorthand for getSpecificAssocs(Uml::at_Aggregation).
UMLAssociationList getCompositions ()
 Shorthand for getSpecificAssocs(Uml::at_Composition).
UMLAssociationList getRelationships ()
 Shorthand for getSpecificAssocs(Uml::at_Relationship).
virtual UMLObjectfindChildObject (const QString &n, Uml::Object_Type t=Uml::ot_UMLObject)
 Find a child object with the given name.
virtual UMLObjectfindChildObjectById (Uml::IDType id, bool considerAncestors=false)
 Find an association.
virtual QString uniqChildName (const Uml::Object_Type type, const QString &prefix=QString())
 Returns a name for the new association, operation, template or attribute appended with a number if the default name is taken e.g.
virtual void removeAllChildObjects ()
UMLObjectList subordinates () const
 Return the list of subordinate items.
virtual bool resolveRef ()
 Reimplementation of UMLObject method.

Protected Attributes

UMLObjectList m_List
 List of all the associations in this object.

Detailed Description

This class contains the non-graphical information required for UMLObjects which appear as moveable widgets on the canvas. Non-graphical information for a UMLCanvasObject.

This class inherits from UMLObject which contains most of the information. It is not instantiated itself, it's just used as a super class for actual model objects.

Author:
Jonathan Riddell
See also:
UMLObject Bugs and comments to uml-devel@lists.sf.net or http://bugs.kde.org

Definition at line 37 of file umlcanvasobject.h.


Constructor & Destructor Documentation

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

Sets up a UMLCanvasObject.

Parameters:
name The name of the Concept.
id The unique id of the Concept.

Definition at line 30 of file umlcanvasobject.cpp.

References UMLObject::init().

UMLCanvasObject::~UMLCanvasObject  )  [virtual]
 

Standard deconstructor.

Definition at line 36 of file umlcanvasobject.cpp.

References associations().


Member Function Documentation

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

Overloaded '==' operator.

Definition at line 206 of file umlcanvasobject.cpp.

References m_List.

Referenced by UMLClassifier::operator==().

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

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

Definition at line 222 of file umlcanvasobject.cpp.

References UMLObject::copyInto().

Referenced by UMLPackage::copyInto(), and UMLClassifier::copyInto().

bool UMLCanvasObject::addAssociationEnd UMLAssociation assoc  ) 
 

Adds an association end to m_List.

Parameters:
assoc The association to add.

Definition at line 68 of file umlcanvasobject.cpp.

References UMLObject::emitModified(), hasAssociation(), m_List, and sigAssociationEndAdded().

Referenced by UMLPackage::addAssocToConcepts().

bool UMLCanvasObject::hasAssociation UMLAssociation assoc  ) 
 

Determine if this canvasobject has the given association.

Parameters:
assoc The association to check.

Definition at line 82 of file umlcanvasobject.cpp.

References m_List.

Referenced by addAssociationEnd(), UMLPackage::addAssocToConcepts(), UMLPackage::removeAssocFromConcepts(), and removeAssociationEnd().

int UMLCanvasObject::removeAssociationEnd UMLAssociation assoc  ) 
 

Remove an association end from the CanvasObject.

Parameters:
assoc The association to remove.

Definition at line 88 of file umlcanvasobject.cpp.

References UMLObject::emitModified(), hasAssociation(), m_List, and sigAssociationEndRemoved().

Referenced by removeAllAssociationEnds(), and UMLPackage::removeAssocFromConcepts().

void UMLCanvasObject::removeAllAssociationEnds  ) 
 

Remove all association ends from the CanvasObject.

Definition at line 99 of file umlcanvasobject.cpp.

References UMLObject::getBaseType(), UMLObject::getName(), UMLAssociation::getObject(), m_List, and removeAssociationEnd().

int UMLCanvasObject::associations  ) 
 

Returns the number of associations for the CanvasObject.

This is the sum of the aggregations and compositions.

Returns:
The number of associations for the Concept.

Definition at line 232 of file umlcanvasobject.cpp.

References UMLObject::getBaseType(), and m_List.

Referenced by ~UMLCanvasObject().

UMLAssociationList UMLCanvasObject::getAssociations  ) 
 

Return the list of associations for the CanvasObject.

Returns:
The list of associations for the CanvasObject.

Definition at line 242 of file umlcanvasobject.cpp.

References UMLObject::getBaseType(), and m_List.

Referenced by UMLView::createAutoAssociations(), UMLDoc::getAssociations(), getSubClasses(), getSuperClasses(), and IDLWriter::writeClass().

UMLAssociationList UMLCanvasObject::getSpecificAssocs Uml::Association_Type  assocType  ) 
 

Return the subset of m_List that matches the given type.

Parameters:
assocType The Association_Type to match.
Returns:
The list of associations that match assocType.

Definition at line 55 of file umlcanvasobject.cpp.

References UMLAssociation::getAssocType(), UMLObject::getBaseType(), and m_List.

Referenced by getAggregations(), getCompositions(), getRealizations(), getRelationships(), UMLClassifier::getUniAssociationToBeImplemented(), ClassifierCodeDocument::initCodeClassFields(), and UMLClassifier::saveToXMI().

UMLClassifierList UMLCanvasObject::getSuperClasses  ) 
 

Return a list of the superclasses of this concept.

TODO: This overlaps with UMLClassifier::findSuperClassConcepts(), see if we can merge the two.

Returns:
The list of superclasses for the concept.

Definition at line 254 of file umlcanvasobject.cpp.

References getAssociations(), and UMLObject::getID().

Referenced by UMLClassifier::findSuperClassConcepts(), and IDLWriter::writeClass().

UMLClassifierList UMLCanvasObject::getSubClasses  ) 
 

Return a list of the classes that inherit from this concept.

TODO: This overlaps with UMLClassifier::findSubClassConcepts(), see if we can merge the two.

Returns:
The list of classes inheriting from the concept.

Definition at line 274 of file umlcanvasobject.cpp.

References getAssociations(), and UMLObject::getID().

Referenced by UMLClassifier::findSubClassConcepts().

UMLAssociationList UMLCanvasObject::getRealizations  )  [virtual]
 

Shorthand for getSpecificAssocs(Uml::at_Realization).

Returns:
The list of realizations for the Concept.

Definition at line 293 of file umlcanvasobject.cpp.

References getSpecificAssocs().

Referenced by UMLClassifier::findSubClassConcepts(), UMLClassifier::findSuperClassConcepts(), and CSharpWriter::writeClass().

UMLAssociationList UMLCanvasObject::getAggregations  ) 
 

Shorthand for getSpecificAssocs(Uml::at_Aggregation).

Returns:
The list of aggregations for the Concept.

Definition at line 297 of file umlcanvasobject.cpp.

References getSpecificAssocs().

Referenced by ClassifierCodeDocument::initCodeClassFields().

UMLAssociationList UMLCanvasObject::getCompositions  ) 
 

Shorthand for getSpecificAssocs(Uml::at_Composition).

Returns:
The list of compositions for the Concept.

Definition at line 301 of file umlcanvasobject.cpp.

References getSpecificAssocs().

Referenced by ClassifierCodeDocument::initCodeClassFields().

UMLAssociationList UMLCanvasObject::getRelationships  ) 
 

Shorthand for getSpecificAssocs(Uml::at_Relationship).

Returns:
The list of relationships for the entity.

Definition at line 305 of file umlcanvasobject.cpp.

References getSpecificAssocs().

UMLObject * UMLCanvasObject::findChildObject const QString &  n,
Uml::Object_Type  t = Uml::ot_UMLObject
[virtual]
 

Find a child object with the given name.

Parameters:
n The name of the object to find.
t The type to find (optional.) If not given then any object type will match.
Returns:
Pointer to the object found; NULL if none found.

Definition at line 177 of file umlcanvasobject.cpp.

References UMLApp::activeLanguageIsCaseSensitive(), UMLObject::getBaseType(), UMLObject::getName(), and m_List.

Referenced by UMLClassifier::addAttribute(), UMLEntity::addEntityAttribute(), UMLEnum::addEnumLiteral(), UMLClassifier::addTemplate(), UMLTemplateDialog::apply(), UMLEntityAttributeDialog::apply(), UMLAttributeDialog::apply(), UMLEntity::createAttribute(), UMLClassifier::createAttribute(), UMLClassifier::createTemplate(), UMLListView::isUnique(), UMLListViewItem::okRename(), UMLDoc::renameChildUMLObject(), and uniqChildName().

UMLObject * UMLCanvasObject::findChildObjectById Uml::IDType  id,
bool  considerAncestors = false
[virtual]
 

Find an association.

Parameters:
id The id of the object to find.
Returns:
Pointer to the object found (NULL if not found.)

Reimplemented in UMLClassifier.

Definition at line 193 of file umlcanvasobject.cpp.

References UMLObject::getID(), and m_List.

Referenced by UMLClassifier::findChildObjectById().

QString UMLCanvasObject::uniqChildName const Uml::Object_Type  type,
const QString &  prefix = QString()
[virtual]
 

Returns a name for the new association, operation, template or attribute appended with a number if the default name is taken e.g.

new_association, new_association_1 etc.

Parameters:
type The object type for which to make a name.
prefix Optional prefix to use for the name. If not given then uniqChildName() will choose the prefix internally based on the object type.
Returns:
Unique name string for the Object_Type given.

Definition at line 141 of file umlcanvasobject.cpp.

References findChildObject().

Referenced by UMLListView::addNewItem(), UMLEntity::createAttribute(), UMLClassifier::createAttribute(), UMLEnum::createEnumLiteral(), UMLClassifier::createOperation(), and UMLClassifier::createTemplate().

UMLObjectList UMLCanvasObject::subordinates  )  const [inline]
 

Return the list of subordinate items.

Definition at line 201 of file umlcanvasobject.h.

References m_List.

bool UMLCanvasObject::resolveRef  )  [virtual]
 

Reimplementation of UMLObject method.

Reimplemented from UMLObject.

Reimplemented in UMLClassifier, UMLEntity, and UMLPackage.

Definition at line 309 of file umlcanvasobject.cpp.

References m_List, and UMLObject::resolveRef().

Referenced by UMLPackage::resolveRef().

void UMLCanvasObject::sigAssociationEndAdded UMLAssociation assoc  )  [signal]
 

Emit when new association is added.

Parameters:
assoc Pointer to the association which has been added.

Referenced by addAssociationEnd().

void UMLCanvasObject::sigAssociationEndRemoved UMLAssociation assoc  )  [signal]
 

Emit when new association is removed.

Parameters:
assoc Pointer to the association which has been removed.

Referenced by removeAssociationEnd().


Member Data Documentation

UMLObjectList UMLCanvasObject::m_List [protected]
 

List of all the associations in this object.

Inheriting classes add more types of objects that are possible in this list; for example, UMLClassifier adds operations, attributes, and templates.

Definition at line 224 of file umlcanvasobject.h.

Referenced by addAssociationEnd(), associations(), findChildObject(), findChildObjectById(), getAssociations(), getSpecificAssocs(), hasAssociation(), operator==(), removeAllAssociationEnds(), removeAssociationEnd(), resolveRef(), and subordinates().


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:06 2007 by doxygen 1.4.1 written by Dimitri van Heesch, © 1997-2003