umbrello: AssociationWidget Class Reference

umbrello 2.38.3 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 | Public Member Functions | Static Public Member Functions | Protected Member Functions | Private Member Functions | Static Private Member Functions | Private Attributes | List of all members
AssociationWidget Class Reference

This class represents an association inside a diagram. Bugs and comments to umbre.nosp@m.llo-.nosp@m.devel.nosp@m.@kde.nosp@m..org or https://bugs.kde.org. More...

`#include <associationwidget.h>`

Inheritance diagram for AssociationWidget:

## Public Slots
virtual void | slotMenuSelection (QAction *action)
void | slotClassifierListItemRemoved (UMLClassifierListItem *obj)
void | slotAttributeChanged ()
void | syncToModel ()
Public Slots inherited from WidgetBase
virtual void | slotMenuSelection (QAction *trigger)

## Public Member Functions
virtual | ~AssociationWidget ()
virtual void | setUMLObject (UMLObject *obj)
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 | resetTextPositions ()
virtual void | setMessageText (FloatingTextWidget *ft)
virtual void | setText (FloatingTextWidget *ft, const QString &newText)
virtual bool | showPropertiesDialog ()
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)
virtual void | calculateNameTextSegment ()
UMLAssociation * | association () const
UMLAttribute * | attribute () const
bool | operator== (const AssociationWidget &other) const
bool | operator!= (AssociationWidget &other) const
FloatingTextWidget * | textWidgetByRole (Uml::TextRole::Enum tr) const
FloatingTextWidget * | nameWidget () const
QString | name () const
void | setName (const QString &strRole)
void | setStereotype (const QString &stereo)
FloatingTextWidget * | roleWidget (Uml::RoleType::Enum role) const
QString | roleName (Uml::RoleType::Enum role) const
void | setRoleName (const QString &strRole, Uml::RoleType::Enum role)
QString | roleDocumentation (Uml::RoleType::Enum role) const
void | setRoleDocumentation (const QString &doc, Uml::RoleType::Enum role)
FloatingTextWidget * | multiplicityWidget (Uml::RoleType::Enum role) const
QString | multiplicity (Uml::RoleType::Enum role) const
void | setMultiplicity (const QString &text, Uml::RoleType::Enum role)
Uml::Visibility::Enum | visibility (Uml::RoleType::Enum role) const
void | setVisibility (Uml::Visibility::Enum value, Uml::RoleType::Enum role)
FloatingTextWidget * | changeabilityWidget (Uml::RoleType::Enum role) const
Uml::Changeability::Enum | changeability (Uml::RoleType::Enum role) const
void | setChangeability (Uml::Changeability::Enum value, Uml::RoleType::Enum role)
Uml::ID::Type | widgetIDForRole (Uml::RoleType::Enum role) const
Uml::ID::Type | widgetLocalIDForRole (Uml::RoleType::Enum role) const
UMLWidget * | widgetForRole (Uml::RoleType::Enum role) const
void | setWidgetForRole (UMLWidget *widget, Uml::RoleType::Enum role)
bool | containsAsEndpoint (UMLWidget *widget)
Uml::AssociationType::Enum | associationType () const
void | setAssociationType (Uml::AssociationType::Enum type)
bool | isCollaboration () const
bool | isSelf () const
QString | toString () const
bool | isActivated () const
void | setActivated (bool active)
const AssociationLine & | associationLine () const
AssociationLine & | associationLine ()
virtual bool | activate (IDChangeLog *changeLog=0)
virtual QRectF | boundingRect () const
virtual QPainterPath | shape () const
void | widgetMoved (UMLWidget *widget, qreal x, qreal y)
void | saveIdealTextPositions ()
UMLWidget * | onWidget (const QPointF &p)
bool | onAssociation (const QPointF &point)
bool | onAssocClassLine (const QPointF &point)
void | createAssocClassLine ()
void | createAssocClassLine (ClassifierWidget *classifierWidget, int linePathSegmentIndex)
void | selectAssocClassLine (bool sel=true)
void | removeAssocClassLine ()
void | computeAssocClassLine ()
void | setXEntireAssoc (qreal x)
void | setYEntireAssoc (qreal y)
void | moveMidPointsBy (qreal x, qreal y)
void | moveEntireAssoc (qreal x, qreal y)
QFont | font () const
virtual void | setTextColor (const QColor &color)
virtual void | setLineColor (const QColor &color)
virtual void | setLineWidth (uint width)
void | calculateEndingPoints ()
void | clipSize ()
bool | loadFromXMI (QDomElement &qElement, const UMLWidgetList &widgets, const MessageWidgetList *messages)
virtual bool | loadFromXMI (QDomElement &qElement)
virtual void | saveToXMI (QXmlStreamWriter &writer)
void | cleanup ()
bool | isPointAddable ()
| Return state if the association line point in the vicinity of the last context menu event position is addable or not. A point is addable if the association is not an Exception and there is no point nearby.
bool | isPointRemovable ()
| Return state if the association line point in the vicinity of the last context menu event position is removable or not. A point is removable if the association is not an Exception and is not the start or end point.
bool | isAutoLayouted ()
bool | isLayoutChangeable ()
virtual void | mouseDoubleClickEvent (QGraphicsSceneMouseEvent *event)
virtual void | mouseMoveEvent (QGraphicsSceneMouseEvent *event)
virtual void | mousePressEvent (QGraphicsSceneMouseEvent *event)
virtual void | mouseReleaseEvent (QGraphicsSceneMouseEvent *event)
virtual void | setSelected (bool _select)
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)
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=0)
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=0)
virtual void | setSelected (bool state)
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=0)
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)

