umbrello 26.07.70-c53146a Umbrello UML Modeller is a Unified Modelling Language (UML) diagram program based on KDE Technology

- Main Page
- Related Pages
- Modules
- Namespaces
- Classes
- Files

- Class List
- Class Index
- Class Hierarchy
- Class Members

Public Slots | Signals | Public Member Functions | Protected Member Functions | Static Protected Member Functions | Protected Attributes | Private Member Functions | Private Attributes | List of all members
MessageWidget Class Reference

Displays a message. More...

`#include <messagewidget.h>`

Inheritance 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 UMLClassifier * | operationOwner ()
virtual UMLOperation * | operation ()
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 UMLClassifier * | lwClassifier ()
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)
ObjectWidget * | objectWidget (Uml::RoleType::Enum role)
void | setObjectWidget (ObjectWidget *ow, Uml::RoleType::Enum role)
bool | isSelf () const
FloatingTextWidget * | floatingTextWidget ()
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
UMLWidget * | onWidget (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 ()
UMLWidget & | operator= (const UMLWidget &other)
bool | operator== (const UMLWidget &other) const
virtual QSizeF | minimumSize () 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)
virtual void | setSelected (bool _select)
void | setScene (UMLScene *scene)
virtual bool | activate (IDChangeLog *changeLog=nullptr)
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)
virtual void | setY (qreal y)
qreal | height () const
qreal | width () const
void | setSize (qreal width, qreal height)
void | setSize (const QSizeF &size)
virtual void | resizeWidget (qreal newW, qreal newH)
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)
AssociationWidgetList & | associationWidgetList () 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 bool | showPropertiesDialog ()
virtual void | adjustAssocs (qreal dx, qreal dy)
virtual void | adjustUnselectedAssocs (qreal dx, qreal dy)
bool | isActivated () const
void | setActivated (bool active=true)
virtual void | cleanup ()
void | updateGeometry (bool withAssocs=true)
void | clipSize ()
void | forceUpdateFontMetrics (QPainter *painter)
void | forceUpdateFontMetrics (QFont &font, QPainter *painter)
virtual bool | loadFromXMI (QDomElement &qElement)
virtual void | saveToXMI (QXmlStreamWriter &writer)
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)
virtual void | paint (QPainter *painter, const QStyleOptionGraphicsItem *option, QWidget *widget=nullptr)
Public Member Functions inherited from WidgetBase
| WidgetBase (UMLScene *scene, WidgetType type=wt_UMLWidget, Uml::ID::Type id=Uml::ID::None)
virtual | ~WidgetBase ()
UMLObject * | umlObject () 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 UMLWidget * | widgetWithID (Uml::ID::Type id)
WidgetType | baseType () const
void | setBaseType (const WidgetType &baseType)
QLatin1String | baseTypeStr () const
QString | baseTypeStrWithoutPrefix () const
virtual void | setSelected (bool select)
UMLScene * | umlScene () const
UMLDoc * | umlDoc () 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
virtual void | setLineColor (const QColor &color)
uint | lineWidth () const
virtual void | setLineWidth (uint width)
QColor | textColor () const
virtual void | setTextColor (const QColor &color)
QColor | fillColor () const
virtual void | setFillColor (const QColor &color)
bool | usesDiagramLineColor () const
void | setUsesDiagramLineColor (bool state)
bool | usesDiagramLineWidth () const
void | setUsesDiagramLineWidth (bool state)
bool | useFillColor () const
virtual void | setUseFillColor (bool state)
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
virtual void | setFont (const QFont &font)
bool | autoResize () const
void | setAutoResize (bool state)
bool | changesShape () const
void | setChangesShape (bool state)
bool | highLighted () const
void | setHighLighted (bool state)
virtual bool | showPropertiesDialog ()
virtual bool | loadFromXMI (QDomElement &qElement)
virtual void | saveToXMI (QXmlStreamWriter &writer)
virtual void | removeAssoc (AssociationWidget *pAssoc)
virtual void | addAssoc (AssociationWidget *pAssoc)
WidgetBase & | operator= (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
virtual UMLWidget * | onWidget (const QPointF &p)
virtual void | paint (QPainter *painter, const QStyleOptionGraphicsItem *option, QWidget *widget=nullptr)
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
ActivityWidget * | asActivityWidget ()
ActorWidget * | asActorWidget ()
ArtifactWidget * | asArtifactWidget ()
AssociationWidget * | asAssociationWidget ()
BoxWidget * | asBoxWidget ()
CategoryWidget * | asCategoryWidget ()
ClassifierWidget * | asClassifierWidget ()
CombinedFragmentWidget * | asCombinedFragmentWidget ()
ComponentWidget * | asComponentWidget ()
DatatypeWidget * | asDatatypeWidget ()
EntityWidget * | asEntityWidget ()
EnumWidget * | asEnumWidget ()
FloatingDashLineWidget * | asFloatingDashLineWidget ()
ForkJoinWidget * | asForkJoinWidget ()
InterfaceWidget * | asInterfaceWidget ()
MessageWidget * | asMessageWidget ()
NodeWidget * | asNodeWidget ()
NoteWidget * | asNoteWidget ()
ObjectNodeWidget * | asObjectNodeWidget ()
ObjectWidget * | asObjectWidget ()
PackageWidget * | asPackageWidget ()
PinWidget * | asPinWidget ()
PinPortBase * | asPinPortBase ()
PortWidget * | asPortWidget ()
PreconditionWidget * | asPreconditionWidget ()
RegionWidget * | asRegionWidget ()
SignalWidget * | asSignalWidget ()
StateWidget * | asStateWidget ()
FloatingTextWidget * | asFloatingTextWidget ()
UseCaseWidget * | asUseCaseWidget ()
UMLWidget * | asUMLWidget ()
const ActivityWidget * | asActivityWidget () const
const ActorWidget * | asActorWidget () const
const ArtifactWidget * | asArtifactWidget () const
const AssociationWidget * | asAssociationWidget () const
const BoxWidget * | asBoxWidget () const
const CategoryWidget * | asCategoryWidget () const
const ClassifierWidget * | asClassifierWidget () const
const CombinedFragmentWidget * | asCombinedFragmentWidget () const
const ComponentWidget * | asComponentWidget () const
const DatatypeWidget * | asDatatypeWidget () const
const EntityWidget * | asEntityWidget () const
const EnumWidget * | asEnumWidget () const
const FloatingDashLineWidget * | asFloatingDashLineWidget () const
const ForkJoinWidget * | asForkJoinWidget () const
const InterfaceWidget * | asInterfaceWidget () const
const MessageWidget * | asMessageWidget () const
const NodeWidget * | asNodeWidget () const
const NoteWidget * | asNoteWidget () const
const ObjectNodeWidget * | asObjectNodeWidget () const
const ObjectWidget * | asObjectWidget () const
const PackageWidget * | asPackageWidget () const
const PinWidget * | asPinWidget () const
const PinPortBase * | asPinPortBase () const
const PortWidget * | asPortWidget () const
const PreconditionWidget * | asPreconditionWidget () const
const RegionWidget * | asRegionWidget () const
const SignalWidget * | asSignalWidget () const
const StateWidget * | asStateWidget () const
const FloatingTextWidget * | asFloatingTextWidget () const
const UseCaseWidget * | asUseCaseWidget () const
const UMLWidget * | asUMLWidget () const
virtual bool | activate (IDChangeLog *changeLog=nullptr)
virtual void | setSelected (bool state)
Public Member Functions inherited from DiagramProxyWidget
| DiagramProxyWidget (UMLWidget *widget, qreal borderWidth=5)
virtual | ~DiagramProxyWidget ()
Uml::ID::Type | diagramLink () const
UMLScene * | linkedDiagram () const
bool | setDiagramLink (const Uml::ID::Type &id)
const QRectF & | clientRect () const
const QRectF & | sceneRect () const
void | setClientRect (const QRectF &rect)
bool | isProxyWidget () const
UMLWidget * | getProxiedWidget (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)
Public Member Functions inherited from LinkWidget
| LinkWidget ()
virtual | ~LinkWidget ()
virtual void | lwSetFont (QFont font)=0
virtual UMLClassifier * | operationOwner ()
virtual UMLOperation * | operation ()=0
virtual void | setOperation (UMLOperation *op)=0
virtual QString | customOpText ()=0
virtual void | setCustomOpText (const QString &opText)=0
QString | operationText (UMLScene *scene=nullptr)
virtual void | resetTextPositions ()
virtual void | setMessageText (FloatingTextWidget *ft)=0
virtual void | setText (FloatingTextWidget *ft, const QString &newText)=0
virtual bool | showPropertiesDialog ()
virtual QString | lwOperationText ()=0
virtual UMLClassifier * | lwClassifier ()=0
virtual void | setOperationText (const QString &op)=0
virtual void | constrainTextPos (qreal &textX, qreal &textY, qreal textWidth, qreal textHeight, Uml::TextRole::Enum tr)=0
virtual void | calculateNameTextSegment ()
void | setSequenceNumber (const QString &sequenceNumber)
QString | sequenceNumber () const
virtual bool | loadFromXMI (QDomElement &qElement)
virtual void | saveToXMI (QXmlStreamWriter &writer)

## 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 | moveWidgetBy (qreal diffX, qreal diffY)
virtual void | constrainMovementForAllWidgets (qreal &diffX, qreal &diffY)
virtual void | constrain (qreal &width, qreal &height)
virtual bool | isInResizeArea (QGraphicsSceneMouseEvent *me)
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)
virtual void | contextMenuEvent (QGraphicsSceneContextMenuEvent *event)
Protected Member Functions inherited from QGraphicsObjectWrapper
QVariant | itemChange (GraphicsItemChange change, const QVariant &value)
Protected Member Functions inherited from DiagramProxyWidget
DiagramProxyWidget & | operator= (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
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)
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) More...
bool | m_isInstance
| holds whether this widget is a component instance (i.e. on a deployment diagram) More...
Uml::ShowStereoType::Enum | m_showStereotype
| if and how the stereotype should be displayed More...
bool | m_startMove
QPointF | m_startMovePostion
QSizeF | m_startResizeSize
int | m_nPosX
UMLDoc * | m_doc
| shortcut for UMLApp::app()->document() More...
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 More...
bool | m_ignoreSnapToGrid
bool | m_ignoreSnapComponentSizeToGrid
bool | m_fixedAspectRatio
QString | m_oldStatusBarMsg
| The text in the status bar when the cursor was pressed. More...
QPointF | m_pressOffset
QPointF | m_oldPos
| The X/Y position the widget had when the movement started. More...
qreal | m_oldW
| The width/height the widget had when the resize started. More...
qreal | m_oldH
bool | m_shiftPressed
| If shift or control button were pressed in mouse press event. More...
bool | m_inMoveArea
bool | m_inResizeArea
bool | m_moved
bool | m_resized
Protected Attributes inherited from WidgetBase
UMLScene * | m_scene
QPointer< UMLObject > | m_umlObject
QString | m_Doc
| Only used if m_umlObject is not set. More...
QString | m_Text
QRectF | m_rect
| Widget size. In this rectangle, the x and y coordinates are always 0. More...
Uml::ID::Type | m_nId
Uml::ID::Type | m_nLocalID
QColor | m_textColor
| Color of the text of the widget. Is saved to XMI. More...
QColor | m_lineColor
| Color of the lines of the widget. Is saved to XMI. More...
QColor | m_fillColor
| color of the background of the widget More...
QBrush | m_brush
QFont | m_font
uint | m_lineWidth
| Width of the lines of the widget. Is saved to XMI. More...
bool | m_useFillColor
| flag indicates if the UMLWidget uses the Diagram FillColour More...
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. More...
bool | m_highLighted {false}
Protected Attributes inherited from QGraphicsObjectWrapper
bool | m_calledFromItemChange {false}
Protected Attributes inherited from LinkWidget
QString | m_SequenceNumber

