[Uml-devel] kdesdk/umbrello/umbrello
Luis De la Parra Blum
lparrab at gmx.net
Wed Mar 12 15:57:08 UTC 2003
CVS commit by luis:
Added UMLDoc::createAssociation( )
if the other UMLObjects are created / destroyed by the document, so should
the associations.
M +11 -1 umldoc.cpp 1.27
M +10 -0 umldoc.h 1.13
--- kdesdk/umbrello/umbrello/umldoc.h #1.12:1.13
@@ -208,4 +208,14 @@ public:
UMLObject* createOperation(UMLObject* o);
+ /**
+ * Creates an association between two UMLObjects.
+ * NOTE: this method does not check if the association is valid / legal
+ *
+ * @param a The UMLObject "A" for the association (source)
+ * @param b The UMLObject "B" for the association (destination)
+ * @param type The association's type
+ * @return The Association created
+ */
+ UMLAssociation* createUMLAssociation(UMLObject *a, UMLObject *b, Uml::Association_Type type);
/**
* Adds an existing association to the matching concept in the list of concepts.
--- kdesdk/umbrello/umbrello/umldoc.cpp #1.26:1.27
@@ -53,5 +53,6 @@ static const uint undoMax = 30;
//#include "diagram/diagram.h"
-using namespace Umbrello;
+using Umbrello::Diagram;
+using Umbrello::DiagramView;
@@ -743,4 +744,13 @@ void UMLDoc::removeAssocFromConcepts(UML
}
+UMLAssociation* UMLDoc::createUMLAssociation(UMLObject *a, UMLObject *b, Uml::Association_Type type)
+{
+ UMLAssociation *assoc = new UMLAssociation( this );
+ assoc->setAssocType(type);
+ assoc->setObjectA(a);
+ assoc->setObjectB(b);
+ addAssociation(assoc);
+ return assoc;
+}
////////////////////////////////////////////////////////////////////////////////////////////////////
void UMLDoc::addAssociation(UMLAssociation *Assoc)
More information about the umbrello-devel
mailing list