## Static Public Member Functions
static AssociationWidget * | create (UMLScene *scene)
static AssociationWidget * | create (UMLScene *scene, UMLWidget *WidgetA, Uml::AssociationType::Enum assocType, UMLWidget *WidgetB, UMLObject *umlobject=0)
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)

## Protected Member Functions
virtual void | contextMenuEvent (QGraphicsSceneContextMenuEvent *event)
virtual void | hoverEnterEvent (QGraphicsSceneHoverEvent *event)
virtual void | hoverLeaveEvent (QGraphicsSceneHoverEvent *event)
virtual void | hoverMoveEvent (QGraphicsSceneHoverEvent *event)
virtual void | contextMenuEvent (QGraphicsSceneContextMenuEvent *event)
Protected Member Functions inherited from QGraphicsObjectWrapper
QVariant | itemChange (GraphicsItemChange change, const QVariant &value)

## Private Member Functions
QPointF | calculateTextPosition (Uml::TextRole::Enum role)
void | setTextPosition (Uml::TextRole::Enum role)
void | setTextPositionRelatively (Uml::TextRole::Enum role, const QPointF &oldPosition)
void | setFloatingText (Uml::TextRole::Enum role, const QString &text, FloatingTextWidget *&ft)
| AssociationWidget (UMLScene *scene)
void | setUMLAssociation (UMLAssociation *assoc)
void | mergeAssociationDataIntoUMLRepresentation ()
void | moveEvent (QGraphicsSceneMouseEvent *me)
Uml::TextRole::Enum | calculateNameType (Uml::TextRole::Enum defaultRoleType)
void | createPointsSelfAssociation ()
void | updatePointsSelfAssociation ()
void | createPointsException ()
void | updatePointsException ()
void | setChangeWidget (const QString &strChangeWidget, Uml::RoleType::Enum role)
bool | checkAddPoint (const QPointF &scenePos)
bool | checkRemovePoint (const QPointF &scenePos)
bool | checkAutoLayoutSpline ()
bool | linePathStartsAt (const UMLWidget *widget) const
bool | linePathEndsAt (const UMLWidget *widget) const

## Static Private Member Functions
static Uml::Region::Enum | findPointRegion (const QRectF &rect, const QPointF &pos)
static bool | findIntercept (const QRectF &rect, const QPointF &point, QPointF &result)
static QLineF::IntersectType | intersect (const QRectF &rect, const QLineF &line, QPointF *intersectionPoint)
static QPointF | swapXY (const QPointF &p)
static QPointF | midPoint (const QPointF &p0, const QPointF &p1)
static bool | setStartAndEndPoint (AssociationWidget *assocwidget, UMLWidget *pWidget)
static void | updateAssociations (UMLWidget *pWidget, AssociationWidgetList list)

## Private Attributes
bool | m_activated
| flag which is true if the activate method has been called for this class instance
int | m_unNameLineSegment
QPointF | m_oldNamePoint
| Position of name floatingtext saved by saveIdealTextPositions()
QPointF | m_oldMultiAPoint
| Position of role A multiplicity floatingtext saved by saveIdealTextPositions()
QPointF | m_oldMultiBPoint
| Position of role B multiplicity floatingtext saved by saveIdealTextPositions()
QPointF | m_oldChangeAPoint
| Position of role A changeability floatingtext saved by saveIdealTextPositions()
QPointF | m_oldChangeBPoint
| Position of role B changeability floatingtext saved by saveIdealTextPositions()
QPointF | m_oldRoleAPoint
| Position of role A name floatingtext saved by saveIdealTextPositions()
QPointF | m_oldRoleBPoint
| Position of role B name floatingtext saved by saveIdealTextPositions()
int | m_nLinePathSegmentIndex
| anchor for m_pAssocClassLine
QGraphicsLineItem * | m_pAssocClassLine
| used for connecting assoc. class
QGraphicsRectItem * | m_pAssocClassLineSel0
| selection decoration for the start point of the assoc. class line
QGraphicsRectItem * | m_pAssocClassLineSel1
| selection decoration for the end point of the assoc. class line
AssociationLine | m_associationLine
| the definition points for the association line
ClassifierWidget * | m_associationClass
| used if we have an assoc. class
Uml::AssociationType::Enum | m_associationType
| is only used if m_pObject is not set
AssociationWidgetRole | m_role [2]
FloatingTextWidget * | m_nameWidget
| displays the name of this association
QPointF | m_eventScenePos
| holds scene pos of contextMenuEvent()

## Additional Inherited Members
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 }
Protected Attributes inherited from WidgetBase
UMLScene * | m_scene
QPointer< UMLObject > | m_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}
Protected Attributes inherited from LinkWidget
QString | m_SequenceNumber

## Detailed Description

This class represents an association inside a diagram. Bugs and comments to umbre.nosp@m.llo-.nosp@m.devel.nosp@m.@kde.nosp@m..org or https://bugs.kde.org.

This class represents an association inside a diagram.

Constructor is made non accessible: Users shall use the static create() methods for constructing AssociationWidgets.

Associations exist not only between UML objects. For example, when a Note is attached to a UML object, the Note itself is not a UML object. This class supports both kinds of associations. An association where one or both roles are not a UML object is called a "pure widget association".

An AssociationWidget where both roles are UML objects has a corresponding UMLAssociation. The UMLAssociation can be retrieved using the getAssociation method. A pure widget association does not have a corresponding UMLAssociation. The getAssociation method returns NULL in this case.

Author
  Gustavo Madrigal
  Gopala Krishna

## Constructor & Destructor Documentation

## ◆ ~AssociationWidget()

AssociationWidget::~AssociationWidget | ( |  | ) |
| virtual

