MessageWidget Class Reference
Used to display a message on a sequence diagram. Displays a message. More...
#include <messagewidget.h>
Inheritance diagram for MessageWidget:

Public Slots | |
| void | slotWidgetMoved (Uml::IDType id) |
| Captures when another widget moves if it is link to it that signal. | |
| void | slotMenuSelection (int sel) |
| Captures any popup menu signals for menus it created. | |
Signals | |
| void | sigMessageMoved () |
| emitted when the message widget is moved up or down slots into ObjectWidget::slotMessageMoved() | |
Public Member Functions | |
| MessageWidget (UMLView *view, ObjectWidget *a, ObjectWidget *b, int y, Uml::Sequence_Message_Type sequenceMessageType, Uml::IDType id=Uml::id_None) | |
| Constructs a MessageWidget. | |
| MessageWidget (UMLView *view, Uml::Sequence_Message_Type sequenceMessageType, Uml::IDType id=Uml::id_None) | |
| Constructs a MessageWidget. | |
| void | init () |
| Initializes key variables of the class. | |
| virtual | ~MessageWidget () |
| Standard deconstructor. | |
| void | setSequenceNumber (const QString &sequenceNumber) |
| Write property of QString m_SequenceNumber. | |
| QString | getSequenceNumber () const |
| Read property of QString m_SequenceNumber. | |
| Uml::Sequence_Message_Type | getSequenceMessageType () const |
| Returns whether the message is synchronous or asynchronous. | |
| bool | contains (ObjectWidget *w) |
| Check to see if the given ObjectWidget is involved in the message. | |
| ObjectWidget * | getWidget (Uml::Role_Type role) |
| Returns the related widget on the given side. | |
| void | setWidget (ObjectWidget *ow, Uml::Role_Type role) |
| Sets the related widget on the given side. | |
| FloatingTextWidget * | getFloatingTextWidget () |
| Returns the text widget it is related to. | |
| void | setFloatingTextWidget (FloatingTextWidget *f) |
| Sets the text widget it is related to. | |
| void | lwSetFont (QFont font) |
| Implements operation from LinkWidget. | |
| UMLClassifier * | getOperationOwner () |
| Overrides operation from LinkWidget. | |
| UMLOperation * | getOperation () |
| Implements operation from LinkWidget. | |
| void | setOperation (UMLOperation *op) |
| Implements operation from LinkWidget. | |
| QString | getCustomOpText () |
| Overrides operation from LinkWidget. | |
| void | setCustomOpText (const QString &opText) |
| Overrides operation from LinkWidget. | |
| void | setMessageText (FloatingTextWidget *ft) |
| Overrides operation from LinkWidget. | |
| void | setText (FloatingTextWidget *ft, const QString &newText) |
| Overrides operation from LinkWidget. | |
| void | setSeqNumAndOp (const QString &seqNum, const QString &op) |
| Overrides operation from LinkWidget. | |
| UMLClassifier * | getSeqNumAndOp (QString &seqNum, QString &op) |
| Overrides operation from LinkWidget. | |
| void | calculateWidget () |
| Calculate the geometry of the widget. | |
| bool | activate (IDChangeLog *Log=0) |
| Activates a MessageWidget. | |
| void | calculateDimensions () |
| Calculates the size of the widget by calling calculateDimenstionsSynchronous(), calculateDimenstionsAsynchronous(), or calculateDimensionsCreation(). | |
| void | calculateDimensionsSynchronous () |
| Calculates and sets the size of the widget for a synchronous message. | |
| void | calculateDimensionsAsynchronous () |
| Calculates and sets the size of the widget for an asynchronous message. | |
| void | calculateDimensionsCreation () |
| Calculates and sets the size of the widget for a creation message. | |
| void | draw (QPainter &p, int offsetX, int offsetY) |
| Calls drawSynchronous() or drawAsynchronous(). | |
| void | drawSynchronous (QPainter &p, int offsetX, int offsetY) |
| Draws the calling arrow with filled in arrowhead, the timeline box and the returning arrow with a dashed line and stick arrowhead. | |
| void | drawAsynchronous (QPainter &p, int offsetX, int offsetY) |
| Draws a solid arrow line and a stick arrow head. | |
| void | drawCreation (QPainter &p, int offsetX, int offsetY) |
| Draws a solid arrow line and a stick arrow head to the edge of the target object widget instead of to the sequence line. | |
| void | setTextPosition () |
| Sets the text position relative to the sequence message. | |
| void | constrainTextPos (int &textX, int &textY, int textWidth, int textHeight, Uml::Text_Role tr) |
| Constrains the FloatingTextWidget X and Y values supplied. | |
| void | cleanup () |
| Used to cleanup any other widget it may need to delete. | |
| void | setSelected (bool _select) |
| Sets the state of whether the widget is selected. | |
| int | getMinY () |
| Returns the minimum height this widget should be set at on a sequence diagrams. | |
| int | getMaxY () |
| Returns the maximum height this widget should be set at on a sequence diagrams. | |
| int | onWidget (const QPoint &p) |
| Overrides operation from UMLWidget. | |
| void | saveToXMI (QDomDocument &qDoc, QDomElement &qElement) |
| Saves to the <messagewidget> XMI element. | |
| bool | loadFromXMI (QDomElement &qElement) |
| Loads from the <messagewidget> XMI element. | |
Protected Member Functions | |
| void | setLinkAndTextPos () |
| Shortcut for calling m_pFText->setLink() followed by this->setTextPosition(). | |
| int | constrainX (int textX, int textWidth, Uml::Text_Role tr) |
| Returns the textX arg with constraints applied. | |
| void | updateResizability () |
| Update the UMLWidget::m_bResizable flag according to the charactersitics of this message. | |
Static Protected Member Functions | |
| static void | drawArrow (QPainter &p, int x, int y, int w, Qt::ArrowType direction, bool useDottedLine=false) |
| Draw an arrow pointing in the given direction. | |
| static void | drawSolidArrowhead (QPainter &p, int x, int y, Qt::ArrowType direction) |
| Draw a solid (triangular) arrowhead pointing in the given direction. | |
Protected Attributes | |
| QString | m_SequenceNumber |
| QString | m_CustomOp |
| Uml::Sequence_Message_Type | m_sequenceMessageType |
| Whether the message is synchronous or asynchronous. | |
Friends | |
| class | MessageWidgetController |
Detailed Description
Used to display a message on a sequence diagram. Displays a message.The message could be between two objects or a message that calls itself on an object. This class will only display the line that is required and the text will be setup by the FloatingTextWidget widget that is passed in the constructor. A message can be synchronous (calls a method and gains control back on return, as happens in most programming languages) or asynchronous (calls a method and gains back control immediately).
- Author:
- Paul Hensgen
- See also:
- UMLWidget
FloatingTextWidget Bugs and comments to uml-devel@lists.sf.net or http://bugs.kde.org
Definition at line 41 of file messagewidget.h.
Constructor & Destructor Documentation
|
||||||||||||||||||||||||||||
|
Constructs a MessageWidget.
Definition at line 32 of file messagewidget.cpp. References activate(), calculateWidget(), UMLWidget::getHeight(), getMaxY(), getMinY(), init(), m_sequenceMessageType, ObjectWidget::setY(), and updateResizability(). |
|
||||||||||||||||
|
Constructs a MessageWidget.
Definition at line 54 of file messagewidget.cpp. References init(), and m_sequenceMessageType. |
|
|
Standard deconstructor.
Definition at line 70 of file messagewidget.cpp. |
Member Function Documentation
|
|
Initializes key variables of the class.
Reimplemented from UMLWidget. Definition at line 60 of file messagewidget.cpp. References WidgetBase::setBaseType(). Referenced by MessageWidget(). |
|
|
Write property of QString m_SequenceNumber.
Definition at line 500 of file messagewidget.cpp. Referenced by setSeqNumAndOp(). |
|
|
Read property of QString m_SequenceNumber.
Definition at line 504 of file messagewidget.cpp. |
|
|
Returns whether the message is synchronous or asynchronous.
Definition at line 92 of file messagewidget.h. References m_sequenceMessageType. Referenced by FloatingTextWidgetController::moveWidgetBy(). |
|
|
Check to see if the given ObjectWidget is involved in the message.
Definition at line 384 of file messagewidget.cpp. |
|
|
Returns the related widget on the given side.
Definition at line 726 of file messagewidget.cpp. Referenced by FloatingTextWidgetController::moveWidgetBy(), and UMLView::selectWidgets(). |
|
||||||||||||
|
Sets the related widget on the given side.
Definition at line 721 of file messagewidget.cpp. References updateResizability(). |
|
|
Returns the text widget it is related to.
Definition at line 123 of file messagewidget.h. Referenced by UMLView::addWidget(), and ToolBarStateMessages::setSecondWidget(). |
|
|
Sets the text widget it is related to.
Definition at line 132 of file messagewidget.h. |
|
|
Implements operation from LinkWidget. Required by FloatingTextWidget. Implements LinkWidget. Definition at line 508 of file messagewidget.cpp. References UMLWidget::setFont(). |
|
|
Overrides operation from LinkWidget. Required by FloatingTextWidget. Reimplemented from LinkWidget. Definition at line 512 of file messagewidget.cpp. References WidgetBase::getUMLObject(). |
|
|
Implements operation from LinkWidget. Motivated by FloatingTextWidget. Implements LinkWidget. Definition at line 520 of file messagewidget.cpp. Referenced by getSeqNumAndOp(), and saveToXMI(). |
|
|
Implements operation from LinkWidget. Motivated by FloatingTextWidget. Implements LinkWidget. Definition at line 524 of file messagewidget.cpp. References setMessageText(). Referenced by activate(). |
|
|
Overrides operation from LinkWidget. Required by FloatingTextWidget. Implements LinkWidget. Definition at line 532 of file messagewidget.cpp. |
|
|
Overrides operation from LinkWidget. Required by FloatingTextWidget. Implements LinkWidget. Definition at line 536 of file messagewidget.cpp. References FloatingTextWidget::setMessageText(). |
|
|
Overrides operation from LinkWidget. Required by FloatingTextWidget.
Implements LinkWidget. Definition at line 482 of file messagewidget.cpp. References LinkWidget::getOperationText(), and setTextPosition(). Referenced by calculateWidget(), and setOperation(). |
|
||||||||||||
|
Overrides operation from LinkWidget. Required by FloatingTextWidget.
Implements LinkWidget. Definition at line 490 of file messagewidget.cpp. References UMLApp::getDocument(), and UMLDoc::setModified(). Referenced by activate(). |
|
||||||||||||
|
Overrides operation from LinkWidget. Required by FloatingTextWidget.
Implements LinkWidget. Definition at line 495 of file messagewidget.cpp. References setSequenceNumber(). |
|
||||||||||||
|
Overrides operation from LinkWidget. Required by FloatingTextWidget.
Implements LinkWidget. Definition at line 541 of file messagewidget.cpp. References getOperation(), WidgetBase::getUMLObject(), and UMLOperation::toString(). |
|
|
Calculate the geometry of the widget.
Definition at line 352 of file messagewidget.cpp. References calculateDimensions(), setMessageText(), UMLWidget::setX(), and UMLWidget::setY(). Referenced by MessageWidget(), and slotWidgetMoved(). |
|
|
Activates a MessageWidget. Connects its m_pOw[] pointers to UMLObjects and also send signals about its FloatingTextWidget. Reimplemented from UMLWidget. Definition at line 409 of file messagewidget.cpp. References calculateDimensions(), UMLClassifier::findChildObjectById(), UMLView::findWidget(), FloatingTextWidget::getText(), WidgetBase::getUMLObject(), UMLView::resetPastePoint(), UMLWidget::setActivated(), UMLWidget::setFont(), setLinkAndTextPos(), setOperation(), setText(), sigMessageMoved(), UMLWidget::sigWidgetMoved(), slotWidgetMoved(), and updateResizability(). Referenced by MessageWidget(). |
|
|
Calculates the size of the widget by calling calculateDimenstionsSynchronous(), calculateDimenstionsAsynchronous(), or calculateDimensionsCreation().
Definition at line 554 of file messagewidget.cpp. References UMLWidget::adjustAssocs(), calculateDimensionsAsynchronous(), calculateDimensionsCreation(), calculateDimensionsSynchronous(), UMLWidget::getX(), UMLWidget::getY(), and m_sequenceMessageType. Referenced by activate(), and calculateWidget(). |
|
|
Calculates and sets the size of the widget for a synchronous message.
Definition at line 569 of file messagewidget.cpp. References UMLWidget::getWidth(), UMLWidget::getX(), and UMLWidget::setSize(). Referenced by calculateDimensions(). |
|
|
Calculates and sets the size of the widget for an asynchronous message.
Definition at line 602 of file messagewidget.cpp. References UMLWidget::getWidth(), UMLWidget::getX(), and UMLWidget::setSize(). Referenced by calculateDimensions(). |
|
|
Calculates and sets the size of the widget for a creation message.
Definition at line 635 of file messagewidget.cpp. References UMLWidget::getHeight(), UMLWidget::getWidth(), UMLWidget::getX(), UMLWidget::getY(), and UMLWidget::setSize(). Referenced by calculateDimensions(). |
|
||||||||||||||||
|
Calls drawSynchronous() or drawAsynchronous().
Implements UMLWidget. Definition at line 81 of file messagewidget.cpp. References drawAsynchronous(), drawCreation(), drawSynchronous(), m_sequenceMessageType, and UMLWidget::setPen(). |
|
||||||||||||||||
|
Draws the calling arrow with filled in arrowhead, the timeline box and the returning arrow with a dashed line and stick arrowhead.
Definition at line 129 of file messagewidget.cpp. References drawArrow(), UMLWidget::drawSelected(), drawSolidArrowhead(), UMLWidget::getHeight(), UMLWidget::getWidth(), UMLWidget::getX(), and UMLWidget::getY(). Referenced by draw(). |
|
||||||||||||||||
|
Draws a solid arrow line and a stick arrow head.
Definition at line 184 of file messagewidget.cpp. References drawArrow(), UMLWidget::drawSelected(), UMLWidget::getHeight(), UMLWidget::getWidth(), UMLWidget::getX(), and UMLWidget::getY(). Referenced by draw(). |
|
||||||||||||||||
|
Draws a solid arrow line and a stick arrow head to the edge of the target object widget instead of to the sequence line.
Definition at line 227 of file messagewidget.cpp. References drawArrow(), UMLWidget::drawSelected(), UMLWidget::getWidth(), UMLWidget::getX(), and UMLWidget::getY(). Referenced by draw(). |
|
|
Sets the text position relative to the sequence message.
Definition at line 277 of file messagewidget.cpp. References constrainX(), FloatingTextWidget::getDisplayText(), UMLWidget::getHeight(), FloatingTextWidget::getRole(), UMLWidget::getWidth(), UMLWidget::getX(), UMLWidget::getY(), UMLWidget::setX(), UMLWidget::setY(), and UMLWidget::updateComponentSize(). Referenced by setLinkAndTextPos(), setMessageText(), ToolBarStateMessages::setSecondWidget(), and slotWidgetMoved(). |
|
||||||||||||||||||||||||
|
Constrains the FloatingTextWidget X and Y values supplied. Overrides operation from LinkWidget.
Implements LinkWidget. Definition at line 314 of file messagewidget.cpp. References constrainX(), getMaxY(), and getMinY(). |
|
|
Used to cleanup any other widget it may need to delete.
Reimplemented from UMLWidget. Definition at line 662 of file messagewidget.cpp. References UMLWidget::cleanup(), ObjectWidget::messageRemoved(), UMLView::removeWidget(), and sigMessageMoved(). |
|
|
Sets the state of whether the widget is selected.
Reimplemented from UMLWidget. Definition at line 679 of file messagewidget.cpp. References FloatingTextWidget::getDisplayText(), UMLWidget::getSelected(), and UMLWidget::setSelected(). |
|
|
Returns the minimum height this widget should be set at on a sequence diagrams. Takes into account the widget positions it is related to. Definition at line 692 of file messagewidget.cpp. References UMLWidget::getHeight(), UMLWidget::getY(), and m_sequenceMessageType. Referenced by constrainTextPos(), MessageWidget(), and slotWidgetMoved(). |
|
|
Returns the maximum height this widget should be set at on a sequence diagrams. Takes into account the widget positions it is related to. Definition at line 708 of file messagewidget.cpp. References ObjectWidget::getEndLineY(). Referenced by constrainTextPos(), MessageWidget(), and slotWidgetMoved(). |
|
|
Overrides operation from UMLWidget.
Reimplemented from UMLWidget. Definition at line 256 of file messagewidget.cpp. References UMLWidget::getHeight(), UMLWidget::getWidth(), UMLWidget::getX(), UMLWidget::getY(), m_sequenceMessageType, and UMLWidget::onWidget(). Referenced by ToolBarState::getMessageAt(). |
|
||||||||||||
|
Saves to the <messagewidget> XMI element.
Reimplemented from UMLWidget. Definition at line 730 of file messagewidget.cpp. References WidgetBase::getID(), UMLObject::getID(), getOperation(), FloatingTextWidget::getText(), and m_sequenceMessageType. |
|
|
Loads from the <messagewidget> XMI element.
Reimplemented from UMLWidget. Definition at line 752 of file messagewidget.cpp. References LinkWidget::getOperationText(), FloatingTextWidget::loadFromXMI(), and m_sequenceMessageType. |
|
|
Shortcut for calling m_pFText->setLink() followed by this->setTextPosition().
Definition at line 327 of file messagewidget.cpp. References FloatingTextWidget::setLink(), and setTextPosition(). Referenced by activate(), and slotMenuSelection(). |
|
||||||||||||||||
|
Returns the textX arg with constraints applied. Auxiliary to setTextPosition() and constrainTextPos(). Definition at line 293 of file messagewidget.cpp. References UMLWidget::getWidth(), and UMLWidget::getX(). Referenced by constrainTextPos(), and setTextPosition(). |
|
||||||||||||||||||||||||||||
|
Draw an arrow pointing in the given direction. The arrow head is not solid, i.e. it is made up of two lines like so: ---> The direction can be either Qt::LeftArrow or Qt::RightArrow. Definition at line 108 of file messagewidget.cpp. References UMLWidget::setPen(). Referenced by drawAsynchronous(), drawCreation(), and drawSynchronous(). |
|
||||||||||||||||||||
|
Draw a solid (triangular) arrowhead pointing in the given direction. The direction can be either Qt::LeftArrow or Qt::RightArrow. Definition at line 97 of file messagewidget.cpp. Referenced by drawSynchronous(). |
|
|
Update the UMLWidget::m_bResizable flag according to the charactersitics of this message.
Definition at line 73 of file messagewidget.cpp. References m_sequenceMessageType. Referenced by activate(), MessageWidget(), and setWidget(). |
|
|
Captures when another widget moves if it is link to it that signal.
Reimplemented from UMLWidget. Definition at line 362 of file messagewidget.cpp. References calculateWidget(), ObjectWidget::getLocalID(), getMaxY(), getMinY(), UMLView::getSelectCount(), UMLWidget::getY(), and setTextPosition(). Referenced by activate(). |
|
|
Captures any popup menu signals for menus it created.
Reimplemented from UMLWidget. Definition at line 391 of file messagewidget.cpp. References UMLView::getWidgetList(), UMLWidget::setFont(), and setLinkAndTextPos(). |
|
|
emitted when the message widget is moved up or down slots into ObjectWidget::slotMessageMoved()
Referenced by activate(), cleanup(), and MessageWidgetController::resizeWidget(). |
Member Data Documentation
|
|
Whether the message is synchronous or asynchronous.
Definition at line 372 of file messagewidget.h. Referenced by calculateDimensions(), draw(), getMinY(), getSequenceMessageType(), loadFromXMI(), MessageWidget(), MessageWidgetController::moveWidgetBy(), onWidget(), saveToXMI(), and updateResizability(). |
The documentation for this class was generated from the following files:
