Version: 1.1.1 (using KDE KDE 3.1) Installed from: Mandrake RPMs OS: Linux I haven't been able of creating associative classes using Umbrello 1.1., i don't know if it is intended or maybe you can do them but i have not found the way. Associative classes are a must (i think)
This would be quite difficult to do with the current association code, but not impossible.
That's "association class", I think. Just so we all know what we're talking about, see the UML standard 03-03-01, sect 3.42.2.2 "a class symbol attached to the association path by a dashed line."; for example see sect 3.42.6.
Well, then my fault, in Spanish we say "Clase asociativa" that translated into English is associative class. But i meant what you describe, so what i want is the possiblility of creating "association class".
Named "Association class" or "associative class", it's an inportant element; i'm teaching uml to my students and we can't make this class of elements, wich are really common.
*** Bug 95727 has been marked as a duplicate of this bug. ***
I use the Shlaer-Mellor method and the associative class is very important item in modelling a system. I don't know if it is hard to implement in Umbrello, owing to the fact that a dotted line has to connect to a solid association.
SVN commit 410203 by okellogg: Implement main functionality of association class. Still missing: XMI I/O. CCBUG:57588 M +133 -20 trunk/KDE/kdesdk/umbrello/umbrello/associationwidget.cpp M +13 -4 trunk/KDE/kdesdk/umbrello/umbrello/associationwidget.h M +10 -0 trunk/KDE/kdesdk/umbrello/umbrello/class.h M +60 -40 trunk/KDE/kdesdk/umbrello/umbrello/classwidget.cpp M +14 -0 trunk/KDE/kdesdk/umbrello/umbrello/classwidget.h M +7 -0 trunk/KDE/kdesdk/umbrello/umbrello/umlwidget.cpp
SVN commit 410943 by okellogg: Implement XMI I/O for the association class connecting line. NB we don't yet create the XMI standard <UML:AssociationClass> BUG:57588 M +4 -3 trunk/KDE/kdesdk/umbrello/ChangeLog M +38 -8 trunk/KDE/kdesdk/umbrello/umbrello/associationwidget.cpp M +5 -0 trunk/KDE/kdesdk/umbrello/umbrello/associationwidget.h --- trunk/KDE/kdesdk/umbrello/ChangeLog #410942:410943 @@ -1,9 +1,10 @@ Version 1.5 +* Association classes * Externalization of folders (i.e. submodel files) * Bugs fixed / wishes implemented (see http://bugs.kde.org) -87252 +57588 87252 Version 1.4.1 (maintenance release) @@ -11,8 +12,8 @@ * Crash on deleting attributes / enum literals * Crash in UMLView::createAutoAttributeAssociations() * Bugs from http://bugs.kde.org : -53376 57667 57875 80924 89691 95353 100290 100307 101148 103123 -103133 103728 101541 + 53376 57667 57875 70924 80924 89691 95353 100290 100307 101148 +103123 103133 103728 101541 Version 1.4 --- trunk/KDE/kdesdk/umbrello/umbrello/associationwidget.cpp #410942:410943 @@ -629,8 +629,11 @@ } } - // CHECK - // m_LinePath.setAssocType( getAssocType() ); + // Prepare the association class line if needed. + if (m_pAssocClassWidget && !m_pAssocClassLine) { + createAssocClassLine(); + } + if(status) { m_bActivated = true; } @@ -2034,6 +2037,15 @@ } } +void AssociationWidget::createAssocClassLine() { + if (m_pAssocClassLine == NULL) + m_pAssocClassLine = new QCanvasLine(m_pView->canvas()); + computeAssocClassLine(); + QPen pen(m_pView->getLineColor(), m_pView->getLineWidth(), DashLine); + m_pAssocClassLine->setPen(pen); + m_pAssocClassLine->setVisible(true); +} + void AssociationWidget::computeAssocClassLine() { if (m_pAssocClassWidget == NULL || m_pAssocClassLine == NULL) return; @@ -2118,12 +2130,7 @@ return; m_pAssocClassWidget = static_cast<ClassWidget*>(otherWidget); m_pAssocClassWidget->setClassAssocWidget(this); - if (m_pAssocClassLine == NULL) - m_pAssocClassLine = new QCanvasLine(m_pView->canvas()); - computeAssocClassLine(); - QPen pen(m_pView->getLineColor(), m_pView->getLineWidth(), DashLine); - m_pAssocClassLine->setPen(pen); - m_pAssocClassLine->setVisible(true); + createAssocClassLine(); return; } // right button action: @@ -3150,6 +3157,12 @@ if( m_role[B].m_pChangeWidget ) m_role[B].m_pChangeWidget -> saveToXMI( qDoc, assocElement ); + if (m_pAssocClassWidget) { + QString acid = ID2STR(m_pAssocClassWidget->getID()); + assocElement.setAttribute("assocclass", acid); + assocElement.setAttribute("aclsegindex", m_nLinePathSegmentIndex); + } + qElement.appendChild( assocElement ); } @@ -3292,6 +3305,23 @@ m_role[A].m_nTotalCount = totalcounta.toInt(); m_role[B].m_nTotalCount = totalcountb.toInt(); + QString assocclassid = qElement.attribute("assocclass", ""); + if (! assocclassid.isEmpty()) { + Uml::IDType acid = STR2ID(assocclassid); + UMLWidget *w = Umbrello::findWidget(acid, widgets); + if (w) { + m_pAssocClassWidget = static_cast<ClassWidget*>(w); + m_pAssocClassWidget->setClassAssocWidget(this); + // Preparation of the assoc class line is done in activate() + QString aclsegindex = qElement.attribute("aclsegindex", "0"); + m_nLinePathSegmentIndex = aclsegindex.toInt(); + } else { + kdError() << "AssociationWidget::loadFromXMI: " + << "cannot find assocclass " << assocclassid + << endl; + } + } + //now load child elements QDomNode node = qElement.firstChild(); QDomElement element = node.toElement(); --- trunk/KDE/kdesdk/umbrello/umbrello/associationwidget.h #410942:410943 @@ -363,6 +363,11 @@ bool onAssocClassLine(const QPoint & point); /** + * Creates the association class connecting line. + */ + void createAssocClassLine(); + + /** * Renders the association class connecting line selected. */ void selectAssocClassLine(bool sel = true);
*** Bug 151661 has been marked as a duplicate of this bug. ***