• Skip to content
  • Skip to link menu
KDE 4.4 API Reference
  • KDE API Reference
  • kdesdk
  • Sitemap
  • Contact Us
 

umbrello/umbrello

UMLCanvasObject Class Reference

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

#include <umlcanvasobject.h>

Inheritance diagram for UMLCanvasObject:
Inheritance graph
[legend]

List of all members.

Signals

void sigAssociationEndAdded (UMLAssociation *assoc)
void sigAssociationEndRemoved (UMLAssociation *assoc)

Public Member Functions

 UMLCanvasObject (const QString &name=QString(), Uml::IDType id=Uml::id_None)
virtual ~UMLCanvasObject ()
bool addAssociationEnd (UMLAssociation *assoc)
int associations ()
virtual void copyInto (UMLObject *lhs) const
virtual UMLObject * findChildObject (const QString &n, Uml::Object_Type t=Uml::ot_UMLObject)
virtual UMLObject * findChildObjectById (Uml::IDType id, bool considerAncestors=false)
UMLAssociationList getAggregations ()
UMLAssociationList getAssociations ()
UMLAssociationList getCompositions ()
virtual UMLAssociationList getRealizations ()
UMLAssociationList getRelationships ()
UMLAssociationList getSpecificAssocs (Uml::Association_Type assocType)
UMLClassifierList getSubClasses ()
UMLClassifierList getSuperClasses ()
bool hasAssociation (UMLAssociation *assoc)
bool operator== (const UMLCanvasObject &rhs)
void removeAllAssociationEnds ()
virtual void removeAllChildObjects ()
int removeAssociationEnd (UMLAssociation *assoc)
virtual bool resolveRef ()
UMLObjectList subordinates () const
virtual QString uniqChildName (const Uml::Object_Type type, const QString &prefix=QString())

Protected Attributes

UMLObjectList m_List

Detailed Description

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

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.

Non-graphical information for a UMLCanvasObject.

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

Definition at line 33 of file umlcanvasobject.h.


Constructor & Destructor Documentation

UMLCanvasObject::UMLCanvasObject ( const QString &  name = QString(),
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 35 of file umlcanvasobject.cpp.

UMLCanvasObject::~UMLCanvasObject (  )  [virtual]

Standard deconstructor.

Definition at line 43 of file umlcanvasobject.cpp.


Member Function Documentation

bool UMLCanvasObject::addAssociationEnd ( UMLAssociation *  assoc  ) 

Adds an association end to m_List.

Parameters:
assoc The association to add.
Todo:
change param type to UMLRole

Definition at line 81 of file umlcanvasobject.cpp.

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 317 of file umlcanvasobject.cpp.

void UMLCanvasObject::copyInto ( UMLObject *  lhs  )  const [virtual]

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

Reimplemented in UMLCategory, UMLClassifier, UMLEntity, UMLEnum, and UMLPackage.

Definition at line 301 of file umlcanvasobject.cpp.

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 238 of file umlcanvasobject.cpp.

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

Find an association.

Parameters:
id The id of the object to find.
considerAncestors boolean switch to consider ancestors while searching
Returns:
Pointer to the object found (NULL if not found.)

Reimplemented in UMLClassifier.

Definition at line 264 of file umlcanvasobject.cpp.

UMLAssociationList UMLCanvasObject::getAggregations (  ) 

Shorthand for getSpecificAssocs(Uml::at_Aggregation).

Returns:
The list of aggregations for the Concept.

Definition at line 419 of file umlcanvasobject.cpp.

UMLAssociationList UMLCanvasObject::getAssociations (  ) 

Return the list of associations for the CanvasObject.

Returns:
The list of associations for the CanvasObject.

Definition at line 335 of file umlcanvasobject.cpp.

UMLAssociationList UMLCanvasObject::getCompositions (  ) 

Shorthand for getSpecificAssocs(Uml::at_Composition).

Returns:
The list of compositions for the Concept.

Definition at line 429 of file umlcanvasobject.cpp.

UMLAssociationList UMLCanvasObject::getRealizations (  )  [virtual]

Shorthand for getSpecificAssocs(Uml::at_Realization).

Returns:
The list of realizations for the Concept.

Definition at line 409 of file umlcanvasobject.cpp.

UMLAssociationList UMLCanvasObject::getRelationships (  ) 

Shorthand for getSpecificAssocs(Uml::at_Relationship).

Returns:
The list of relationships for the entity.

Definition at line 439 of file umlcanvasobject.cpp.

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 59 of file umlcanvasobject.cpp.

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 384 of file umlcanvasobject.cpp.

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 357 of file umlcanvasobject.cpp.

bool UMLCanvasObject::hasAssociation ( UMLAssociation *  assoc  ) 

Determine if this canvasobject has the given association.

Parameters:
assoc The association to check.

Definition at line 102 of file umlcanvasobject.cpp.

bool UMLCanvasObject::operator== ( const UMLCanvasObject &  rhs  ) 

Overloaded '==' operator.

Reimplemented from UMLObject.

Reimplemented in UMLClassifier, UMLEntity, and UMLEnum.

Definition at line 280 of file umlcanvasobject.cpp.

void UMLCanvasObject::removeAllAssociationEnds (  ) 

Remove all association ends from the CanvasObject.

Definition at line 130 of file umlcanvasobject.cpp.

void UMLCanvasObject::removeAllChildObjects (  )  [virtual]

Remove all child objects.

Just clear list, objects must be deleted where they were created (or we have bad crashes).

Definition at line 164 of file umlcanvasobject.cpp.

int UMLCanvasObject::removeAssociationEnd ( UMLAssociation *  assoc  ) 

Remove an association end from the CanvasObject.

Parameters:
assoc The association to remove.
Todo:
change param type to UMLRole

Definition at line 116 of file umlcanvasobject.cpp.

bool UMLCanvasObject::resolveRef (  )  [virtual]

Reimplementation of UMLObject method.

Reimplemented from UMLObject.

Reimplemented in UMLClassifier, UMLEntity, and UMLPackage.

Definition at line 447 of file umlcanvasobject.cpp.

void UMLCanvasObject::sigAssociationEndAdded ( UMLAssociation *  assoc  )  [signal]
void UMLCanvasObject::sigAssociationEndRemoved ( UMLAssociation *  assoc  )  [signal]
UMLObjectList UMLCanvasObject::subordinates (  )  const [inline]

Definition at line 80 of file umlcanvasobject.h.

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 183 of file umlcanvasobject.cpp.


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.

Todo:
Only a pointer to the appropriate assocation end object (UMLRole) should be saved here, not the entire UMLAssociation.

Definition at line 99 of file umlcanvasobject.h.


The documentation for this class was generated from the following files:
  • umlcanvasobject.h
  • umlcanvasobject.cpp

umbrello/umbrello

Skip menu "umbrello/umbrello"
  • Main Page
  • Modules
  • Namespace List
  • Class Hierarchy
  • Alphabetical List
  • Class List
  • File List
  • Namespace Members
  • Class Members
  • Related Pages

kdesdk

Skip menu "kdesdk"
  • kapptemplate
  • kate
  •     kate
  • kbugbuster
  • kcachegrind
  • kompare
  • lokalize
  • umbrello
  •   umbrello
Generated for kdesdk by doxygen 1.5.9-20090814
This website is maintained by Adriaan de Groot and Allen Winter.
KDE® and the K Desktop Environment® logo are registered trademarks of KDE e.V. | Legal