[Uml-devel] branches/KDE/3.5/kdesdk/umbrello
Daniel Calviño Sánchez
danxuliu at gmail.com
Sat Sep 30 15:26:30 UTC 2006
SVN commit 590644 by danxuliu:
Fix for class association not updating the association position when being moved.
M +2 -0 ChangeLog
M +11 -1 umbrello/classifierwidget.cpp
M +12 -0 umbrello/classifierwidget.h
M +1 -1 umbrello/umlwidget.h
M +0 -10 umbrello/umlwidgetcontroller.cpp
--- branches/KDE/3.5/kdesdk/umbrello/ChangeLog #590643:590644
@@ -4,6 +4,8 @@
* Fix load of associations in collaboration diagram (A. Spangler)
* Fix for single selection of an unselected widget when other widgets are selected
* Fixes for several bugs in toolbar states
+* Fix for message widget selection
+* Fix for class association not updating the association position when being moved
* Bugs/wishes from http://bugs.kde.org:
* "role A properties" should give class name (69244)
* Sharing designs, Folders, 3rd Party imports (87252, reimplementation)
--- branches/KDE/3.5/kdesdk/umbrello/umbrello/classifierwidget.cpp #590643:590644
@@ -70,8 +70,8 @@
m_bShowAttributes = ops.classState.showAtts;
m_bShowStereotype = ops.classState.showStereoType;
m_bDrawAsCircle = false;
+ m_pAssocWidget = NULL;
setShowAttSigs( ops.classState.showAttSig );
- m_pAssocWidget = NULL;
}
void ClassifierWidget::updateSigs() {
@@ -744,6 +744,16 @@
update();
}
+void ClassifierWidget::adjustAssocs(int x, int y) {
+ UMLWidget::adjustAssocs(x, y);
+
+ if (m_pDoc->loading() || m_pAssocWidget == 0) {
+ return;
+ }
+
+ m_pAssocWidget->computeAssocClassLine();
+}
+
void ClassifierWidget::saveToXMI(QDomDocument & qDoc, QDomElement & qElement) {
QDomElement conceptElement;
UMLClassifier *umlc = getClassifier();
--- branches/KDE/3.5/kdesdk/umbrello/umbrello/classifierwidget.h #590643:590644
@@ -270,6 +270,18 @@
void draw(QPainter & p, int offsetX, int offsetY);
/**
+ * Extends base method to adjust also the association of a class
+ * association.
+ * Executes the base method and then, if file isn't loading and the
+ * classifier acts as a class association, the association position is
+ * updated.
+ *
+ * @param x The x-coordinate.
+ * @param y The y-coordinate.
+ */
+ virtual void adjustAssocs(int x, int y);
+
+ /**
* Creates the <classwidget> or <interfacewidget >XML element.
*/
void saveToXMI(QDomDocument & qDoc, QDomElement & qElement);
--- branches/KDE/3.5/kdesdk/umbrello/umbrello/umlwidget.h #590643:590644
@@ -461,7 +461,7 @@
* @param x The x-coordinate.
* @param y The y-coordinate.
*/
- void adjustAssocs(int x, int y);
+ virtual void adjustAssocs(int x, int y);
/**
* Adjusts all unselected associations with the given co-ordinates
--- branches/KDE/3.5/kdesdk/umbrello/umbrello/umlwidgetcontroller.cpp #590643:590644
@@ -166,16 +166,6 @@
if (update) {
widget->adjustAssocs(widget->getX(), widget->getY());
-
- //TODO check if this is needed. What it does?
- //If needed, create an empty virtual method executed at this place
- //and override it in ClassifierWidgetController
-/* if (widget->m_Type == Uml::wt_Class) {
- ClassifierWidget *cw = static_cast<ClassifierWidget*>(widget);
- AssociationWidget *clAssocW = cw->getClassAssocWidget();
- if (clAssocW)
- clAssocW->computeAssocClassLine();
- }*/
}
}
m_widget->m_pView->resizeCanvasToItems();
More information about the umbrello-devel
mailing list