umbrello 2.38.4
Umbrello UML Modeller is a Unified Modelling Language (UML) diagram program based on KDE Technology
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:
Collaboration 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 UMLClassifieroperationOwner ()
 
virtual UMLOperationoperation ()
 
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 UMLClassifierlwClassifier ()
 
virtual void setOperationText (const QString &op)
 
virtual void constrainTextPos (qreal &textX, qreal &textY, qreal textWidth, qreal textHeight, Uml::TextRole::Enum tr)
 
virtual void calculateNameTextSegment ()
 
UMLAssociationassociation () const
 
UMLAttributeattribute () const
 
bool operator== (const AssociationWidget &other) const
 
bool operator!= (AssociationWidget &other) const
 
FloatingTextWidgettextWidgetByRole (Uml::TextRole::Enum tr) const
 
FloatingTextWidgetnameWidget () const
 
QString name () const
 
void setName (const QString &strRole)
 
void setStereotype (const QString &stereo)
 
FloatingTextWidgetroleWidget (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)
 
FloatingTextWidgetmultiplicityWidget (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)
 
FloatingTextWidgetchangeabilityWidget (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
 
UMLWidgetwidgetForRole (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 AssociationLineassociationLine () const
 
AssociationLineassociationLine ()
 
virtual bool activate (IDChangeLog *changeLog=0)
 
virtual QRectF boundingRect () const
 
virtual QPainterPath shape () const
 
void widgetMoved (UMLWidget *widget, qreal x, qreal y)
 
void saveIdealTextPositions ()
 
UMLWidgetonWidget (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 ()
 
UMLObjectumlObject () const
 
Uml::ID::Type id () const
 
void setID (Uml::ID::Type id)
 
void setLocalID (Uml::ID::Type id)
 
Uml::ID::Type localID () const
 
virtual UMLWidgetwidgetWithID (Uml::ID::Type id)
 
WidgetType baseType () const
 
void setBaseType (const WidgetType &baseType)
 
QLatin1String baseTypeStr () const
 
QString baseTypeStrWithoutPrefix () const
 
UMLSceneumlScene () const
 
UMLDocumlDoc () const
 
QString documentation () const
 
bool hasDocumentation () const
 
virtual void setDocumentation (const QString &doc)
 
QString name () const
 
QColor lineColor () const
 
uint lineWidth () const
 
QColor textColor () const
 
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 void setFont (const QFont &font)
 
bool autoResize () const
 
void setAutoResize (bool state)
 
bool changesShape () const
 
void setChangesShape (bool state)
 
virtual void removeAssoc (AssociationWidget *pAssoc)
 
virtual void addAssoc (AssociationWidget *pAssoc)
 
WidgetBaseoperator= (const WidgetBase &other)
 
QRectF rect () const
 
void setRect (const QRectF &rect)
 
void setRect (qreal x, qreal y, qreal width, qreal height)
 
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
 
ActivityWidgetasActivityWidget ()
 
ActorWidgetasActorWidget ()
 
ArtifactWidgetasArtifactWidget ()
 
AssociationWidgetasAssociationWidget ()
 
BoxWidgetasBoxWidget ()
 
CategoryWidgetasCategoryWidget ()
 
ClassifierWidgetasClassifierWidget ()
 
CombinedFragmentWidgetasCombinedFragmentWidget ()
 
ComponentWidgetasComponentWidget ()
 
DatatypeWidgetasDatatypeWidget ()
 
EntityWidgetasEntityWidget ()
 
EnumWidgetasEnumWidget ()
 
FloatingDashLineWidgetasFloatingDashLineWidget ()
 
ForkJoinWidgetasForkJoinWidget ()
 
InterfaceWidgetasInterfaceWidget ()
 
MessageWidgetasMessageWidget ()
 
NodeWidgetasNodeWidget ()
 
NoteWidgetasNoteWidget ()
 
ObjectNodeWidgetasObjectNodeWidget ()
 
ObjectWidgetasObjectWidget ()
 
PackageWidgetasPackageWidget ()
 
PinWidgetasPinWidget ()
 
PinPortBaseasPinPortBase ()
 
PortWidgetasPortWidget ()
 
PreconditionWidgetasPreconditionWidget ()
 
RegionWidgetasRegionWidget ()
 
SignalWidgetasSignalWidget ()
 
StateWidgetasStateWidget ()
 
FloatingTextWidgetasFloatingTextWidget ()
 
UseCaseWidgetasUseCaseWidget ()
 
UMLWidgetasUMLWidget ()
 
const ActivityWidgetasActivityWidget () const
 
const ActorWidgetasActorWidget () const
 
const ArtifactWidgetasArtifactWidget () const
 
const AssociationWidgetasAssociationWidget () const
 
const BoxWidgetasBoxWidget () const
 
const CategoryWidgetasCategoryWidget () const
 
const ClassifierWidgetasClassifierWidget () const
 
const CombinedFragmentWidgetasCombinedFragmentWidget () const
 
const ComponentWidgetasComponentWidget () const
 
const DatatypeWidgetasDatatypeWidget () const
 
const EntityWidgetasEntityWidget () const
 
const EnumWidgetasEnumWidget () const
 
const FloatingDashLineWidgetasFloatingDashLineWidget () const
 
const ForkJoinWidgetasForkJoinWidget () const
 
const InterfaceWidgetasInterfaceWidget () const
 
const MessageWidgetasMessageWidget () const
 
const NodeWidgetasNodeWidget () const
 
const NoteWidgetasNoteWidget () const
 
const ObjectNodeWidgetasObjectNodeWidget () const
 
const ObjectWidgetasObjectWidget () const
 
const PackageWidgetasPackageWidget () const
 
const PinWidgetasPinWidget () const
 
const PinPortBaseasPinPortBase () const
 
const PortWidgetasPortWidget () const
 
const PreconditionWidgetasPreconditionWidget () const
 
const RegionWidgetasRegionWidget () const
 
const SignalWidgetasSignalWidget () const
 
const StateWidgetasStateWidget () const
 
const FloatingTextWidgetasFloatingTextWidget () const
 
const UseCaseWidgetasUseCaseWidget () const
 
const UMLWidgetasUMLWidget () const
 

Static Public Member Functions

static AssociationWidgetcreate (UMLScene *scene)
 
static AssociationWidgetcreate (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)
 
- 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
 
ClassifierWidgetm_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]
 
FloatingTextWidgetm_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
UMLScenem_scene
 
QPointer< UMLObjectm_umlObject
 
QString m_Doc
 Only used if m_umlObject is not set.
 
QString m_Text
 
QRectF m_rect
 Widget size. In this rectangle, the x and y coordinates are always 0.
 
Uml::ID::Type m_nId
 
Uml::ID::Type m_nLocalID
 
QColor m_textColor
 Color of the text of the widget. Is saved to XMI.
 
QColor m_lineColor
 Color of the lines of the widget. Is saved to XMI.
 
QColor m_fillColor
 color of the background of the widget
 
QBrush m_brush
 
QFont m_font
 
uint m_lineWidth
 Width of the lines of the widget. Is saved to XMI.
 
bool m_useFillColor
 flag indicates if the UMLWidget uses the Diagram FillColour
 
bool m_usesDiagramFillColor
 
bool m_usesDiagramLineColor
 
bool m_usesDiagramLineWidth
 
bool m_usesDiagramTextColor
 
bool m_usesDiagramUseFillColor
 
bool m_autoResize
 
bool m_changesShape
 The widget changes its shape when the number of connections or their positions are changed.
 
- Protected Attributes inherited from QGraphicsObjectWrapper
bool m_calledFromItemChange {false}
 

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
sceneThe parent view of this widget.
Here is the call graph for this function:

Member Function Documentation

◆ activate()

bool AssociationWidget::activate ( IDChangeLog changeLog = 0)
virtual

Activates the AssociationWidget after a load.

Returns
true for success

Reimplemented from WidgetBase.

Here is the call graph for this function:

◆ association()

UMLAssociation * AssociationWidget::association ( ) const

Returns the UMLAssociation representation of this object.

Returns
Pointer to the UMLAssociation that is represented by this AsociationWidget.
Here is the call graph for this function:

◆ 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.
Here is the call graph for this function:

◆ attribute()

UMLAttribute * AssociationWidget::attribute ( ) const

Returns the UMLAttribute representation of this object.

Returns
Pointer to the UMLAttribute that is represented by this AsociationWidget.
Here is the call graph for this function:

◆ boundingRect()

QRectF AssociationWidget::boundingRect ( ) const
virtual

Returns the bounding rectangle of all segments of the association.

Reimplemented from WidgetBase.

Here is the call graph for this function:

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

Here is the call graph for this function:

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

Here is the call graph for this function:

◆ calculateNameType()

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

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

Here is the call graph for this function:

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

Here is the call graph for this function:

◆ changeability()

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

Gets the changeability on the given end of the Association.

Here is the call graph for this function:

◆ 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
Here is the call graph for this function:

◆ checkAutoLayoutSpline()

bool AssociationWidget::checkAutoLayoutSpline ( )
private
Here is the call graph for this function:

◆ checkRemovePoint()

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

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

Parameters
scenePospoint which should be removed
Returns
success status of the remove action
Here is the call graph for this function:

◆ cleanup()

void AssociationWidget::cleanup ( )

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

Here is the call graph for this function:

◆ clipSize()

void AssociationWidget::clipSize ( )
Here is the call graph for this function:

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

Here is the call graph for this function:

◆ 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
textXCandidate X value (may be modified by the constraint.)
textYCandidate Y value (may be modified by the constraint.)
textWidthWidth of the text.
textHeightHeight of the text.
trUml::Text_Role of the text.

Implements LinkWidget.

Here is the call graph for this function:

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

Here is the call graph for this function:

◆ 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
sceneThe 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
sceneThe parent view of this widget.
pWidgetAPointer to the role A widget for the association.
assocTypeThe AssociationType::Enum for this association.
pWidgetBPointer to the role B widget for the association.
umlobjectPointer to the underlying UMLObject (if applicable.)
Here is the call graph for this function:

◆ createAssocClassLine() [1/2]

void AssociationWidget::createAssocClassLine ( )

Creates the association class connecting line.

Here is the call graph for this function:

◆ createAssocClassLine() [2/2]

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

Creates the association class connecting line using the specified ClassifierWidget.

Parameters
classifierThe ClassifierWidget to use.
linePathSegmentIndexThe index of the segment where the association class is created.
Here is the call graph for this function:

◆ createPointsException()

void AssociationWidget::createPointsException ( )
private

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

Here is the call graph for this function:

◆ createPointsSelfAssociation()

void AssociationWidget::createPointsSelfAssociation ( )
private

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

Here is the call graph for this function:

◆ customOpText()

QString AssociationWidget::customOpText ( )
virtual

Overrides operation from LinkWidget. Required by FloatingTextWidget.

Implements LinkWidget.

Here is the call graph for this function:

◆ 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
rectrolewidget's rectangle with scene x and y values
pointending point of the line that starts at rect's center
resultreturn 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.
Here is the call graph for this function:

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

Here is the call graph for this function:

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

Here is the call graph for this function:

◆ hoverEnterEvent()

void AssociationWidget::hoverEnterEvent ( QGraphicsSceneHoverEvent *  event)
protectedvirtual

Reimplemented event handler for hover enter events.

Here is the call graph for this function:

◆ hoverLeaveEvent()

void AssociationWidget::hoverLeaveEvent ( QGraphicsSceneHoverEvent *  event)
protectedvirtual

Reimplemented event handler for hover leave events.

Here is the call graph for this function:

◆ hoverMoveEvent()

void AssociationWidget::hoverMoveEvent ( QGraphicsSceneHoverEvent *  event)
protectedvirtual

Reimplemented event handler for hover move events.

Here is the call graph for this function:

◆ 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
rectrect of a classifier
linea line to the rect
intersectionPointthe intercept point on the border of the rect
Returns
the QLineF::IntersectType of the intersection
Here is the call graph for this function:

◆ isActivated()

bool AssociationWidget::isActivated ( ) const

Read property of bool m_activated.

◆ isAutoLayouted()

bool AssociationWidget::isAutoLayouted ( )
Here is the call graph for this function:

◆ isCollaboration()

bool AssociationWidget::isCollaboration ( ) const

Returns true if this AssociationWidget represents a collaboration message.

Here is the call graph for this function:

◆ 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
Here is the call graph for this function:

◆ 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
Here is the call graph for this function:

◆ 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
Here is the call graph for this function:

◆ isSelf()

bool AssociationWidget::isSelf ( ) const

Returns true if this AssociationWidget represents a self message.

Here is the call graph for this function:

◆ linePathEndsAt()

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

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

Here is the call graph for this function:

◆ linePathStartsAt()

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

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

Here is the call graph for this function:

◆ loadFromXMI() [1/2]

bool AssociationWidget::loadFromXMI ( QDomElement &  qElement)
virtual

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

Reimplemented from WidgetBase.

Here is the call graph for this function:

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

Here is the call graph for this function:

◆ lwClassifier()

UMLClassifier * AssociationWidget::lwClassifier ( )
virtual

Overrides operation from LinkWidget. Required by FloatingTextWidget.

Returns
classifier

Implements LinkWidget.

Here is the call graph for this function:

◆ lwOperationText()

QString AssociationWidget::lwOperationText ( )
virtual

Overrides operation from LinkWidget. Required by FloatingTextWidget.

Implements LinkWidget.

Here is the call graph for this function:

◆ lwSetFont()

void AssociationWidget::lwSetFont ( QFont  font)
virtual

Set all 'owned' child widgets to this font.

Implements LinkWidget.

Here is the call graph for this function:

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

Here is the call graph for this function:

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

Here is the call graph for this function:

◆ mouseMoveEvent()

void AssociationWidget::mouseMoveEvent ( QGraphicsSceneMouseEvent *  me)
virtual

Moves the break point being dragged.

Here is the call graph for this function:

◆ mousePressEvent()

void AssociationWidget::mousePressEvent ( QGraphicsSceneMouseEvent *  me)
virtual

Sets the association to be selected.

Here is the call graph for this function:

◆ mouseReleaseEvent()

void AssociationWidget::mouseReleaseEvent ( QGraphicsSceneMouseEvent *  me)
virtual

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

Here is the call graph for this function:

◆ moveEntireAssoc()

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

Moves the entire association by the given offset.

Here is the call graph for this function:

◆ moveEvent()

void AssociationWidget::moveEvent ( QGraphicsSceneMouseEvent *  me)
private

Overrides moveEvent.

Todo:
avoid trigger of this event during load
Here is the call graph for this function:

◆ moveMidPointsBy()

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

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

Here is the call graph for this function:

◆ 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.
Here is the call graph for this function:

◆ 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.
Here is the call graph for this function:

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

Here is the call graph for this function:

◆ 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
pointthe point to check
Returns
flag whether point is on association line
Here is the call graph for this function:

◆ onWidget()

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

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

Parameters
pPoint to be checked.
Returns
pointer to widget at the provided point
0 is no widget has been found

Reimplemented from WidgetBase.

Here is the call graph for this function:

◆ operation()

UMLOperation * AssociationWidget::operation ( )
virtual

Implements operation from LinkWidget. Motivated by FloatingTextWidget.

Implements LinkWidget.

Here is the call graph for this function:

◆ operationOwner()

UMLClassifier * AssociationWidget::operationOwner ( )
virtual

Overrides operation from LinkWidget. Required by FloatingTextWidget.

Todo:
Move to LinkWidget.

Reimplemented from LinkWidget.

Here is the call graph for this function:

◆ operator!=()

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

Overrides the != operator.

◆ operator==()

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

Overrides the equality test operator.

Here is the call graph for this function:

◆ removeAssocClassLine()

void AssociationWidget::removeAssocClassLine ( )

Remove dashed connecting line for association class.

Here is the call graph for this function:

◆ resetTextPositions()

void AssociationWidget::resetTextPositions ( )
virtual

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

Reimplemented from LinkWidget.

Here is the call graph for this function:

◆ roleDocumentation()

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

Returns the given role's documentation.

Here is the call graph for this function:

◆ roleName()

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

Return the given role's FloatingTextWidget widget text.

Returns
The name set at the FloatingTextWidget.
Here is the call graph for this function:

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

Here is the call graph for this function:

◆ saveToXMI()

void AssociationWidget::saveToXMI ( QXmlStreamWriter &  writer)
virtual

Saves this widget to the "assocwidget" XMI element.

Reimplemented from WidgetBase.

Here is the call graph for this function:

◆ 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
typeThe AssociationType::Enum to set.
Here is the call graph for this function:

◆ setChangeability()

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

Sets the changeability on the given end of the Association.

Here is the call graph for this function:

◆ setChangeWidget()

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

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

Here is the call graph for this function:

◆ setCustomOpText()

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

Overrides operation from LinkWidget. Required by FloatingTextWidget.

Implements LinkWidget.

Here is the call graph for this function:

◆ 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
roleTextRole::Enum of the FloatingTextWidget to change or create.
textText 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.
ftReference to the pointer to FloatingTextWidget to change or create. On creation/deletion, the pointer value will be changed.
Here is the call graph for this function:

◆ setLineColor()

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

Sets the line color

Parameters
colorThe new line color

Reimplemented from WidgetBase.

Here is the call graph for this function:

◆ setLineWidth()

void AssociationWidget::setLineWidth ( uint  width)
virtual

Sets the line width

Parameters
widthThe new line width

Reimplemented from WidgetBase.

Here is the call graph for this function:

◆ setMessageText()

void AssociationWidget::setMessageText ( FloatingTextWidget ft)
virtual

Overrides operation from LinkWidget. Required by FloatingTextWidget.

Parameters
ftThe text widget which to update.

Implements LinkWidget.

Here is the call graph for this function:

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

Here is the call graph for this function:

◆ setName()

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

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

Reimplemented from WidgetBase.

Here is the call graph for this function:

◆ setOperation()

void AssociationWidget::setOperation ( UMLOperation op)
virtual

Implements operation from LinkWidget. Motivated by FloatingTextWidget.

Implements LinkWidget.

Here is the call graph for this function:

◆ setOperationText()

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

Overrides operation from LinkWidget. Required by FloatingTextWidget.

Parameters
opThe new operation string to set.

Implements LinkWidget.

Here is the call graph for this function:

◆ setRoleDocumentation()

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

Set the documentation on the given role.

Here is the call graph for this function:

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

Here is the call graph for this function:

◆ setSelected()

void AssociationWidget::setSelected ( bool  _select)
virtual

Sets the state of whether the widget is selected.

Parameters
_selectThe state of whether the widget is selected.

Reimplemented from WidgetBase.

Here is the call graph for this function:

◆ setStartAndEndPoint()

bool AssociationWidget::setStartAndEndPoint ( AssociationWidget assocwidget,
UMLWidget pWidget 
)
staticprivate
Here is the call graph for this function:

◆ setStereotype()

void AssociationWidget::setStereotype ( const QString &  stereo)
Here is the call graph for this function:

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

Here is the call graph for this function:

◆ setTextColor()

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

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

Reimplemented from WidgetBase.

Here is the call graph for this function:

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

Here is the call graph for this function:

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

Here is the call graph for this function:

◆ setUMLAssociation()

void AssociationWidget::setUMLAssociation ( UMLAssociation assoc)
private

Set our internal umlAssociation.

Here is the call graph for this function:

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

Here is the call graph for this function:

◆ setVisibility()

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

Sets the visibility on the given role of the association.

Here is the call graph for this function:

◆ 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
widgetPointer to the UMLWidget.
roleRole for which to set the widget.
Here is the call graph for this function:

◆ setXEntireAssoc()

void AssociationWidget::setXEntireAssoc ( qreal  x)

Set all association points to x coordinate.

Here is the call graph for this function:

◆ setYEntireAssoc()

void AssociationWidget::setYEntireAssoc ( qreal  y)

Set all association points to y coordinate.

Here is the call graph for this function:

◆ shape()

QPainterPath AssociationWidget::shape ( ) const
virtual

Returns the shape of all segments of the association.

Here is the call graph for this function:

◆ showPropertiesDialog()

bool AssociationWidget::showPropertiesDialog ( )
virtual

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

Reimplemented from WidgetBase.

Here is the call graph for this function:

◆ slotAttributeChanged

void AssociationWidget::slotAttributeChanged ( )
slot

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

Here is the call graph for this function:

◆ 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
objThe UMLClassifierListItem removed.
Here is the call graph for this function:

◆ slotMenuSelection

void AssociationWidget::slotMenuSelection ( QAction *  action)
virtualslot

Handles the selection from the popup menu.

Here is the call graph for this function:

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

Here is the call graph for this function:

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

Here is the call graph for this function:

◆ 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

Parameters
pWidgetPointer to the widget to seek as the role A or B widget in all association widgets of the scene.
listThe association widgets to analyze/update
Here is the call graph for this function:

◆ updatePointsException()

void AssociationWidget::updatePointsException ( )
private

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

Here is the call graph for this function:

◆ updatePointsSelfAssociation()

void AssociationWidget::updatePointsSelfAssociation ( )
private

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

Here is the call graph for this function:

◆ visibility()

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

Gets the visibility on the given role of the association.

Here is the call graph for this function:

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

Here is the call graph for this function:

◆ widgetLocalIDForRole()

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

Gets the local ID of the given role widget.

Here is the call graph for this function:

◆ 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
Here is the call graph for this function:

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: