umbrello 25.04.2
Umbrello UML Modeller is a Unified Modelling Language (UML) diagram program based on KDE Technology
MessageWidget Class Reference

Displays a message. More...

#include <messagewidget.h>

Inheritance diagram for MessageWidget:
Collaboration diagram for MessageWidget:

Public Slots

void slotWidgetMoved (Uml::ID::Type id)
void slotMenuSelection (QAction *action)
Public Slots inherited from UMLWidget
virtual void updateWidget ()
virtual void slotMenuSelection (QAction *action)
virtual void slotWidgetMoved (Uml::ID::Type id)
virtual void slotFillColorChanged (Uml::ID::Type viewID)
virtual void slotLineColorChanged (Uml::ID::Type viewID)
virtual void slotTextColorChanged (Uml::ID::Type viewID)
virtual void slotLineWidthChanged (Uml::ID::Type viewID)
void slotSnapToGrid ()
Public Slots inherited from WidgetBase
virtual void slotMenuSelection (QAction *trigger)

Signals

void sigMessageMoved ()
Signals inherited from UMLWidget
void sigWidgetMoved (Uml::ID::Type id)

Public Member Functions

 MessageWidget (UMLScene *scene, ObjectWidget *a, ObjectWidget *b, int y, Uml::SequenceMessage::Enum sequenceMessageType, Uml::ID::Type id=Uml::ID::None)
 MessageWidget (UMLScene *scene, Uml::SequenceMessage::Enum sequenceMessageType, Uml::ID::Type id=Uml::ID::None)
 MessageWidget (UMLScene *scene, ObjectWidget *a, int xclick, int yclick, Uml::SequenceMessage::Enum sequenceMessageType, Uml::ID::Type id=Uml::ID::None)
virtual ~MessageWidget ()
virtual void setY (qreal y)
virtual void lwSetFont (QFont font)
virtual UMLClassifieroperationOwner ()
virtual UMLOperationoperation ()
virtual void setOperation (UMLOperation *op)
virtual QString customOpText ()
virtual void setCustomOpText (const QString &opText)
virtual void setMessageText (FloatingTextWidget *ft)
virtual void setText (FloatingTextWidget *ft, const QString &newText)
virtual QString lwOperationText ()
virtual UMLClassifierlwClassifier ()
virtual void setOperationText (const QString &op)
virtual void constrainTextPos (qreal &textX, qreal &textY, qreal textWidth, qreal textHeight, Uml::TextRole::Enum tr)
Uml::SequenceMessage::Enum sequenceMessageType () const
bool hasObjectWidget (ObjectWidget *w)
ObjectWidgetobjectWidget (Uml::RoleType::Enum role)
void setObjectWidget (ObjectWidget *ow, Uml::RoleType::Enum role)
bool isSelf () const
FloatingTextWidgetfloatingTextWidget ()
void setFloatingTextWidget (FloatingTextWidget *f)
void calculateWidget ()
virtual bool activate (IDChangeLog *Log=nullptr)
void resolveObjectWidget (IDChangeLog *log)
void calculateDimensions ()
void calculateDimensionsSynchronous ()
void calculateDimensionsAsynchronous ()
void calculateDimensionsCreation ()
void calculateDimensionsDestroy ()
void calculateDimensionsLost ()
void calculateDimensionsFound ()
virtual void paint (QPainter *painter, const QStyleOptionGraphicsItem *option, QWidget *widget=nullptr)
void setTextPosition ()
void cleanup ()
void setSelected (bool _select)
int getMinY ()
int getMaxY ()
virtual QSizeF minimumSize () const
UMLWidgetonWidget (const QPointF &p)
virtual void resizeWidget (qreal newW, qreal newH)
virtual void saveToXMI (QXmlStreamWriter &writer)
virtual bool loadFromXMI (QDomElement &qElement)
void setxclicked (int xclick)
void setyclicked (int yclick)
int getxclicked () const
virtual bool showPropertiesDialog ()
Public Member Functions inherited from UMLWidget
 UMLWidget (UMLScene *scene, WidgetType type=wt_UMLWidget, UMLObject *o=nullptr)
 UMLWidget (UMLScene *scene, WidgetType type=wt_UMLWidget, Uml::ID::Type id=Uml::ID::None)