## Private Member Functions

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

## Private Attributes

QPointer< ObjectWidget > | m_pOw [2]
FloatingTextWidget * | m_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

  scene | The parent to this class.
  a | The role A widget for this message.
  b | The role B widget for this message.
  y | The vertical position to display this message.
  sequenceMessageType | Whether synchronous or asynchronous
  id | A unique id used for deleting this object cleanly. The default (-1) will prompt generation of a new ID.

## ◆ MessageWidget() [2/3]

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

Constructs a MessageWidget.

Parameters

  scene | The parent to this class.
  seqMsgType | The Uml::SequenceMessage::Enum of this message widget
  id | The ID to assign (-1 will prompt a new ID.)

## ◆ 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

  scene | The parent to this class.
  a | The role A widget for this message.
  xclick | The horizontal position clicked by the user
  yclick | The vertical position clicked by the user
  sequenceMessageType | Whether lost or found
  id | The ID to assign (-1 will prompt a new ID.)

## ◆ ~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.

## ◆ calculateDimensions()

void MessageWidget::calculateDimensions | ( |  | ) |

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

## ◆ calculateDimensionsAsynchronous()

void MessageWidget::calculateDimensionsAsynchronous | ( |  | ) |

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

## ◆ calculateDimensionsCreation()

void MessageWidget::calculateDimensionsCreation | ( |  | ) |

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

