umbrello/umbrello
messagewidget.cpp
Go to the documentation of this file.
289 void MessageWidget::paint(QPainter *painter, const QStyleOptionGraphicsItem *option, QWidget *widget)
405 paintArrow(painter, offsetX, offsetY + h - arrowWidth + 1, w - wr + 1, Qt::LeftArrow, true); // return arrow
416 painter->drawLine(offsetX + wr + 1, offsetY + arrowWidth, offsetX + w, offsetY + arrowWidth); //arrow line
419 paintArrow(painter, offsetX + wr + 1, offsetY + h - arrowWidth + 1, w - wr - 1, Qt::RightArrow, true); // return arrow
428 void MessageWidget::paintAsynchronous(QPainter *painter, const QStyleOptionGraphicsItem *option)
675 void MessageWidget::constrainTextPos(qreal &textX, qreal &textY, qreal textWidth, qreal textHeight,
720 DEBUG(DBG_SRC) << "id=" << Uml::ID::toString(id) << ": ignoring for idA=" << Uml::ID::toString(idA)
841 connect(m_pOw[Uml::RoleType::A], SIGNAL(sigWidgetMoved(Uml::ID::Type)), this, SLOT(slotWidgetMoved(Uml::ID::Type)));
842 connect(m_pOw[Uml::RoleType::B], SIGNAL(sigWidgetMoved(Uml::ID::Type)), this, SLOT(slotWidgetMoved(Uml::ID::Type)));
1173 disconnect(this, SIGNAL(sigMessageMoved()), m_pOw[Uml::RoleType::A], SLOT(slotMessageMoved()));
1177 disconnect(this, SIGNAL(sigMessageMoved()), m_pOw[Uml::RoleType::B], SLOT(slotMessageMoved()));
1308 messageElement.setAttribute(QLatin1String("widgetaid"), Uml::ID::toString(m_pOw[Uml::RoleType::A]->localID()));
1309 messageElement.setAttribute(QLatin1String("widgetbid"), Uml::ID::toString(m_pOw[Uml::RoleType::B]->localID()));
1316 if (m_sequenceMessageType == Uml::SequenceMessage::Lost || m_sequenceMessageType == Uml::SequenceMessage::Found) {
1345 QString sequenceMessageType = qElement.attribute(QLatin1String("sequencemessagetype"), QLatin1String("1001"));
1347 if (m_sequenceMessageType == Uml::SequenceMessage::Lost || m_sequenceMessageType == Uml::SequenceMessage::Found) {
int getMaxY()
Returns the maximum height this widget should be set at on a sequence diagrams.
Definition: messagewidget.cpp:1233
void calculateDimensionsFound()
Calculates and sets the size of the widget for a found message.
Definition: messagewidget.cpp:1146
virtual void setOperationText(const QString &op)
Overrides operation from LinkWidget.
Definition: messagewidget.cpp:903
qreal x() const
qreal y() const
void calculateDimensionsSynchronous()
Calculates and sets the size of the widget for a synchronous message.
Definition: messagewidget.cpp:1028
void setStyle(Qt::PenStyle style)
Uml::SequenceMessage::Enum sequenceMessageType() const
Definition: messagewidget.h:80
bool isSelf() const
This method determines whether the message is for "Self" for an ObjectWidget.
Definition: messagewidget.cpp:759
This class defines the non-graphical information required for a UML Classifier (ie a class or interfa...
Definition: classifier.h:39
Uml::ID::Type findNewID(Uml::ID::Type OldID)
Returns the new assigned ID of the object that had OldID as its previous id.
Definition: idchangelog.cpp:62
virtual void setOperation(UMLOperation *op)
Implements operation from LinkWidget.
Definition: messagewidget.cpp:944
int selectedCount(bool filterText=false) const
Return the amount of widgets selected.
Definition: umlscene.cpp:1822
virtual QString lwOperationText()
Overrides operation from LinkWidget.
Definition: messagewidget.cpp:978
virtual UMLOperation * operation()
Implements operation from LinkWidget.
Definition: messagewidget.cpp:935
UMLObject * umlObject() const
Returns the UMLObject set to represent.
Definition: widgetbase.cpp:127
virtual void paint(QPainter *painter, const QStyleOptionGraphicsItem *option, QWidget *widget=0)
Draws the UMLWidget on the given paint device.
Definition: umlwidget.cpp:1636
void fillRect(const QRectF &rectangle, const QBrush &brush)
static void paintSolidArrowhead(QPainter *p, int x, int y, Qt::ArrowType direction)
Draw a solid (triangular) arrowhead pointing in the given direction.
Definition: messagewidget.cpp:317
void updateResizability()
Update the UMLWidget::m_resizable flag according to the charactersitics of this message.
Definition: messagewidget.cpp:171
QDomNode appendChild(const QDomNode &newChild)
Definition: basictypes.h:215
bool hasObjectWidget(ObjectWidget *w)
Check to see if the given ObjectWidget is involved in the message.
Definition: messagewidget.cpp:744
virtual UMLClassifier * operationOwner()
Overrides operation from LinkWidget.
Definition: messagewidget.cpp:922
ObjectWidget * objectWidget(Uml::RoleType::Enum role)
Returns the related widget on the given side.
Definition: messagewidget.cpp:1264
QString attribute(const QString &name, const QString &defValue) const
virtual void lwSetFont(QFont font)
Implements operation from LinkWidget.
Definition: messagewidget.cpp:912
Definition: basictypes.h:202
Uml::TextRole::Enum textRole() const
Return the role of the text widget.
Definition: floatingtextwidget.cpp:379
void paintLost(QPainter *painter, const QStyleOptionGraphicsItem *option)
Draws a solid arrow line and a stick arrow head and a circle.
Definition: messagewidget.cpp:514
This class contains all the ID translations done for each UMLObject pasted.
Definition: idchangelog.h:26
Definition: basictypes.h:216
Definition: basictypes.h:201
void paintFound(QPainter *painter, const QStyleOptionGraphicsItem *option)
Draws a circle and a solid arrow line and a stick arrow head.
Definition: messagewidget.cpp:552
virtual void setSelected(bool _select)
Sets the state of whether the widget is selected.
Definition: umlwidget.cpp:1321
void paintAsynchronous(QPainter *painter, const QStyleOptionGraphicsItem *option)
Draws a solid arrow line and a stick arrow head.
Definition: messagewidget.cpp:428
virtual void saveToXMI(QDomDocument &qDoc, QDomElement &qElement)
Save data to XMI.
Definition: linkwidget.cpp:116
void drawPolygon(const QPointF *points, int pointCount, Qt::FillRule fillRule)
bool m_ignoreSnapComponentSizeToGrid
Definition: umlwidget.h:309
void setLink(LinkWidget *l)
Set the LinkWidget that this FloatingTextWidget is related to.
Definition: floatingtextwidget.cpp:350
void drawLine(const QLineF &line)
virtual void saveToXMI(QDomDocument &qDoc, QDomElement &qElement)
Reimplemented from UMLWidget::saveToXMI to save the widget data into XMI 'floatingtext' element...
Definition: floatingtextwidget.cpp:710
UMLDoc * document() const
Returns a pointer to the current document connected to the KMainWindow instance.
Definition: uml.cpp:910
bool messageOverlap(qreal y, MessageWidget *messageWidget)
Returns whether a message is overlapping with another message.
Definition: objectwidget.cpp:614
bool disconnect(const QObject *sender, const char *signal, const QObject *receiver, const char *method)
void resolveObjectWidget(IDChangeLog *log)
Resolve references of this message so they reference the correct new object widgets after paste...
Definition: messagewidget.cpp:864
int getMinY()
Returns the minimum height this widget should be set at on a sequence diagrams.
Definition: messagewidget.cpp:1211
QString tr(const char *sourceText, const char *disambiguation, int n)
void setLinkAndTextPos()
Shortcut for calling m_pFText->setLink() followed by this->setTextPosition().
Definition: messagewidget.cpp:693
QString toString(Uml::SignatureType::Enum sig=Uml::SignatureType::NoSig)
Returns a string representation of the operation.
Definition: operation.cpp:199
virtual void slotMenuSelection(QAction *action)
This is usually called synchronously after menu.exec() and trigger's parent is always the ListPopupMe...
Definition: umlwidget.cpp:772
virtual void setCustomOpText(const QString &opText)
Overrides operation from LinkWidget.
Definition: messagewidget.cpp:968
void clear()
QDomElement toElement() const
Definition: basictypes.h:160
void drawRect(const QRectF &rectangle)
QColor color() const
Definition: basictypes.h:142
qreal x() const
qreal y() const
int constrainX(int textX, int textWidth, Uml::TextRole::Enum tr)
Returns the textX arg with constraints applied.
Definition: messagewidget.cpp:643
void calculateDimensionsAsynchronous()
Calculates and sets the size of the widget for an asynchronous message.
Definition: messagewidget.cpp:1061
void setMessageText()
Sets the text for this label if it is acting as a sequence diagram message or a collaboration diagram...
Definition: floatingtextwidget.cpp:811
virtual void constrainMovementForAllWidgets(qreal &diffX, qreal &diffY)
Overridden from UMLWidget.
Definition: messagewidget.cpp:279
void setPen(const QColor &color)
void drawEllipse(const QRectF &rectangle)
void setAttribute(const QString &name, const QString &value)
bool isSelected() const
Definition: listpopupmenu.h:174
void setPos(const QPointF &pos)
virtual void mouseDoubleClickEvent(QGraphicsSceneMouseEvent *event)
Event handler for mouse double click events.
Definition: messagewidget.cpp:1289
Uml::SequenceMessage::Enum m_sequenceMessageType
Whether the message is synchronous or asynchronous.
Definition: messagewidget.h:178
int toInt(bool *ok, int base) const
void setSelected(bool _select)
Sets the state of whether the widget is selected.
Definition: messagewidget.cpp:1193
virtual bool loadFromXMI(QDomElement &qElement)
Loads from the "messagewidget" XMI element.
Definition: messagewidget.cpp:1333
bool isEmpty() const
void setActivated(bool active=true)
Set the m_activated flag of a widget but does not perform the Activate method.
Definition: umlwidget.cpp:1056
void setBrush(const QBrush &brush)
void putPoints(int index, int nPoints, int firstx, int firsty,...)
virtual QString customOpText()
Overrides operation from LinkWidget.
Definition: messagewidget.cpp:959
QString displayText() const
Use to get the total text (prepended + main body + appended) currently displayed by the widget...
Definition: floatingtextwidget.cpp:157
void messageRemoved(MessageWidget *message)
Remove a message widget from the list.
Definition: objectwidget.cpp:580
virtual bool loadFromXMI(QDomElement &qElement)
A virtual method to load the properties of this widget from a QDomElement into this widget...
Definition: umlwidget.cpp:1833
UMLWidget * findWidget(Uml::ID::Type id)
Finds a widget with the given ID.
Definition: umlscene.cpp:1114
void sigMessageMoved()
emitted when the message widget is moved up or down slots into ObjectWidget::slotMessageMoved() ...
void setSequenceNumber(const QString &sequenceNumber)
Write property of QString m_SequenceNumber.
Definition: floatingtextwidget.cpp:477
void sigWidgetMoved(Uml::ID::Type id)
Emit when the widget moves its' position.
void setModified(bool modified=true)
Sets the modified flag for the document after a modifying action on the view connected to the documen...
Definition: umldoc.cpp:2652
virtual void setText(FloatingTextWidget *ft, const QString &newText)
Overrides operation from LinkWidget.
Definition: messagewidget.cpp:891
void messageAdded(MessageWidget *message)
Add a message widget to the list.
Definition: objectwidget.cpp:566
virtual bool activate(IDChangeLog *Log=0)
Activates a MessageWidget.
Definition: messagewidget.cpp:781
virtual void cleanup()
Used to cleanup any other widget it may need to delete.
Definition: umlwidget.cpp:1461
virtual UMLWidget * onWidget(const QPointF &p)
Test if point is inside the bounding rectangle of the widget.
Definition: widgetbase.cpp:655
virtual UMLObject * findChildObjectById(Uml::ID::Type id, bool considerAncestors=false)
Find the child object by the given id.
Definition: classifier.cpp:561
virtual void constrainTextPos(qreal &textX, qreal &textY, qreal textWidth, qreal textHeight, Uml::TextRole::Enum tr)
Constrains the FloatingTextWidget X and Y values supplied.
Definition: messagewidget.cpp:675
void removeWidget(UMLWidget *o)
Remove a widget from view (undo command)
Definition: umlscene.cpp:1217
void slotWidgetMoved(Uml::ID::Type id)
Definition: messagewidget.cpp:715
virtual bool loadFromXMI(QDomElement &qElement)
Loads the "floatingtext" XMI element.
Definition: floatingtextwidget.cpp:683
bool isNull() const
Definition: basictypes.h:200
MessageWidget(UMLScene *scene, ObjectWidget *a, ObjectWidget *b, int y, Uml::SequenceMessage::Enum sequenceMessageType, Uml::ID::Type id=Uml::ID::None)
Constructs a MessageWidget.
Definition: messagewidget.cpp:53
virtual void saveToXMI(QDomDocument &qDoc, QDomElement &qElement)
A virtual method to save the properties of this widget into a QDomElement i.e xml.
Definition: umlwidget.cpp:1810
QDomNode firstChild() const
Enum fromInt(int item)
Convert a integer item into SequenceMessage representation.
Definition: basictypes.cpp:701
void cleanup()
Used to cleanup any other widget it may need to delete.
Definition: messagewidget.cpp:1170
void slotMenuSelection(QAction *action)
Definition: messagewidget.cpp:765
void calculateDimensionsLost()
Calculates and sets the size of the widget for a lost message.
Definition: messagewidget.cpp:1123
float toFloat(bool *ok) const
void setObjectWidget(ObjectWidget *ow, Uml::RoleType::Enum role)
Sets the related widget on the given side.
Definition: messagewidget.cpp:1253
virtual void setFont(const QFont &font)
Sets the font the widget is to use.
Definition: umlwidget.cpp:1720
virtual UMLClassifier * lwClassifier()
Overrides operation from LinkWidget.
Definition: messagewidget.cpp:992
int length() const
void setVisible(bool visible)
QString tagName() const
virtual void adjustAssocs(qreal dx, qreal dy)
Adjusts associations with the given co-ordinates.
Definition: umlwidget.cpp:1089
void calculateDimensions()
Calculates the size of the widget by calling calculateDimensionsSynchronous(), calculateDimensionsAsy...
Definition: messagewidget.cpp:1005
Definition: basictypes.h:161
static MenuType typeFromAction(QAction *action)
Convenience method to extract the ListPopupMenu type from an action.
Definition: listpopupmenu.cpp:1234
QDomElement createElement(const QString &tagName)
void addFloatingTextWidget(FloatingTextWidget *pWidget)
Adds a floating text widget to the view.
Definition: umlscene.cpp:1880
void setFontCmd(const QFont &font)
Sets the font the widget is to use.
Definition: umlwidget.cpp:1735
bool connect(const QObject *sender, const char *signal, const QObject *receiver, const char *method, Qt::ConnectionType type)
virtual void saveToXMI(QDomDocument &qDoc, QDomElement &qElement)
Saves to the "messagewidget" XMI element.
Definition: messagewidget.cpp:1303
void calculateDimensionsCreation()
Calculates and sets the size of the widget for a creation message.
Definition: messagewidget.cpp:1094
void paintSynchronous(QPainter *painter, const QStyleOptionGraphicsItem *option)
Draws the calling arrow with filled in arrowhead, the timeline box and the returning arrow with a das...
Definition: messagewidget.cpp:364
const QPen & pen() const
virtual void paint(QPainter *painter, const QStyleOptionGraphicsItem *option, QWidget *widget=0)
Reimplemented from UMLWidget and calls other paint...() methods depending on the message type...
Definition: messagewidget.cpp:289
void paintCreation(QPainter *painter, const QStyleOptionGraphicsItem *option)
Draws a solid arrow line and a stick arrow head to the edge of the target object widget instead of to...
Definition: messagewidget.cpp:478
static void paintArrow(QPainter *p, int x, int y, int w, Qt::ArrowType direction, bool useDottedLine=false)
Draw an arrow pointing in the given direction.
Definition: messagewidget.cpp:335
virtual QFont font() const
Returns the font used for diaplaying any text.
Definition: widgetbase.cpp:445
UMLWidget * onWidget(const QPointF &p)
Overrides operation from UMLWidget.
Definition: messagewidget.cpp:598
virtual void moveWidgetBy(qreal diffX, qreal diffY)
Overridden from UMLWidget.
Definition: messagewidget.cpp:263
virtual void resizeWidget(qreal newW, qreal newH)
Overridden from UMLWidget.
Definition: messagewidget.cpp:199
void setText(const QString &t)
Set the main body of text to display.
Definition: floatingtextwidget.cpp:104
void setTextPosition()
Sets the text position relative to the sequence message.
Definition: messagewidget.cpp:623
virtual void setMessageText(FloatingTextWidget *ft)
Overrides operation from LinkWidget.
Definition: messagewidget.cpp:875
This file is part of the KDE documentation.
Documentation copyright © 1996-2020 The KDE developers.
Generated on Mon Jun 22 2020 13:40:26 by doxygen 1.8.7 written by Dimitri van Heesch, © 1997-2006
Documentation copyright © 1996-2020 The KDE developers.
Generated on Mon Jun 22 2020 13:40:26 by doxygen 1.8.7 written by Dimitri van Heesch, © 1997-2006
KDE's Doxygen guidelines are available online.