virtual ~UMLWidget ()
UMLWidgetoperator= (const UMLWidget &other)
bool operator== (const UMLWidget &other) const
void setMinimumSize (const QSizeF &size)
virtual QSizeF maximumSize ()
void setMaximumSize (const QSizeF &size)
virtual void setUseFillColor (bool fc)
void setUseFillColorCmd (bool fc)
virtual void setTextColor (const QColor &color)
void setTextColorCmd (const QColor &color)
virtual void setLineColor (const QColor &color)
virtual void setLineColorCmd (const QColor &color)
virtual void setLineWidth (uint width)
void setLineWidthCmd (uint width)
virtual void setFillColor (const QColor &color)
void setFillColorCmd (const QColor &color)
void setSelectedFlag (bool _select)
void setScene (UMLScene *scene)
void setPenFromSettings (QPainter &p)
void setPenFromSettings (QPainter *p)
virtual void setFont (const QFont &font)
void setFontCmd (const QFont &font)
bool getStartMove () const
virtual qreal getX () const
virtual qreal getY () const
virtual QPointF getPos () const
virtual void setX (qreal x)
qreal height () const
qreal width () const
void setSize (qreal width, qreal height)
void setSize (const QSizeF &size)
virtual void notifyParentResize ()
bool getIgnoreSnapToGrid () const
void setIgnoreSnapToGrid (bool to)
virtual bool isLocatedIn (const UMLWidget *other) const
void moveByLocal (qreal dx, qreal dy)
virtual void removeAssoc (AssociationWidget *pAssoc)
virtual void addAssoc (AssociationWidget *pAssoc)
AssociationWidgetListassociationWidgetList () const
bool isInstance () const
void setIsInstance (bool isInstance)
void setInstanceName (const QString &instanceName)
QString instanceName () const
Uml::ShowStereoType::Enum showStereotype () const
virtual void setShowStereotype (Uml::ShowStereoType::Enum flag)
QString tags () const
virtual void adjustAssocs (qreal dx, qreal dy)
virtual void adjustUnselectedAssocs (qreal dx, qreal dy)
bool isActivated () const
void setActivated (bool active=true)
void updateGeometry (bool withAssocs=true)
void clipSize ()
void forceUpdateFontMetrics (QPainter *painter)
void forceUpdateFontMetrics (QFont &font, QPainter *painter)
QPointF startMovePosition () const
void setStartMovePosition (const QPointF &position)
QSizeF startResizeSize () const
virtual QSizeF calculateSize (bool withExtensions=true) const
void resize ()
bool fixedAspectRatio () const
void setFixedAspectRatio (bool state)
bool resizable () const
void setResizable (bool state)
virtual void setDefaultFontMetrics (QFont &font, UMLWidget::FontType fontType)
virtual void setDefaultFontMetrics (QFont &font, UMLWidget::FontType fontType, QPainter &painter)
QFontMetrics & getFontMetrics (UMLWidget::FontType fontType) const
void setFontMetrics (UMLWidget::FontType fontType, QFontMetrics fm)
void setupFontType (QFont &font, UMLWidget::FontType fontType)
Public Member Functions inherited from WidgetBase
 WidgetBase (UMLScene *scene, WidgetType type=wt_UMLWidget, Uml::ID::Type id=Uml::ID::None)
virtual ~WidgetBase ()
UMLObjectumlObject () const
virtual void setUMLObject (UMLObject *obj)
Uml::ID::Type id () const
void setID (Uml::ID::Type id)
void setLocalID (Uml::ID::Type id)
Uml::ID::Type localID () const
virtual UMLWidgetwidgetWithID (Uml::ID::Type id)
WidgetType baseType () const
void setBaseType (const WidgetType &baseType)
QLatin1String baseTypeStr () const
QString baseTypeStrWithoutPrefix () const
UMLSceneumlScene () const
UMLDocumlDoc () const
QString documentation () const
bool hasDocumentation () const
virtual void setDocumentation (const QString &doc)
QString name () const
virtual void setName (const QString &strName)
QColor lineColor () const
uint lineWidth () const
QColor textColor () const
QColor fillColor () const
bool usesDiagramLineColor () const
void setUsesDiagramLineColor (bool state)
bool usesDiagramLineWidth () const
void setUsesDiagramLineWidth (bool state)
bool useFillColor () const
bool usesDiagramTextColor () const
void setUsesDiagramTextColor (bool state)
bool usesDiagramFillColor () const
void setUsesDiagramFillColor (bool state)
bool usesDiagramUseFillColor () const
void setUsesDiagramUseFillColor (bool state)
virtual QFont font () const
bool autoResize () const
void setAutoResize (bool state)
bool changesShape () const
void setChangesShape (bool state)
WidgetBaseoperator= (const WidgetBase &other)
QRectF rect () const
void setRect (const QRectF &rect)
void setRect (qreal x, qreal y, qreal width, qreal height)
virtual QRectF boundingRect () const
bool isActivityWidget () const
bool isActorWidget () const
bool isArtifactWidget () const
bool isAssociationWidget () const
bool isBoxWidget () const
bool isCategoryWidget () const
bool isClassWidget () const
bool isCombinedFragmentWidget () const
bool isComponentWidget () const
bool isDatatypeWidget () const
bool isEntityWidget () const
bool isEnumWidget () const
bool isFloatingDashLineWidget () const
bool isForkJoinWidget () const
bool isInterfaceWidget () const
bool isMessageWidget () const
bool isNodeWidget () const
bool isNoteWidget () const
bool isObjectNodeWidget () const
bool isObjectWidget () const
bool isPackageWidget () const
bool isPinWidget () const
bool isPortWidget () const
bool isPreconditionWidget () const
bool isRegionWidget () const
bool isSignalWidget () const
bool isStateWidget () const
bool isTextWidget () const
bool isUseCaseWidget () const
ActivityWidgetasActivityWidget ()
ActorWidgetasActorWidget ()
ArtifactWidgetasArtifactWidget ()
AssociationWidgetasAssociationWidget ()
BoxWidgetasBoxWidget ()
CategoryWidgetasCategoryWidget ()
ClassifierWidgetasClassifierWidget ()
CombinedFragmentWidgetasCombinedFragmentWidget ()
ComponentWidgetasComponentWidget ()
DatatypeWidgetasDatatypeWidget ()
EntityWidgetasEntityWidget ()
EnumWidgetasEnumWidget ()
FloatingDashLineWidgetasFloatingDashLineWidget ()
ForkJoinWidgetasForkJoinWidget ()
InterfaceWidgetasInterfaceWidget ()
MessageWidgetasMessageWidget ()
NodeWidgetasNodeWidget ()
NoteWidgetasNoteWidget ()
ObjectNodeWidgetasObjectNodeWidget ()
ObjectWidgetasObjectWidget ()
PackageWidgetasPackageWidget ()
PinWidgetasPinWidget ()
PinPortBaseasPinPortBase ()
PortWidgetasPortWidget ()
PreconditionWidgetasPreconditionWidget ()
RegionWidgetasRegionWidget ()
SignalWidgetasSignalWidget ()
StateWidgetasStateWidget ()
FloatingTextWidgetasFloatingTextWidget ()
UseCaseWidgetasUseCaseWidget ()
UMLWidgetasUMLWidget ()
const ActivityWidgetasActivityWidget () const
const ActorWidgetasActorWidget () const
const ArtifactWidgetasArtifactWidget () const
const AssociationWidgetasAssociationWidget () const
const BoxWidgetasBoxWidget () const
const CategoryWidgetasCategoryWidget () const
const ClassifierWidgetasClassifierWidget () const
const CombinedFragmentWidgetasCombinedFragmentWidget () const
const ComponentWidgetasComponentWidget () const
const DatatypeWidgetasDatatypeWidget () const
const EntityWidgetasEntityWidget () const
const EnumWidgetasEnumWidget () const
const FloatingDashLineWidgetasFloatingDashLineWidget () const
const ForkJoinWidgetasForkJoinWidget () const
const InterfaceWidgetasInterfaceWidget () const
const MessageWidgetasMessageWidget () const
const NodeWidgetasNodeWidget () const
const NoteWidgetasNoteWidget () const
const ObjectNodeWidgetasObjectNodeWidget () const
const ObjectWidgetasObjectWidget () const
const PackageWidgetasPackageWidget () const
const PinWidgetasPinWidget () const
const PinPortBaseasPinPortBase () const
const PortWidgetasPortWidget () const
const PreconditionWidgetasPreconditionWidget () const
const RegionWidgetasRegionWidget () const
const SignalWidgetasSignalWidget () const
const StateWidgetasStateWidget () const
const FloatingTextWidgetasFloatingTextWidget () const
const UseCaseWidgetasUseCaseWidget () const
const UMLWidgetasUMLWidget () const
Public Member Functions inherited from DiagramProxyWidget
 DiagramProxyWidget (UMLWidget *widget, qreal borderWidth=5)
virtual ~DiagramProxyWidget ()
Uml::ID::Type diagramLink () const
UMLScenelinkedDiagram () const
bool setDiagramLink (const Uml::ID::Type &id)
const QRectF & clientRect () const
const QRectF & sceneRect () const
void setClientRect (const QRectF &rect)
bool isProxyWidget () const
UMLWidgetgetProxiedWidget (const QPointF &p) const
QPointF mapFromClient (const QPointF &p) const
QRectF mapFromClient (const QRectF &r) const
QPointF mapToClient (const QPointF &pos) const
void paint (QPainter *painter, const QStyleOptionGraphicsItem *option, QWidget *widget=nullptr)
bool showLinkedDiagram () const
void setShowLinkedDiagram (bool showLinkedDiagram)
QRectF iconRect () const
void setIconRect (const QRectF &iconRect)

Protected Member Functions