Destructor.

## ◆ AssociationWidget()

AssociationWidget::AssociationWidget | ( | UMLScene * | scene | ) |
| private

Constructor is private because the static create() methods shall be used for constructing AssociationWidgets.

Parameters

  scene | The parent view of this widget.

## Member Function Documentation

## ◆ activate()

bool AssociationWidget::activate | ( | IDChangeLog * | changeLog = `0` | ) |
| virtual

Activates the AssociationWidget after a load.

Returns
  true for success

Reimplemented from WidgetBase.

## ◆ association()

UMLAssociation * AssociationWidget::association | ( |  | ) | const

Returns the UMLAssociation representation of this object.

Returns
  Pointer to the UMLAssociation that is represented by this AsociationWidget.

## ◆ associationLine() [1/2]

AssociationLine & AssociationWidget::associationLine | ( |  | ) |

Returns a writable reference to the association widget's line path.

## ◆ associationLine() [2/2]

const AssociationLine & AssociationWidget::associationLine | ( |  | ) | const

Returns a const reference to the association widget's line path.

## ◆ associationType()

Uml::AssociationType::Enum AssociationWidget::associationType | ( |  | ) | const

Gets the association's type.

Returns
  This AssociationWidget's AssociationType::Enum.

## ◆ attribute()

UMLAttribute * AssociationWidget::attribute | ( |  | ) | const

Returns the UMLAttribute representation of this object.

Returns
  Pointer to the UMLAttribute that is represented by this AsociationWidget.

## ◆ boundingRect()

QRectF AssociationWidget::boundingRect | ( |  | ) | const
| virtual

Returns the bounding rectangle of all segments of the association.

Reimplemented from WidgetBase.

## ◆ calculateEndingPoints()

void AssociationWidget::calculateEndingPoints | ( |  | ) |

This function acts as delegator to the static method updateAssociations() but additionally handles object bound special cases (self association, exception association, associationline insufficient points, association class connecting line).

## ◆ calculateNameTextSegment()

void AssociationWidget::calculateNameTextSegment | ( |  | ) |
| virtual

Calculates the m_unNameLineSegment index according to m_nameWidget middle point PT. It iterates through all AssociationLine's segments and for each one calculates the sum of PT's distance to the start point + PT's distance to the end point. The segment with the smallest sum will be the RoleTextSegment (if this segment moves then the RoleText will move with it). It sets m_unNameLineSegment to the start point of the chosen segment.

Overrides operation from LinkWidget (i.e. this method is also required by FloatingTextWidget.)

Reimplemented from LinkWidget.

## ◆ calculateNameType()

Uml::TextRole::Enum AssociationWidget::calculateNameType | ( | Uml::TextRole::Enum | defaultRole | ) |
| private

This function calculates which role should be set for the m_nameWidget FloatingTextWidget.

## ◆ calculateTextPosition()

QPointF AssociationWidget::calculateTextPosition | ( | Uml::TextRole::Enum | role | ) |
| private

Calculates the position of the text widget depending on the role that widget is playing. Returns the point at which to put the widget.

## ◆ changeability()

Uml::Changeability::Enum AssociationWidget::changeability | ( | Uml::RoleType::Enum | role | ) | const

Gets the changeability on the given end of the Association.

## ◆ changeabilityWidget()

FloatingTextWidget * AssociationWidget::changeabilityWidget | ( | Uml::RoleType::Enum | role | ) | const

Return the given role's changeability FloatingTextWidget widget.

## ◆ checkAddPoint()

bool AssociationWidget::checkAddPoint | ( | const QPointF & | scenePos | ) |
| private

## ◆ checkAutoLayoutSpline()

bool AssociationWidget::checkAutoLayoutSpline | ( |  | ) |
| private

## ◆ checkRemovePoint()

bool AssociationWidget::checkRemovePoint | ( | const QPointF & | scenePos | ) |
| private

Remove point close to the given point and redraw the association.

Parameters

  scenePos | point which should be removed

Returns
  success status of the remove action

## ◆ cleanup()

void AssociationWidget::cleanup | ( |  | ) |

Cleans up all the association's data in the related widgets.

## ◆ clipSize()

void AssociationWidget::clipSize | ( |  | ) |

## ◆ computeAssocClassLine()

void AssociationWidget::computeAssocClassLine | ( |  | ) |

Compute the end points of m_pAssocClassLine in case this association has an attached association class. TODO: Bring decoration points to life (https://bugs.kde.org/show_bug.cgi?id=447866)

## ◆ constrainTextPos()

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

Constrains the FloatingTextWidget X and Y values supplied. Implements the abstract 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::Text_Role of the text.

Implements LinkWidget.

## ◆ containsAsEndpoint()

bool AssociationWidget::containsAsEndpoint | ( | UMLWidget * | widget | ) |

Returns true if the Widget is either at the starting or ending side of the association.

## ◆ contextMenuEvent()

void AssociationWidget::contextMenuEvent | ( | QGraphicsSceneContextMenuEvent * | event | ) |
| protectedvirtual

Event handler for context menu events, called from the line segments.

Reimplemented from WidgetBase.

## ◆ create() [1/2]

AssociationWidget * AssociationWidget::create | ( | UMLScene * | scene | ) |
| static

This constructor is only for loading from XMI, otherwise it should not be used as it creates an incomplete associationwidget.

Parameters

  scene | The parent view of this widget.

## ◆ create() [2/2]

AssociationWidget * AssociationWidget::create | ( | UMLScene * | scene,
|  | UMLWidget * | pWidgetA,
|  | Uml::AssociationType::Enum | assocType,
|  | UMLWidget * | pWidgetB,
|  | UMLObject * | umlobject = `0`
| ) |  |
| static

Preferred constructor (static factory method.)

Parameters

  scene | The parent view of this widget.
  pWidgetA | Pointer to the role A widget for the association.
  assocType | The AssociationType::Enum for this association.
  pWidgetB | Pointer to the role B widget for the association.
  umlobject | Pointer to the underlying UMLObject (if applicable.)

## ◆ createAssocClassLine() [1/2]

void AssociationWidget::createAssocClassLine | ( |  | ) |

Creates the association class connecting line.

## ◆ createAssocClassLine() [2/2]

void AssociationWidget::createAssocClassLine | ( | ClassifierWidget * | classifier,
|  | int | linePathSegmentIndex
| ) |  |

Creates the association class connecting line using the specified ClassifierWidget.

Parameters

  classifier | The ClassifierWidget to use.
  linePathSegmentIndex | The index of the segment where the association class is created.

## ◆ createPointsException()

void AssociationWidget::createPointsException | ( |  | ) |
| private

Creates the points of the association exception. Method called when a widget end points are calculated by calculateEndingPoints().

## ◆ createPointsSelfAssociation()

void AssociationWidget::createPointsSelfAssociation | ( |  | ) |
| private

Creates the points of the self association. Method called when widget end points are calculated by calculateEndingPoints().

## ◆ customOpText()

QString AssociationWidget::customOpText | ( |  | ) |
| virtual

Overrides operation from LinkWidget. Required by FloatingTextWidget.

Implements LinkWidget.

## ◆ findIntercept()

bool AssociationWidget::findIntercept | ( | const QRectF & | rect,
|  | const QPointF & | point,
|  | QPointF & | result
| ) |  |
| staticprivate

Given a rectangle and a point, compute the connecting line between the middle point of the rectangle and the point, and return the intersection point of this line with one of the sides of the rectangle.

Parameters

  rect | rolewidget's rectangle with scene x and y values
  point | ending point of the line that starts at rect's center
  result | return value: intersection point with one of rect's sides

Returns
  false if none of rect's sides intersects with point; in this case, result will remain at the value passed in.

## ◆ findPointRegion()

Uml::Region::Enum AssociationWidget::findPointRegion | ( | const QRectF & | rect,
|  | const QPointF & | pos
| ) |  |
| staticprivate

Finds out which region of rectangle 'rect' contains the point 'pos' and returns the region number: 1 = Region 1 (West) 2 = Region 2 (North) 3 = Region 3 (East) 4 = Region 4 (South) 5 = On diagonal 2 between Region 1 and 2 (NorthWest) 6 = On diagonal 1 between Region 2 and 3 (NorthEast) 7 = On diagonal 2 between Region 3 and 4 (SouthEast) 8 = On diagonal 1 between Region 4 and 1 (SouthWest) 9 = On diagonal 1 and on diagonal 2 (Center)

## ◆ font()

QFont AssociationWidget::font | ( |  | ) | const
| virtual

Return the first font found being used by any child widget. (They could be different fonts, so this is a slightly misleading method.)

Reimplemented from WidgetBase.

## ◆ hoverEnterEvent()

void AssociationWidget::hoverEnterEvent | ( | QGraphicsSceneHoverEvent * | event | ) |
| protectedvirtual

Reimplemented event handler for hover enter events.

## ◆ hoverLeaveEvent()

void AssociationWidget::hoverLeaveEvent | ( | QGraphicsSceneHoverEvent * | event | ) |
| protectedvirtual

Reimplemented event handler for hover leave events.

## ◆ hoverMoveEvent()

void AssociationWidget::hoverMoveEvent | ( | QGraphicsSceneHoverEvent * | event | ) |
| protectedvirtual

Reimplemented event handler for hover move events.

## ◆ intersect()

QLineF::IntersectType AssociationWidget::intersect | ( | const QRectF & | rect,
|  | const QLineF & | line,
|  | QPointF * | intersectionPoint
| ) |  |
| staticprivate

Returns the Region the widget to line intersection is for the given widget in this Association. If the given widget is not in the Association then Region::Error is returned. Used by calculateEndingPoints to work these positions out for another Association - since the number of Associations on the same region for the same widget will mean the lines will need to be spread out across the region.

Find the border point of the given rect when a line is drawn from the given point to the rect.

Parameters

  rect | rect of a classifier
  line | a line to the rect
  intersectionPoint | the intercept point on the border of the rect

Returns
  the QLineF::IntersectType of the intersection

## ◆ isActivated()

bool AssociationWidget::isActivated | ( |  | ) | const

Read property of bool m_activated.

## ◆ isAutoLayouted()

bool AssociationWidget::isAutoLayouted | ( |  | ) |

## ◆ isCollaboration()

bool AssociationWidget::isCollaboration | ( |  | ) | const

Returns true if this AssociationWidget represents a collaboration message.

## ◆ isLayoutChangeable()

bool AssociationWidget::isLayoutChangeable | ( |  | ) |

if layout of this widget can be changed

Returns
  true if layout could be changed
  false if layout could not be changed

## ◆ isPointAddable()

bool AssociationWidget::isPointAddable | ( |  | ) |

Return state if the association line point in the vicinity of the last context menu event position is addable or not. A point is addable if the association is not an Exception and there is no point nearby.

Returns
  true if point is addable

## ◆ isPointRemovable()

bool AssociationWidget::isPointRemovable | ( |  | ) |

Return state if the association line point in the vicinity of the last context menu event position is removable or not. A point is removable if the association is not an Exception and is not the start or end point.

Returns
  true if point is removable

## ◆ isSelf()

bool AssociationWidget::isSelf | ( |  | ) | const

Returns true if this AssociationWidget represents a self message.

## ◆ linePathEndsAt()

bool AssociationWidget::linePathEndsAt | ( | const UMLWidget * | widget | ) | const
| private

Returns true if the line path ends at the given widget.

## ◆ linePathStartsAt()

bool AssociationWidget::linePathStartsAt | ( | const UMLWidget * | widget | ) | const
| private

Returns true if the line path starts at the given widget.

## ◆ loadFromXMI() [1/2]

bool AssociationWidget::loadFromXMI | ( | QDomElement & | qElement | ) |
| virtual

Queries the UMLView for resolving the role A and role B widgets. ....

Reimplemented from WidgetBase.

## ◆ loadFromXMI() [2/2]

bool AssociationWidget::loadFromXMI | ( | QDomElement & | qElement,
|  | const UMLWidgetList & | widgets,
|  | const MessageWidgetList * | messages
| ) |  |

Uses the supplied widgetList for resolving the role A and role B widgets. (The other loadFromXMI() queries the UMLScene for these widgets.) Required for clipboard operations.

## ◆ lwClassifier()

UMLClassifier * AssociationWidget::lwClassifier | ( |  | ) |
| virtual

Overrides operation from LinkWidget. Required by FloatingTextWidget.

Returns
  classifier

Implements LinkWidget.

## ◆ lwOperationText()

QString AssociationWidget::lwOperationText | ( |  | ) |
| virtual

Overrides operation from LinkWidget. Required by FloatingTextWidget.

Implements LinkWidget.

## ◆ lwSetFont()

void AssociationWidget::lwSetFont | ( | QFont | font | ) |
| virtual

Set all 'owned' child widgets to this font.

Implements LinkWidget.

## ◆ mergeAssociationDataIntoUMLRepresentation()

void AssociationWidget::mergeAssociationDataIntoUMLRepresentation | ( |  | ) |
| private

Merges/syncs the association widget data into UML object representation. This will synchronize UMLAssociation w/ this new Widget CHECK: Can we get rid of this.

## ◆ midPoint()

QPointF AssociationWidget::midPoint | ( | const QPointF & | p0,
|  | const QPointF & | p1
| ) |  |
| staticprivate

Return the mid point between p0 and p1

## ◆ mouseDoubleClickEvent()

void AssociationWidget::mouseDoubleClickEvent | ( | QGraphicsSceneMouseEvent * | event | ) |
| virtual

Adds a break point (if left mouse button).

## ◆ mouseMoveEvent()

void AssociationWidget::mouseMoveEvent | ( | QGraphicsSceneMouseEvent * | me | ) |
| virtual

Moves the break point being dragged.

## ◆ mousePressEvent()

void AssociationWidget::mousePressEvent | ( | QGraphicsSceneMouseEvent * | me | ) |
| virtual

Sets the association to be selected.

## ◆ mouseReleaseEvent()

void AssociationWidget::mouseReleaseEvent | ( | QGraphicsSceneMouseEvent * | me | ) |
| virtual

Displays the right mouse buttom menu if right button is pressed.

## ◆ moveEntireAssoc()

void AssociationWidget::moveEntireAssoc | ( | qreal | x,
|  | qreal | y
| ) |  |

Moves the entire association by the given offset.

## ◆ moveEvent()

void AssociationWidget::moveEvent | ( | QGraphicsSceneMouseEvent * | me | ) |
| private

Overrides moveEvent.

Todo:
  avoid trigger of this event during load

## ◆ moveMidPointsBy()

void AssociationWidget::moveMidPointsBy | ( | qreal | x,
|  | qreal | y
| ) |  |

Moves all the mid points (all except start /end) by the given amount.

## ◆ multiplicity()

QString AssociationWidget::multiplicity | ( | Uml::RoleType::Enum | role | ) | const

Return the given role's multiplicity text.

Returns
  Text of the given role's multiplicity widget.

## ◆ multiplicityWidget()

FloatingTextWidget * AssociationWidget::multiplicityWidget | ( | Uml::RoleType::Enum | role | ) | const

Return the multiplicity FloatingTextWidget widget of the given role.

Returns
  Pointer to the multiplicity FloatingTextWidget object.

## ◆ name()

QString AssociationWidget::name | ( |  | ) | const

Returns the m_nameWidget's text.

Returns
  Text of the FloatingTextWidget name widget.

## ◆ nameWidget()

FloatingTextWidget * AssociationWidget::nameWidget | ( |  | ) | const

Read property of FloatingTextWidget* m_nameWidget.

Returns
  Pointer to the FloatingTextWidget name widget.

## ◆ onAssocClassLine()

bool AssociationWidget::onAssocClassLine | ( | const QPointF & | point | ) |

Returns true if the given point is on the connecting line to the association class. Returns false if there is no association class attached, or if the given point is not on the connecting line.

## ◆ onAssociation()

bool AssociationWidget::onAssociation | ( | const QPointF & | point | ) |

Returns true if the given point is on the association line. A circle (rectangle) around the point is used to obtain more tolerance.

Parameters

  point | the point to check

Returns
  flag whether point is on association line

## ◆ onWidget()

UMLWidget * AssociationWidget::onWidget | ( | const QPointF & | p | ) |
| virtual

Reimplement method from WidgetBase in order to check owned floating texts.

Parameters

  p | Point to be checked.

Returns
  pointer to widget at the provided point
  0 is no widget has been found

Reimplemented from WidgetBase.

## ◆ operation()

UMLOperation * AssociationWidget::operation | ( |  | ) |
| virtual

Implements operation from LinkWidget. Motivated by FloatingTextWidget.

Implements LinkWidget.

## ◆ operationOwner()

UMLClassifier * AssociationWidget::operationOwner | ( |  | ) |
| virtual

Overrides operation from LinkWidget. Required by FloatingTextWidget.

Todo:
  Move to LinkWidget.

Reimplemented from LinkWidget.

## ◆ operator!=()

bool AssociationWidget::operator!= | ( | AssociationWidget & | other | ) | const

Overrides the != operator.

## ◆ operator==()

bool AssociationWidget::operator== | ( | const AssociationWidget & | other | ) | const

Overrides the equality test operator.

## ◆ removeAssocClassLine()

void AssociationWidget::removeAssocClassLine | ( |  | ) |

Remove dashed connecting line for association class.

## ◆ resetTextPositions()

void AssociationWidget::resetTextPositions | ( |  | ) |
| virtual

Calls setTextPosition on all the labels. Overrides operation from LinkWidget.

Reimplemented from LinkWidget.

## ◆ roleDocumentation()

QString AssociationWidget::roleDocumentation | ( | Uml::RoleType::Enum | role | ) | const

Returns the given role's documentation.

## ◆ roleName()

QString AssociationWidget::roleName | ( | Uml::RoleType::Enum | role | ) | const

Return the given role's FloatingTextWidget widget text.

Returns
  The name set at the FloatingTextWidget.

## ◆ roleWidget()

FloatingTextWidget * AssociationWidget::roleWidget | ( | Uml::RoleType::Enum | role | ) | const

Return the given role's FloatingTextWidget object.

Returns
  Pointer to the role's FloatingTextWidget widget.

## ◆ saveIdealTextPositions()

void AssociationWidget::saveIdealTextPositions | ( |  | ) |

Auxiliary method for widgetMoved(): Saves all ideally computed floatingtext positions before doing any kind of change. This is necessary because a single invocation of calculateEndingPoints() modifies the AssociationLine ending points on ALL AssociationWidgets. This means that if we don't save the old ideal positions then they are irretrievably lost as soon as calculateEndingPoints() is invoked.

## ◆ saveToXMI()

void AssociationWidget::saveToXMI | ( | QXmlStreamWriter & | writer | ) |
| virtual

Saves this widget to the "assocwidget" XMI element.

Reimplemented from WidgetBase.

## ◆ selectAssocClassLine()

void AssociationWidget::selectAssocClassLine | ( | bool | sel = `true` | ) |

Renders the association class connecting line selected.

## ◆ setActivated()

void AssociationWidget::setActivated | ( | bool | active | ) |

Set the m_activated flag of a widget but does not perform the Activate method.

## ◆ setAssociationType()

void AssociationWidget::setAssociationType | ( | Uml::AssociationType::Enum | type | ) |

Sets the association's type.

Parameters

  type | The AssociationType::Enum to set.

## ◆ setChangeability()

void AssociationWidget::setChangeability | ( | Uml::Changeability::Enum | value,
|  | Uml::RoleType::Enum | role
| ) |  |

Sets the changeability on the given end of the Association.

## ◆ setChangeWidget()

void AssociationWidget::setChangeWidget | ( | const QString & | strChangeWidget,
|  | Uml::RoleType::Enum | role
| ) |  |
| private

For internal purposes only. Other classes/users should use setChangeability() instead.

## ◆ setCustomOpText()

void AssociationWidget::setCustomOpText | ( | const QString & | opText | ) |
| virtual

Overrides operation from LinkWidget. Required by FloatingTextWidget.

Implements LinkWidget.

## ◆ setFloatingText()

void AssociationWidget::setFloatingText | ( | Uml::TextRole::Enum | role,
|  | const QString & | text,
|  | FloatingTextWidget *& | ft
| ) |  |
| private

Change, create, or delete the FloatingTextWidget indicated by the given TextRole::Enum.

Parameters

  role | TextRole::Enum of the FloatingTextWidget to change or create.
  text | Text string that controls the action: If empty and ft is NULL then setFloatingText() is a no-op. If empty and ft is non-NULL then the existing ft is deleted. If non-empty and ft is NULL then a new FloatingTextWidget is created and returned in ft with the text set. If non-empty and ft is non-NULL then the existing ft text is modified.
  ft | Reference to the pointer to FloatingTextWidget to change or create. On creation/deletion, the pointer value will be changed.

## ◆ setLineColor()

void AssociationWidget::setLineColor | ( | const QColor & | color | ) |
| virtual

Sets the line color

Parameters

  color | The new line color

Reimplemented from WidgetBase.

## ◆ setLineWidth()

void AssociationWidget::setLineWidth | ( | uint | width | ) |
| virtual

Sets the line width

Parameters

  width | The new line width

Reimplemented from WidgetBase.

## ◆ setMessageText()

void AssociationWidget::setMessageText | ( | FloatingTextWidget * | ft | ) |
| virtual

Overrides operation from LinkWidget. Required by FloatingTextWidget.

Parameters

  ft | The text widget which to update.

Implements LinkWidget.

## ◆ setMultiplicity()

void AssociationWidget::setMultiplicity | ( | const QString & | text,
|  | Uml::RoleType::Enum | role
| ) |  |

Sets the text in the FloatingTextWidget representing the multiplicity at the given side of the association.

## ◆ setName()

void AssociationWidget::setName | ( | const QString & | strName | ) |
| virtual

Sets the text in the FloatingTextWidget widget representing the Name of this association.

Reimplemented from WidgetBase.

## ◆ setOperation()

void AssociationWidget::setOperation | ( | UMLOperation * | op | ) |
| virtual

Implements operation from LinkWidget. Motivated by FloatingTextWidget.

Implements LinkWidget.

## ◆ setOperationText()

void AssociationWidget::setOperationText | ( | const QString & | op | ) |
| virtual

Overrides operation from LinkWidget. Required by FloatingTextWidget.

Parameters

  op | The new operation string to set.

Implements LinkWidget.

## ◆ setRoleDocumentation()

void AssociationWidget::setRoleDocumentation | ( | const QString & | doc,
|  | Uml::RoleType::Enum | role
| ) |  |

Set the documentation on the given role.

## ◆ setRoleName()

void AssociationWidget::setRoleName | ( | const QString & | strRole,
|  | Uml::RoleType::Enum | role
| ) |  |

Sets the text to the FloatingTextWidget that display the Role text of this association. For this function to work properly, the associated widget should already be set.

## ◆ setSelected()

void AssociationWidget::setSelected | ( | bool | _select | ) |
| virtual

Sets the state of whether the widget is selected.

Parameters

  _select | The state of whether the widget is selected.

Reimplemented from WidgetBase.

## ◆ setStartAndEndPoint()

bool AssociationWidget::setStartAndEndPoint | ( | AssociationWidget * | assocwidget,
|  | UMLWidget * | pWidget
| ) |  |
| staticprivate

## ◆ setStereotype()

void AssociationWidget::setStereotype | ( | const QString & | stereo | ) |

## ◆ setText()

void AssociationWidget::setText | ( | FloatingTextWidget * | ft,
|  | const QString & | text
| ) |  |
| virtual

Sets the text of the given FloatingTextWidget. Overrides operation from LinkWidget. Required by FloatingTextWidget.

Implements LinkWidget.

## ◆ setTextColor()

void AssociationWidget::setTextColor | ( | const QColor & | color | ) |
| virtual

Set all 'owned' child widgets to this text color.

Reimplemented from WidgetBase.

## ◆ setTextPosition()

void AssociationWidget::setTextPosition | ( | Uml::TextRole::Enum | role | ) |
| private

Puts the text widget with the given role at a recalculated position. This method calls calculateTextPosition to get the needed position. I.e. the line segment it is on has moved and its position should move the same amount as the line.

## ◆ setTextPositionRelatively()

void AssociationWidget::setTextPositionRelatively | ( | Uml::TextRole::Enum | role,
|  | const QPointF & | oldPosition
| ) |  |
| private

Moves the text widget with the given role by the difference between the two points.

## ◆ setUMLAssociation()

void AssociationWidget::setUMLAssociation | ( | UMLAssociation * | assoc | ) |
| private

Set our internal umlAssociation.

## ◆ setUMLObject()

void AssociationWidget::setUMLObject | ( | UMLObject * | obj | ) |
| virtual

Overriding the method from WidgetBase because we need to do something extra in case this AssociationWidget represents an attribute of a classifier.

Todo:
  Change WidgetBase::setUMLObject and reimplementers to return bool where `false` indicates failure. Currently, if setting the UML object fails the callers have no immediate way of knowing.

Reimplemented from WidgetBase.

## ◆ setVisibility()

void AssociationWidget::setVisibility | ( | Uml::Visibility::Enum | value,
|  | Uml::RoleType::Enum | role
| ) |  |

Sets the visibility on the given role of the association.

## ◆ setWidgetForRole()

void AssociationWidget::setWidgetForRole | ( | UMLWidget * | widget,
|  | Uml::RoleType::Enum | role
| ) |  |

Set the widget of the given role. Add this AssociationWidget at the widget. If this AssociationWidget has an underlying UMLAssociation then set the widget's underlying UMLObject at the UMLAssociation's role object.

Parameters

  widget | Pointer to the UMLWidget.
  role | Role for which to set the widget.

## ◆ setXEntireAssoc()

void AssociationWidget::setXEntireAssoc | ( | qreal | x | ) |

Set all association points to x coordinate.

## ◆ setYEntireAssoc()

void AssociationWidget::setYEntireAssoc | ( | qreal | y | ) |

Set all association points to y coordinate.

## ◆ shape()

QPainterPath AssociationWidget::shape | ( |  | ) | const
| virtual

Returns the shape of all segments of the association.

## ◆ showPropertiesDialog()

bool AssociationWidget::showPropertiesDialog | ( |  | ) |
| virtual

Shows the association properties dialog and updates the corresponding texts if its execution is successful.

Reimplemented from WidgetBase.

## ◆ slotAttributeChanged

void AssociationWidget::slotAttributeChanged | ( |  | ) |
| slot

Connected to UMLObject::modified() in case this AssociationWidget is linked to a classifer's attribute type.

## ◆ slotClassifierListItemRemoved

void AssociationWidget::slotClassifierListItemRemoved | ( | UMLClassifierListItem * | obj | ) |
| slot

Connected to UMLClassifier::attributeRemoved() or UMLEntity::constraintRemoved() in case this AssociationWidget is linked to a classifier list item (an attribute or a foreign key constraint)

Parameters

  obj | The UMLClassifierListItem removed.

## ◆ slotMenuSelection

void AssociationWidget::slotMenuSelection | ( | QAction * | action | ) |
| virtualslot

Handles the selection from the popup menu.

## ◆ swapXY()

QPointF AssociationWidget::swapXY | ( | const QPointF & | p | ) |
| staticprivate

Returns a point with interchanged X and Y coordinates.

## ◆ syncToModel

void AssociationWidget::syncToModel | ( |  | ) |
| slot

Synchronize this widget from the UMLAssociation.

## ◆ textWidgetByRole()

FloatingTextWidget * AssociationWidget::textWidgetByRole | ( | Uml::TextRole::Enum | tr | ) | const

Return the FloatingTextWidget object indicated by the given TextRole::Enum.

Returns
  Pointer to the text role's FloatingTextWidget widget.

## ◆ toString()

QString AssociationWidget::toString | ( |  | ) | const

Returns a QString Object representing this AssociationWidget.

## ◆ updateAssociations()

void AssociationWidget::updateAssociations | ( | UMLWidget * | pWidget,
|  | AssociationWidgetList | list
| ) |  |
| staticprivate

Used by calculateEndingPoints. For all association widgets of the scene, if one of the assocwidget's role widgets is the passed in widget then

- if the AssociationLine starts at the role widget then the AssociationLine start point is recalculated and set;
- if the AssociationLine ends at the role widget then the AssociationLine end point is recalculated and set.

Parameters

  pWidget | Pointer to the widget to seek as the role A or B widget in all association widgets of the scene.
  list | The association widgets to analyze/update

## ◆ updatePointsException()

void AssociationWidget::updatePointsException | ( |  | ) |
| private

Adjusts the points of the association exception. Method called when a widget was moved by widgetMoved(widget, x, y).

## ◆ updatePointsSelfAssociation()

void AssociationWidget::updatePointsSelfAssociation | ( |  | ) |
| private

Adjusts the points of the self association. Method called when a widget was moved by widgetMoved(widget, x, y).

## ◆ visibility()

Visibility::Enum AssociationWidget::visibility | ( | Uml::RoleType::Enum | role | ) | const

Gets the visibility on the given role of the association.

## ◆ widgetForRole()

UMLWidget * AssociationWidget::widgetForRole | ( | Uml::RoleType::Enum | role | ) | const

Gets the given role widget.

Returns
  Pointer to the role's UMLWidget.

## ◆ widgetIDForRole()

Uml::ID::Type AssociationWidget::widgetIDForRole | ( | Uml::RoleType::Enum | role | ) | const

Gets the ID of the given role widget.

## ◆ widgetLocalIDForRole()

Uml::ID::Type AssociationWidget::widgetLocalIDForRole | ( | Uml::RoleType::Enum | role | ) | const

Gets the local ID of the given role widget.

## ◆ widgetMoved()

void AssociationWidget::widgetMoved | ( | UMLWidget * | widget,
|  | qreal | dx,
|  | qreal | dy
| ) |  |

Adjusts the ending point of the association that connects to Widget.

Todo:
  avoid trigger of this event during load

## Member Data Documentation

## ◆ m_activated

bool AssociationWidget::m_activated
| private

flag which is true if the activate method has been called for this class instance

## ◆ m_associationClass

ClassifierWidget* AssociationWidget::m_associationClass
| private

used if we have an assoc. class

## ◆ m_associationLine

AssociationLine AssociationWidget::m_associationLine
| private

the definition points for the association line

## ◆ m_associationType

Uml::AssociationType::Enum AssociationWidget::m_associationType
| private

is only used if m_pObject is not set

## ◆ m_eventScenePos

QPointF AssociationWidget::m_eventScenePos
| private

holds scene pos of contextMenuEvent()

## ◆ m_nameWidget

FloatingTextWidget* AssociationWidget::m_nameWidget
| private

displays the name of this association

## ◆ m_nLinePathSegmentIndex

int AssociationWidget::m_nLinePathSegmentIndex
| private

anchor for m_pAssocClassLine

## ◆ m_oldChangeAPoint

QPointF AssociationWidget::m_oldChangeAPoint
| private

Position of role A changeability floatingtext saved by saveIdealTextPositions()

## ◆ m_oldChangeBPoint

QPointF AssociationWidget::m_oldChangeBPoint
| private

Position of role B changeability floatingtext saved by saveIdealTextPositions()

## ◆ m_oldMultiAPoint

QPointF AssociationWidget::m_oldMultiAPoint
| private

Position of role A multiplicity floatingtext saved by saveIdealTextPositions()

## ◆ m_oldMultiBPoint

QPointF AssociationWidget::m_oldMultiBPoint
| private

Position of role B multiplicity floatingtext saved by saveIdealTextPositions()

## ◆ m_oldNamePoint

QPointF AssociationWidget::m_oldNamePoint
| private

Position of name floatingtext saved by saveIdealTextPositions()

## ◆ m_oldRoleAPoint

QPointF AssociationWidget::m_oldRoleAPoint
| private

Position of role A name floatingtext saved by saveIdealTextPositions()

## ◆ m_oldRoleBPoint

QPointF AssociationWidget::m_oldRoleBPoint
| private

Position of role B name floatingtext saved by saveIdealTextPositions()

## ◆ m_pAssocClassLine

QGraphicsLineItem* AssociationWidget::m_pAssocClassLine
| private

used for connecting assoc. class

## ◆ m_pAssocClassLineSel0

QGraphicsRectItem* AssociationWidget::m_pAssocClassLineSel0
| private

selection decoration for the start point of the assoc. class line

## ◆ m_pAssocClassLineSel1

QGraphicsRectItem* AssociationWidget::m_pAssocClassLineSel1
| private

selection decoration for the end point of the assoc. class line

## ◆ m_role

AssociationWidgetRole AssociationWidget::m_role[2]
| private

## ◆ m_unNameLineSegment

int AssociationWidget::m_unNameLineSegment
| private

When the association has a Role Floating Text this text should move when the AssociationLine moves but only if the closest segment to the role text moves. This segment is: m_associationLine[m_unNameLineSegment] – m_associationLine[m_unNameLineSegment+1]

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

- umbrello/umlwidgets/associationwidget.h
- umbrello/umlwidgets/associationwidget.cpp