[Uml-devel] branches/KDE/3.5/kdesdk/umbrello/umbrello
Oliver Kellogg
okellogg at users.sourceforge.net
Sun Jan 29 09:59:01 UTC 2006
SVN commit 503618 by okellogg:
Thanks Achim for your PatchSynchronousMessageResize.diff at
http://www.geeksoc.org/~jr/umbrello/uml-devel/9171.html
which I apply here after slight modification.
M +11 -4 messagewidget.cpp
M +6 -0 messagewidget.h
--- branches/KDE/3.5/kdesdk/umbrello/umbrello/messagewidget.cpp #503617:503618
@@ -41,8 +41,7 @@
y -= m_pOw[Uml::B]->getHeight() / 2;
m_pOw[Uml::B]->setY(y);
}
- UMLWidget::m_bResizable = (m_pOw[Uml::A] == m_pOw[Uml::B]);
-
+ updateResizability();
calculateWidget();
y = y < getMinHeight() ? getMinHeight() : y;
y = y > getMaxHeight() ? getMaxHeight() : y;
@@ -71,6 +70,14 @@
MessageWidget::~MessageWidget() {
}
+void MessageWidget::updateResizability() {
+ if (m_sequenceMessageType == Uml::sequence_message_synchronous ||
+ m_pOw[Uml::A] == m_pOw[Uml::B])
+ UMLWidget::m_bResizable = true;
+ else
+ UMLWidget::m_bResizable = false;
+}
+
void MessageWidget::draw(QPainter& p, int offsetX, int offsetY) {
if(!m_pOw[Uml::A] || !m_pOw[Uml::B]) {
return;
@@ -737,7 +744,7 @@
void MessageWidget::setWidget(ObjectWidget * ow, Uml::Role_Type role) {
m_pOw[role] = ow;
- UMLWidget::m_bResizable = (m_pOw[Uml::A] == m_pOw[Uml::B]);
+ updateResizability();
}
ObjectWidget* MessageWidget::getWidget(Uml::Role_Type role) {
@@ -805,7 +812,7 @@
<< ID2STR(bId) << " is not an ObjectWidget" << endl;
return false;
}
- UMLWidget::m_bResizable = (m_pOw[Uml::A] == m_pOw[Uml::B]);
+ updateResizability();
UMLClassifier *c = dynamic_cast<UMLClassifier*>( pWB->getUMLObject() );
if (c) {
--- branches/KDE/3.5/kdesdk/umbrello/umbrello/messagewidget.h #503617:503618
@@ -363,6 +363,12 @@
*/
static void drawSolidArrowhead(QPainter& p, int x, int y, Qt::ArrowType direction);
+ /**
+ * Update the UMLWidget::m_bResizable flag according to the
+ * charactersitics of this message.
+ */
+ void updateResizability();
+
// Data loaded/saved
QString m_SequenceNumber;
QString m_CustomOp;
More information about the umbrello-devel
mailing list