virtual void moveWidgetBy (qreal diffX, qreal diffY)
virtual void constrainMovementForAllWidgets (qreal &diffX, qreal &diffY)
virtual bool isInResizeArea (QGraphicsSceneMouseEvent *me)
void setLinkAndTextPos ()
int constrainX (int textX, int textWidth, Uml::TextRole::Enum tr)
void updateResizability ()
void paintSynchronous (QPainter *painter, const QStyleOptionGraphicsItem *option)
void paintAsynchronous (QPainter *painter, const QStyleOptionGraphicsItem *option)
void paintCreation (QPainter *painter, const QStyleOptionGraphicsItem *option)
void paintDestroy (QPainter *painter, const QStyleOptionGraphicsItem *option)
void paintLost (QPainter *painter, const QStyleOptionGraphicsItem *option)
void paintFound (QPainter *painter, const QStyleOptionGraphicsItem *option)
Protected Member Functions inherited from UMLWidget
virtual void contextMenuEvent (QGraphicsSceneContextMenuEvent *event)
virtual void mouseDoubleClickEvent (QGraphicsSceneMouseEvent *event)
virtual void mousePressEvent (QGraphicsSceneMouseEvent *event)
virtual void mouseMoveEvent (QGraphicsSceneMouseEvent *event)
virtual void mouseReleaseEvent (QGraphicsSceneMouseEvent *event)
virtual void moveEvent (QGraphicsSceneMouseEvent *event)
virtual void constrain (qreal &width, qreal &height)
virtual QCursor resizeCursor () const
void selectSingle (QGraphicsSceneMouseEvent *me)
void selectMultiple (QGraphicsSceneMouseEvent *me)
void deselect (QGraphicsSceneMouseEvent *me)
void setSelectionBounds ()
void resize (QGraphicsSceneMouseEvent *me)
bool wasSizeChanged ()
bool wasPositionChanged ()
virtual void toForeground ()
void addConnectedWidget (UMLWidget *widget, Uml::AssociationType::Enum type=Uml::AssociationType::Association, AddWidgetOptions options=Default)
void addConnectedUMLObject (UMLObject::ObjectType otype, Uml::AssociationType::Enum type)
void addWidget (UMLWidget *widget, bool showProperties=true)
Protected Member Functions inherited from QGraphicsObjectWrapper
QVariant itemChange (GraphicsItemChange change, const QVariant &value)
Protected Member Functions inherited from DiagramProxyWidget
DiagramProxyWidgetoperator= (const DiagramProxyWidget &other)
bool activate (IDChangeLog *changeLog=nullptr)
bool loadFromXMI (QDomElement &qElement)
void saveToXMI (QXmlStreamWriter &writer)
void setupEvent (QGraphicsSceneMouseEvent &e, const QGraphicsSceneMouseEvent *event, const QPointF &pos) const
void setupEvent (QGraphicsSceneContextMenuEvent &e, const QGraphicsSceneContextMenuEvent *event, const QPointF &pos) const
void slotMenuSelection (QAction *action)

Static Protected Member Functions

static void paintArrow (QPainter *p, int x, int y, int w, Qt::ArrowType direction, bool useDottedLine=false)
static void paintSolidArrowhead (QPainter *p, int x, int y, Qt::ArrowType direction)

Protected Attributes

QString m_CustomOp
Uml::SequenceMessage::Enum m_sequenceMessageType
Protected Attributes inherited from UMLWidget
QString m_instanceName
 instance name (used if on a deployment diagram)
bool m_isInstance
 holds whether this widget is a component instance (i.e. on a deployment diagram)
Uml::ShowStereoType::Enum m_showStereotype
 if and how the stereotype should be displayed
bool m_startMove
QPointF m_startMovePostion
QSizeF m_startResizeSize
int m_nPosX
UMLDocm_doc
 shortcut for UMLApp::app()->document()
bool m_resizable
QFontMetrics * m_pFontMetrics [FT_INVALID]
QSizeF m_minimumSize
QSizeF m_maximumSize
bool m_activated
 true if the activate function has been called for this class instance
bool m_ignoreSnapToGrid
bool m_ignoreSnapComponentSizeToGrid
bool m_fixedAspectRatio
QString m_oldStatusBarMsg
 The text in the status bar when the cursor was pressed.
QPointF m_pressOffset
QPointF m_oldPos
 The X/Y position the widget had when the movement started.
qreal m_oldW
 The width/height the widget had when the resize started.
qreal m_oldH
bool m_shiftPressed
 If shift or control button were pressed in mouse press event.
bool m_inMoveArea
bool m_inResizeArea
bool m_moved
bool m_resized
Protected Attributes inherited from WidgetBase
UMLScenem_scene
QPointer< UMLObjectm_umlObject
QString m_Doc
 Only used if m_umlObject is not set.
QString m_Text
QRectF m_rect
 Widget size. In this rectangle, the x and y coordinates are always 0.
Uml::ID::Type m_nId
Uml::ID::Type m_nLocalID
QColor m_textColor
 Color of the text of the widget. Is saved to XMI.
QColor m_lineColor
 Color of the lines of the widget. Is saved to XMI.
QColor m_fillColor
 color of the background of the widget
QBrush m_brush
QFont m_font
uint m_lineWidth
 Width of the lines of the widget. Is saved to XMI.
bool m_useFillColor
 flag indicates if the UMLWidget uses the Diagram FillColour
bool m_usesDiagramFillColor
bool m_usesDiagramLineColor
bool m_usesDiagramLineWidth
bool m_usesDiagramTextColor
bool m_usesDiagramUseFillColor
bool m_autoResize
bool m_changesShape
 The widget changes its shape when the number of connections or their positions are changed.
Protected Attributes inherited from QGraphicsObjectWrapper
bool m_calledFromItemChange {false}

Private Member Functions

void resizeEvent (QResizeEvent *re)
qreal constrainPositionY (qreal diffY)
void init ()

Private Attributes

QPointer< ObjectWidgetm_pOw [2]
FloatingTextWidgetm_pFText
int m_xclicked
int m_yclicked
Uml::ID::Type m_widgetAId
Uml::ID::Type m_widgetBId
Uml::ID::Type m_textId

Additional Inherited Members