## ◆ calculateDimensionsDestroy()

void MessageWidget::calculateDimensionsDestroy | ( |  | ) |

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

## ◆ calculateDimensionsFound()

void MessageWidget::calculateDimensionsFound | ( |  | ) |

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

## ◆ calculateDimensionsLost()

void MessageWidget::calculateDimensionsLost | ( |  | ) |

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

## ◆ calculateDimensionsSynchronous()

void MessageWidget::calculateDimensionsSynchronous | ( |  | ) |

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

## ◆ calculateWidget()

void MessageWidget::calculateWidget | ( |  | ) |

Calculate the geometry of the widget.

## ◆ cleanup()

void MessageWidget::cleanup | ( |  | ) |

virtual

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

Reimplemented from UMLWidget.

## ◆ constrainMovementForAllWidgets()

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

protected virtual

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

  diffX | The difference between current X position and new X position.
  diffY | The difference between current Y position and new Y position.

Reimplemented from UMLWidget.

## ◆ 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

  diffY | The difference between current Y position and new Y position.

Returns
  The new Y position, constrained.

## ◆ 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

  textX | candidate X value (may be modified by the constraint)
  textY | candidate Y value (may be modified by the constraint)
  textWidth | width of the text
  textHeight | height of the text
  tr | Uml::TextRole::Enum of the text

Implements LinkWidget.

## ◆ 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().

## ◆ 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.

## ◆ 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.

## ◆ 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

  w | The 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 | ) |

protected virtual

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

  me | The QMouseEVent to check.

Returns
  true if the mouse is in resize area, false otherwise.

Reimplemented from UMLWidget.

## ◆ isSelf()

bool MessageWidget::isSelf | ( |  | ) | const

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

Return values

  True | If both ObjectWidgets for this widget exists and are same.

## ◆ loadFromXMI()

bool MessageWidget::loadFromXMI | ( | QDomElement & | qElement | ) |

virtual

Loads from the "messagewidget" XMI element.

Reimplemented from LinkWidget.

## ◆ lwClassifier()

UMLClassifier * MessageWidget::lwClassifier | ( |  | ) |

virtual

Overrides operation from LinkWidget. Required by FloatingTextWidget.

Implements LinkWidget.

## ◆ lwOperationText()

QString MessageWidget::lwOperationText | ( |  | ) |

virtual

Overrides operation from LinkWidget. Required by FloatingTextWidget.

Implements LinkWidget.

## ◆ lwSetFont()

void MessageWidget::lwSetFont | ( | QFont | font | ) |

virtual

Implements operation from LinkWidget. Required by FloatingTextWidget.

Implements LinkWidget.

## ◆ minimumSize()

QSizeF MessageWidget::minimumSize | ( |  | ) | const

virtual

Overrides method from UMLWidget.

Reimplemented from UMLWidget.

## ◆ moveWidgetBy()

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

protected virtual

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

  diffX | The difference between current X position and new X position (isn't used).
  diffY | The difference between current Y position and new Y position.

Reimplemented from UMLWidget.

## ◆ 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

  p | Point 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.

## ◆ 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.

## ◆ 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.

## ◆ paintArrow()

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

static protected

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.

## ◆ 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.

## ◆ paintDestroy()

void MessageWidget::paintDestroy | ( | QPainter * | painter,
|  | const QStyleOptionGraphicsItem * | option
| ) |  |

protected

## ◆ paintFound()

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

protected

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

## ◆ paintLost()

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

protected

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

## ◆ paintSolidArrowhead()

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

static protected

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.

## ◆ 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

  newW | The new width for the widget (isn't used).
  newH | The new height for the widget.

Reimplemented from UMLWidget.

## ◆ resolveObjectWidget()

void MessageWidget::resolveObjectWidget | ( | IDChangeLog * | log | ) |

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

## ◆ saveToXMI()

void MessageWidget::saveToXMI | ( | QXmlStreamWriter & | writer | ) |

virtual

Saves to the "messagewidget" XMI element.

Reimplemented from LinkWidget.

## ◆ 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

  f | The text widget we are related to.

## ◆ setLinkAndTextPos()

void MessageWidget::setLinkAndTextPos | ( |  | ) |

protected

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

## ◆ setMessageText()

void MessageWidget::setMessageText | ( | FloatingTextWidget * | ft | ) |

virtual

Overrides operation from LinkWidget. Required by FloatingTextWidget.

Parameters

  ft | The text widget which to update.

Implements LinkWidget.

## ◆ setObjectWidget()

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

Sets the related widget on the given side.

Parameters

  ow | The ObjectWidget we are related to.
  role | The Uml::RoleType::Enum to be set for the ObjectWidget

## ◆ setOperation()

void MessageWidget::setOperation | ( | UMLOperation * | op | ) |

virtual

Implements operation from LinkWidget. Motivated by FloatingTextWidget.

Implements LinkWidget.

## ◆ setOperationText()

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

virtual

Overrides operation from LinkWidget. Required by FloatingTextWidget.

Parameters

  op | The 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

  _select | True if the widget is selected.

Reimplemented from UMLWidget.

## ◆ setText()

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

virtual

Overrides operation from LinkWidget. Required by FloatingTextWidget.

Parameters

  ft | The text widget which to update.
  newText | The new text to set.

Implements LinkWidget.

## ◆ setTextPosition()

void MessageWidget::setTextPosition | ( |  | ) |

Sets the text position relative to the sequence message.

## ◆ setxclicked()

void MessageWidget::setxclicked | ( | int | xclick | ) |

Set the xclicked

## ◆ setY()

void MessageWidget::setY | ( | qreal | y | ) |

virtual

Sets the y-coordinate. Reimplemented from UMLWidget.

Parameters

  y | The y-coordinate to be set.

Reimplemented from UMLWidget.

## ◆ setyclicked()

void MessageWidget::setyclicked | ( | int | yclick | ) |

Set the yclicked

## ◆ showPropertiesDialog()

bool MessageWidget::showPropertiesDialog | ( |  | ) |

virtual

Show a properties dialog for an ObjectWidget.

Reimplemented from LinkWidget.

## ◆ 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

## ◆ slotWidgetMoved

void MessageWidget::slotWidgetMoved | ( | Uml::ID::Type | id | ) |

slot

## ◆ 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:

- umbrello/umlwidgets/messagewidget.h
- umbrello/umlwidgets/messagewidget.cpp