umbrello 2.39.0
Umbrello UML Modeller is a Unified Modelling Language (UML) diagram program based on KDE Technology
|
#include <toolbarstateassociation.h>
Public Slots | |
virtual void | slotWidgetRemoved (UMLWidget *widget) |
![]() | |
virtual void | slotAssociationRemoved (AssociationWidget *association) |
virtual void | slotWidgetRemoved (UMLWidget *widget) |
Public Member Functions | |
ToolBarStateAssociation (UMLScene *umlScene) | |
virtual | ~ToolBarStateAssociation () |
virtual void | init () |
virtual void | cleanBeforeChange () |
virtual void | mouseMove (QGraphicsSceneMouseEvent *ome) |
![]() | |
virtual | ~ToolBarStatePool () |
void | setButton (const WorkToolBar::ToolBar_Buttons &button) |
WorkToolBar::ToolBar_Buttons | getButton () const |
![]() | |
virtual | ~ToolBarState () |
virtual void | mousePress (QGraphicsSceneMouseEvent *ome) |
virtual void | mouseRelease (QGraphicsSceneMouseEvent *ome) |
virtual void | mouseDoubleClick (QGraphicsSceneMouseEvent *ome) |
Protected Member Functions | |
virtual void | mouseReleaseAssociation () |
virtual void | mouseReleaseWidget () |
virtual void | mouseReleaseEmpty () |
![]() | |
ToolBarStatePool (UMLScene *umlScene) | |
![]() | |
ToolBarState (UMLScene *umlScene) | |
virtual void | setCurrentElement () |
virtual void | mousePressAssociation () |
virtual void | mousePressWidget () |
virtual void | mousePressEmpty () |
virtual void | mouseDoubleClickAssociation () |
virtual void | mouseDoubleClickWidget () |
virtual void | mouseDoubleClickEmpty () |
virtual void | mouseMoveAssociation () |
virtual void | mouseMoveWidget () |
virtual void | mouseMoveEmpty () |
virtual void | changeTool () |
virtual UMLWidget * | currentWidget () const |
virtual void | setCurrentWidget (UMLWidget *widget) |
virtual AssociationWidget * | currentAssociation () const |
virtual void | setCurrentAssociation (AssociationWidget *association) |
void | setMouseEvent (QGraphicsSceneMouseEvent *ome, const QEvent::Type &type) |
AssociationWidget * | associationAt (const QPointF &pos) |
MessageWidget * | messageAt (const QPointF &pos) |
FloatingDashLineWidget * | floatingLineAt (const QPointF &pos) |
Private Member Functions | |
void | setFirstWidget () |
void | setSecondWidget () |
Uml::AssociationType::Enum | getAssociationType () |
bool | addAssociationInViewAndDoc (AssociationWidget *assoc) |
void | cleanAssociation () |
Private Attributes | |
UMLWidget * | m_firstWidget |
QGraphicsLineItem * | m_associationLine |
Additional Inherited Members | |
![]() | |
void | finished () |
![]() | |
UMLScene * | m_pUMLScene |
The UMLScene. | |
QGraphicsSceneMouseEvent * | m_pMouseEvent |
The mouse event currently in use. | |
Association tool to create associations between widgets. With association tool, two widgets are selected clicking with left button on them and an association of the needed type (depending on the association button selected) is created between the widgets. When the first widget is selected, a temporary visual association that follows the cursor movement is created until the second widget is selected or the association cancelled.
Also, association tool can create association class: a classifier widget which is linked to an association. To do this, the classifier must be selected first and then the association must be selected. The association can't be selected first.
An association can be cancelled using right button, which also returns to default tool, or with middle button, which only cancels the association without changing the tool being used.
|
explicit |
Creates a new ToolBarStateAssociation.
umlScene | The UMLScene to use. |
|
virtual |
Destroys this ToolBarStateAssociation. Deletes the association line.
|
private |
Adds an AssociationWidget to the association list and creates the corresponding UMLAssociation in the current UMLDoc. If the association can't be added, is deleted.
assoc | The AssociationWidget to add. |
|
private |
Cleans the first widget and the temporary association line, if any. Both are set to null, and the association line is also deleted.
|
virtual |
Called when the current tool is changed to use another tool. Executes base method and cleans the association.
Reimplemented from ToolBarState.
|
private |
Returns the association type of this tool.
|
virtual |
Goes back to the initial state.
Reimplemented from ToolBarState.
|
virtual |
Called when a mouse event happened. It executes the base method and then updates the position of the association line, if any.
Reimplemented from ToolBarState.
|
protectedvirtual |
Called when the release event happened on an association. If the button pressed isn't left button, the association being created is cleaned. If it is left button, and the first widget is set and is a classifier widget, it creates an association class. Otherwise, the association being created is cleaned.
Reimplemented from ToolBarState.
|
protectedvirtual |
Called when the release event happened on an empty space. Cleans the association.
Reimplemented from ToolBarState.
|
protectedvirtual |
Called when the release event happened on a widget. If the button pressed isn't left button, the association is cleaned. If it is left button, sets the first widget or the second, depending on whether the first widget is already set or not.
Reimplemented from ToolBarState.
|
private |
Sets the first widget in the association using the current widget. If the widget can't be associated using the current type of association, an error is shown and the widget isn't set. Otherwise, the temporary visual association is created and the mouse tracking is enabled, so move events will be delivered.
|
private |
Sets the second widget in the association using the current widget and creates the association. If the association between the two widgets using the current type of association is illegitimate, an error is shown and the association cancelled. Otherwise, the association is created and added to the scene, and the tool is changed to the default tool.
|
virtualslot |
|
private |
The association line shown while the first widget is selected and the second one wasn't selected yet.
|
private |
The first widget in the association.