Public Types inherited from UMLWidget
enum  FontType {
  FT_NORMAL = 0 , FT_BOLD = 1 , FT_ITALIC = 2 , FT_UNDERLINE = 3 ,
  FT_BOLD_ITALIC = 4 , FT_BOLD_UNDERLINE = 5 , FT_ITALIC_UNDERLINE = 6 , FT_BOLD_ITALIC_UNDERLINE = 7 ,
  FT_INVALID = 8
}
enum  AddWidgetOption {
  NoOption = 0 , SetupSize = 1 , SwitchDirection = 2 , ShowProperties = 4 ,
  Default = SetupSize | ShowProperties
}
Public Types inherited from WidgetBase
enum  WidgetType {
  wt_Min = 299 , wt_UMLWidget , wt_Actor , wt_UseCase ,
  wt_Class , wt_Interface , wt_Datatype , wt_Enum ,
  wt_Entity , wt_Package , wt_Object , wt_Note ,
  wt_Box , wt_Message , wt_Text , wt_State ,
  wt_Activity , wt_Component , wt_Artifact , wt_Node ,
  wt_Association , wt_ForkJoin , wt_Precondition , wt_CombinedFragment ,
  wt_FloatingDashLine , wt_Signal , wt_Pin , wt_ObjectNode ,
  wt_Region , wt_Category , wt_Port , wt_Instance ,
  wt_Max
}
Static Public Member Functions inherited from WidgetBase
static QString toString (WidgetType wt)
static QString toI18nString (WidgetType wt)
static Icon_Utils::IconType toIcon (WidgetType wt)
static bool widgetHasUMLObject (WidgetBase::WidgetType type)
Static Public Attributes inherited from UMLWidget
static const QSizeF DefaultMinimumSize
static const QSizeF DefaultMaximumSize
static const int defaultMargin = 5
static const int selectionMarkerSize = 4
static const int resizeMarkerLineCount = 3

Detailed Description

Displays a message.

Used to display a message on a sequence diagram. 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
ObjectWidget
FloatingTextWidget Bugs and comments to umbre.nosp@m.llo-.nosp@m.devel.nosp@m.@kde.nosp@m..org or https://bugs.kde.org

Constructor & Destructor Documentation

◆ MessageWidget() [1/3]

MessageWidget::MessageWidget ( UMLScene * scene,
ObjectWidget * a,
ObjectWidget * b,
int y,
Uml::SequenceMessage::Enum sequenceMessageType,
Uml::ID::Type id = Uml::ID::None )

Constructs a MessageWidget.

This method is used for creation, synchronous and synchronous message types.

Parameters
sceneThe parent to this class.
aThe role A widget for this message.
bThe role B widget for this message.
yThe vertical position to display this message.
sequenceMessageTypeWhether synchronous or asynchronous
idA unique id used for deleting this object cleanly. The default (-1) will prompt generation of a new ID.
Here is the call graph for this function:

◆ MessageWidget() [2/3]

MessageWidget::MessageWidget ( UMLScene * scene,
Uml::SequenceMessage::Enum seqMsgType,
Uml::ID::Type id = Uml::ID::None )

Constructs a MessageWidget.

Parameters
sceneThe parent to this class.
seqMsgTypeThe Uml::SequenceMessage::Enum of this message widget
idThe ID to assign (-1 will prompt a new ID.)
Here is the call graph for this function:

◆ MessageWidget() [3/3]

MessageWidget::MessageWidget ( UMLScene * scene,
ObjectWidget * a,
int xclick,
int yclick,
Uml::SequenceMessage::Enum sequenceMessageType,
Uml::ID::Type id = Uml::ID::None )

Constructs a Lost or Found MessageWidget.

Parameters
sceneThe parent to this class.
aThe role A widget for this message.
xclickThe horizontal position clicked by the user
yclickThe vertical position clicked by the user
sequenceMessageTypeWhether lost or found
idThe ID to assign (-1 will prompt a new ID.)
Here is the call graph for this function:

◆ ~MessageWidget()

MessageWidget::~MessageWidget ( )
virtual

Standard destructor.

Member Function Documentation

◆ activate()

bool MessageWidget::activate ( IDChangeLog * Log = nullptr)
virtual

Activates a MessageWidget. Connects its m_pOw[] pointers to UMLObjects and also send signals about its FloatingTextWidget.

Reimplemented from UMLWidget.

Here is the call graph for this function:

◆ calculateDimensions()

void MessageWidget::calculateDimensions ( )

Calculates the size of the widget by calling calculateDimensionsSynchronous(), calculateDimensionsAsynchronous(), or calculateDimensionsCreation()

Here is the call graph for this function:

◆ calculateDimensionsAsynchronous()

void MessageWidget::calculateDimensionsAsynchronous ( )

Calculates and sets the size of the widget for an asynchronous message.

Here is the call graph for this function:

◆ calculateDimensionsCreation()

void MessageWidget::calculateDimensionsCreation ( )

Calculates and sets the size of the widget for a creation message.

Here is the call graph for this function:

◆ calculateDimensionsDestroy()

void MessageWidget::calculateDimensionsDestroy ( )

Calculates and sets the size of the widget for a destroy message.

Here is the call graph for this function:

◆ calculateDimensionsFound()

void MessageWidget::calculateDimensionsFound ( )

Calculates and sets the size of the widget for a found message.

Here is the call graph for this function:

◆ calculateDimensionsLost()

void MessageWidget::calculateDimensionsLost ( )

Calculates and sets the size of the widget for a lost message.

Here is the call graph for this function:

◆ calculateDimensionsSynchronous()

void MessageWidget::calculateDimensionsSynchronous ( )

Calculates and sets the size of the widget for a synchronous message.

Here is the call graph for this function:

◆ calculateWidget()

void MessageWidget::calculateWidget ( )

Calculate the geometry of the widget.

Here is the call graph for this function:

◆ cleanup()

void MessageWidget::cleanup ( )
virtual

Used to cleanup any other widget it may need to delete.

Reimplemented from UMLWidget.

Here is the call graph for this function:

◆ constrainMovementForAllWidgets()

void MessageWidget::constrainMovementForAllWidgets ( qreal & diffX,
qreal & diffY )
protectedvirtual

Overridden from UMLWidget. Modifies the value of the diffX and diffY variables used to move the widgets. All the widgets are constrained to be moved only in Y axis (diffX is set to 0).

See also
constrainPositionY
Parameters
diffXThe difference between current X position and new X position.
diffYThe difference between current Y position and new Y position.

Reimplemented from UMLWidget.

Here is the call graph for this function:

◆ constrainPositionY()

qreal MessageWidget::constrainPositionY ( qreal diffY)
private

Constrains the vertical position of the message widget so it doesn't go above the bottom side of the lower object. The height of the floating text widget in the message is taken into account if there is any and it isn't empty.

Parameters
diffYThe difference between current Y position and new Y position.
Returns
The new Y position, constrained.
Here is the call graph for this function:

◆ constrainTextPos()

void MessageWidget::constrainTextPos ( qreal & textX,
qreal & textY,
qreal textWidth,
qreal textHeight,
Uml::TextRole::Enum tr )
virtual

Constrains the FloatingTextWidget X and Y values supplied. Overrides operation from LinkWidget.

Parameters
textXcandidate X value (may be modified by the constraint)
textYcandidate Y value (may be modified by the constraint)
textWidthwidth of the text
textHeightheight of the text
trUml::TextRole::Enum of the text

Implements LinkWidget.

Here is the call graph for this function:

◆ constrainX()

int MessageWidget::constrainX ( int textX,
int textWidth,
Uml::TextRole::Enum tr )
protected

Returns the textX arg with constraints applied. Auxiliary to setTextPosition() and constrainTextPos().

Here is the call graph for this function:

◆ customOpText()

QString MessageWidget::customOpText ( )
virtual

Overrides operation from LinkWidget. Required by FloatingTextWidget.

Implements LinkWidget.

◆ floatingTextWidget()

FloatingTextWidget * MessageWidget::floatingTextWidget ( )
inline

Returns the text widget it is related to.

Returns
The text widget we are related to.

◆ getMaxY()

int MessageWidget::getMaxY ( )

Returns the maximum height this widget should be set at on a sequence diagrams. Takes into account the widget positions it is related to.

Here is the call graph for this function:

◆ getMinY()

int MessageWidget::getMinY ( )

Returns the minimum height this widget should be set at on a sequence diagrams. Takes into account the widget positions it is related to.

Here is the call graph for this function:

◆ getxclicked()

int MessageWidget::getxclicked ( ) const
inline

Return the xclicked

◆ hasObjectWidget()

bool MessageWidget::hasObjectWidget ( ObjectWidget * w)

Check to see if the given ObjectWidget is involved in the message.

Parameters
wThe ObjectWidget to check for.
Returns
true - if is contained, false - not contained.

◆ init()

void MessageWidget::init ( )
private

Initializes key variables of the class.

◆ isInResizeArea()

bool MessageWidget::isInResizeArea ( QGraphicsSceneMouseEvent * me)
protectedvirtual

Overridden from UMLWidget. Checks if the mouse is in resize area and sets the cursor accordingly. The resize area is usually at the right bottom corner of the widget except in case of a message widget running from right to left. In that case the resize area is at the left bottom corner in order to avoid overlap with an execution rectangle at the right.

Parameters
meThe QMouseEVent to check.
Returns
true if the mouse is in resize area, false otherwise.

Reimplemented from UMLWidget.

Here is the call graph for this function:

◆ isSelf()

bool MessageWidget::isSelf ( ) const

This method determines whether the message is for "Self" for an ObjectWidget.

Return values
TrueIf both ObjectWidgets for this widget exists and are same.

◆ loadFromXMI()

bool MessageWidget::loadFromXMI ( QDomElement & qElement)
virtual

Loads from the "messagewidget" XMI element.

Reimplemented from UMLWidget.

Here is the call graph for this function:

◆ lwClassifier()

UMLClassifier * MessageWidget::lwClassifier ( )
virtual

Overrides operation from LinkWidget. Required by FloatingTextWidget.

Implements LinkWidget.

Here is the call graph for this function:

◆ lwOperationText()

QString MessageWidget::lwOperationText ( )
virtual

Overrides operation from LinkWidget. Required by FloatingTextWidget.

Implements LinkWidget.

Here is the call graph for this function:

◆ lwSetFont()

void MessageWidget::lwSetFont ( QFont font)
virtual

Implements operation from LinkWidget. Required by FloatingTextWidget.

Implements LinkWidget.

Here is the call graph for this function:

◆ minimumSize()

QSizeF MessageWidget::minimumSize ( ) const
virtual

Overrides method from UMLWidget.

Reimplemented from UMLWidget.

Here is the call graph for this function:

◆ moveWidgetBy()

void MessageWidget::moveWidgetBy ( qreal diffX,
qreal diffY )
protectedvirtual

Overridden from UMLWidget. Moves the widget to a new position using the difference between the current position and the new position. X position is ignored, and widget is only moved along Y axis. If message goes upper than the object, it's kept at this position until it should be lowered again (the unconstrained Y position is saved to know when it's the time to lower it again). If the message is a creation message, the object created is also moved to the new vertical position.

See also
constrainPositionY
Parameters
diffXThe difference between current X position and new X position (isn't used).
diffYThe difference between current Y position and new Y position.

Reimplemented from UMLWidget.

Here is the call graph for this function:

◆ objectWidget()

ObjectWidget * MessageWidget::objectWidget ( Uml::RoleType::Enum role)

Returns the related widget on the given side.

Returns
The ObjectWidget we are related to.

◆ onWidget()

UMLWidget * MessageWidget::onWidget ( const QPointF & p)
virtual

Overrides operation from UMLWidget.

Parameters
pPoint to be checked.
Returns
'this' if the point is on a part of the MessageWidget. NB In case of a synchronous message, the empty space between call line and return line does not count, i.e. if the point is located in that space the function returns NULL.

Reimplemented from WidgetBase.

Here is the call graph for this function:

◆ operation()

UMLOperation * MessageWidget::operation ( )
virtual

Implements operation from LinkWidget. Motivated by FloatingTextWidget.

Implements LinkWidget.

◆ operationOwner()

UMLClassifier * MessageWidget::operationOwner ( )
virtual

Overrides operation from LinkWidget. Required by FloatingTextWidget.

Todo
Move to LinkWidget.

Reimplemented from LinkWidget.

Here is the call graph for this function:

◆ paint()

void MessageWidget::paint ( QPainter * painter,
const QStyleOptionGraphicsItem * option,
QWidget * widget = nullptr )
virtual

Reimplemented from UMLWidget and calls other paint...() methods depending on the message type.

Reimplemented from UMLWidget.

Here is the call graph for this function:

◆ paintArrow()

void MessageWidget::paintArrow ( QPainter * p,
int x,
int y,
int w,
Qt::ArrowType direction,
bool useDottedLine = false )
staticprotected

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.

◆ paintAsynchronous()

void MessageWidget::paintAsynchronous ( QPainter * painter,
const QStyleOptionGraphicsItem * option )
protected

Draws a solid arrow line and a stick arrow head.

Here is the call graph for this function:

◆ paintCreation()

void MessageWidget::paintCreation ( QPainter * painter,
const QStyleOptionGraphicsItem * option )
protected

Draws a solid arrow line and a stick arrow head to the edge of the target object widget instead of to the sequence line.

Here is the call graph for this function:

◆ paintDestroy()

void MessageWidget::paintDestroy ( QPainter * painter,
const QStyleOptionGraphicsItem * option )
protected
Here is the call graph for this function:

◆ paintFound()

void MessageWidget::paintFound ( QPainter * painter,
const QStyleOptionGraphicsItem * option )
protected

Draws a circle and a solid arrow line and a stick arrow head.

Here is the call graph for this function:

◆ paintLost()

void MessageWidget::paintLost ( QPainter * painter,
const QStyleOptionGraphicsItem * option )
protected

Draws a solid arrow line and a stick arrow head and a circle

Here is the call graph for this function:

◆ paintSolidArrowhead()

void MessageWidget::paintSolidArrowhead ( QPainter * p,
int x,
int y,
Qt::ArrowType direction )
staticprotected

Draw a solid (triangular) arrowhead pointing in the given direction. The direction can be either Qt::LeftArrow or Qt::RightArrow.

◆ paintSynchronous()

void MessageWidget::paintSynchronous ( QPainter * painter,
const QStyleOptionGraphicsItem * option )
protected

Draws the calling arrow with filled in arrowhead, the timeline box and the returning arrow with a dashed line and stick arrowhead.

Here is the call graph for this function:

◆ resizeEvent()

void MessageWidget::resizeEvent ( QResizeEvent * re)
private

◆ resizeWidget()

void MessageWidget::resizeWidget ( qreal newW,
qreal newH )
virtual

Overridden from UMLWidget. Resizes the height of the message widget and emits the message moved signal. Message widgets can only be resized vertically, so width isn't modified.

Parameters
newWThe new width for the widget (isn't used).
newHThe new height for the widget.

Reimplemented from UMLWidget.

Here is the call graph for this function:

◆ resolveObjectWidget()

void MessageWidget::resolveObjectWidget ( IDChangeLog * log)

Resolve references of this message so they reference the correct new object widgets after paste.

Here is the call graph for this function:

◆ saveToXMI()

void MessageWidget::saveToXMI ( QXmlStreamWriter & writer)
virtual

Saves to the "messagewidget" XMI element.

Reimplemented from UMLWidget.

Here is the call graph for this function:

◆ sequenceMessageType()

Uml::SequenceMessage::Enum MessageWidget::sequenceMessageType ( ) const
inline
Returns
Whether the message is synchronous or asynchronous

◆ setCustomOpText()

void MessageWidget::setCustomOpText ( const QString & opText)
virtual

Overrides operation from LinkWidget. Required by FloatingTextWidget.

Implements LinkWidget.

◆ setFloatingTextWidget()

void MessageWidget::setFloatingTextWidget ( FloatingTextWidget * f)
inline

Sets the text widget it is related to.

Parameters
fThe text widget we are related to.

◆ setLinkAndTextPos()

void MessageWidget::setLinkAndTextPos ( )
protected

Shortcut for calling m_pFText->setLink() followed by this->setTextPosition().

Here is the call graph for this function:

◆ setMessageText()

void MessageWidget::setMessageText ( FloatingTextWidget * ft)
virtual

Overrides operation from LinkWidget. Required by FloatingTextWidget.

Parameters
ftThe text widget which to update.

Implements LinkWidget.

Here is the call graph for this function:

◆ setObjectWidget()

void MessageWidget::setObjectWidget ( ObjectWidget * ow,
Uml::RoleType::Enum role )

Sets the related widget on the given side.

Parameters
owThe ObjectWidget we are related to.
roleThe Uml::RoleType::Enum to be set for the ObjectWidget
Here is the call graph for this function:

◆ setOperation()

void MessageWidget::setOperation ( UMLOperation * op)
virtual

Implements operation from LinkWidget. Motivated by FloatingTextWidget.

Implements LinkWidget.

Here is the call graph for this function:

◆ setOperationText()

void MessageWidget::setOperationText ( const QString & op)
virtual

Overrides operation from LinkWidget. Required by FloatingTextWidget.

Parameters
opThe new operation string to set.

FIXME m_pOperation

Implements LinkWidget.

◆ setSelected()

void MessageWidget::setSelected ( bool _select)
virtual

Sets the state of whether the widget is selected.

Parameters
_selectTrue if the widget is selected.

Reimplemented from UMLWidget.

Here is the call graph for this function:

◆ setText()

void MessageWidget::setText ( FloatingTextWidget * ft,
const QString & newText )
virtual

Overrides operation from LinkWidget. Required by FloatingTextWidget.

Parameters
ftThe text widget which to update.
newTextThe new text to set.

Implements LinkWidget.

Here is the call graph for this function:

◆ setTextPosition()

void MessageWidget::setTextPosition ( )

Sets the text position relative to the sequence message.

Here is the call graph for this function:

◆ setxclicked()

void MessageWidget::setxclicked ( int xclick)

Set the xclicked

◆ setY()

void MessageWidget::setY ( qreal y)
virtual

Sets the y-coordinate. Reimplemented from UMLWidget.

Parameters
yThe y-coordinate to be set.

Reimplemented from UMLWidget.

Here is the call graph for this function:

◆ setyclicked()

void MessageWidget::setyclicked ( int yclick)

Set the yclicked

◆ showPropertiesDialog()

bool MessageWidget::showPropertiesDialog ( )
virtual

Show a properties dialog for an ObjectWidget.

Reimplemented from UMLWidget.

Here is the call graph for this function:

◆ sigMessageMoved

void MessageWidget::sigMessageMoved ( )
signal

emitted when the message widget is moved up or down slots into ObjectWidget::slotMessageMoved()

◆ slotMenuSelection

void MessageWidget::slotMenuSelection ( QAction * action)
slot
Here is the call graph for this function:

◆ slotWidgetMoved

void MessageWidget::slotWidgetMoved ( Uml::ID::Type id)
slot
Here is the call graph for this function:

◆ updateResizability()

void MessageWidget::updateResizability ( )
protected

Update the UMLWidget::m_resizable flag according to the charactersitics of this message.

Member Data Documentation

◆ m_CustomOp

QString MessageWidget::m_CustomOp
protected

◆ m_pFText

FloatingTextWidget* MessageWidget::m_pFText
private

◆ m_pOw

QPointer<ObjectWidget> MessageWidget::m_pOw[2]
private

◆ m_sequenceMessageType

Uml::SequenceMessage::Enum MessageWidget::m_sequenceMessageType
protected

Whether the message is synchronous or asynchronous

◆ m_textId

Uml::ID::Type MessageWidget::m_textId
private

◆ m_widgetAId

Uml::ID::Type MessageWidget::m_widgetAId
private

The following variables are used by loadFromXMI() as an intermediate store. activate() resolves the IDs, i.e. after activate() the variables m_pOw[] and m_pFText can be used.

◆ m_widgetBId

Uml::ID::Type MessageWidget::m_widgetBId
private

◆ m_xclicked

int MessageWidget::m_xclicked
private

◆ m_yclicked

int MessageWidget::m_yclicked
private

The documentation for this class was generated from the following files: