umbrello/umbrello
#include <toolbarstatemessages.h>
Public Slots | |
virtual void | slotWidgetRemoved (UMLWidget *widget) |
Public Slots inherited from ToolBarState | |
virtual void | slotAssociationRemoved (AssociationWidget *association) |
virtual void | slotWidgetRemoved (UMLWidget *widget) |
Public Member Functions | |
ToolBarStateMessages (UMLScene *umlScene) | |
virtual | ~ToolBarStateMessages () |
virtual void | cleanBeforeChange () |
virtual void | init () |
virtual void | mouseMove (QGraphicsSceneMouseEvent *ome) |
Public Member Functions inherited from ToolBarStatePool | |
virtual | ~ToolBarStatePool () |
WorkToolBar::ToolBar_Buttons | getButton () const |
void | setButton (const WorkToolBar::ToolBar_Buttons &button) |
Public Member Functions inherited from ToolBarState | |
virtual | ~ToolBarState () |
virtual void | mouseDoubleClick (QGraphicsSceneMouseEvent *ome) |
virtual void | mousePress (QGraphicsSceneMouseEvent *ome) |
virtual void | mouseRelease (QGraphicsSceneMouseEvent *ome) |
Protected Types | |
enum | MessageType { NormalMessage, CreationMessage, FoundMessage, LostMessage } |
Protected Attributes | |
ObjectWidget * | m_firstObject |
bool | m_isObjectWidgetLine |
QGraphicsLineItem * | m_messageLine |
Protected Attributes inherited from ToolBarState | |
QGraphicsSceneMouseEvent * | m_pMouseEvent |
UMLScene * | m_pUMLScene |
Detailed Description
Messages tool to create messages between objects in sequence diagrams.
With messages tool, two objects are selected clicking with left button on them and a message of the needed type (depending on the message button selected) is created between the objects. When the first object is selected, a temporal visual message that follows the cursor movement is created until the second object is selected or the message cancelled.
A message can be cancelled using right button, which also returns to default tool, or with middle button, which only cancels the message without changing the tool being used.
The messages to create can be normal messages or creation messages. Normal messages are created clicking on the line of the two objects. Creation messages are created clicking in the line of the first object, and on the second object itself (not in its line).
Associations aren't taken into account, and are treated as empty spaces. Moreover, widgets other than objects aren't neither taken into account.
- Todo:
refactor with common code in ToolBarStateAssociation?
sequence message lines should be handled by object widgets. Right now, they aren't taken into account in testOnWidget and an explicit check is needed. However, if onWidget in object widgets is changed to also check for the line, a way to make them prioritaries over other widgets in testOnWidget will be needed. For example, when creating a message clicking on an already created message, the message line must be got instead of the message, even if the message is smaller than the line.
Definition at line 50 of file toolbarstatemessages.h.
Member Enumeration Documentation
|
protected |
The type of the message to create.
Enumerator | |
---|---|
NormalMessage | |
CreationMessage | |
FoundMessage | |
LostMessage |
Definition at line 80 of file toolbarstatemessages.h.
Constructor & Destructor Documentation
|
explicit |
Creates a new ToolBarStateMessages.
- Parameters
-
umlScene The UMLScene to use.
Definition at line 33 of file toolbarstatemessages.cpp.
|
virtual |
Destroys this ToolBarStateMessages.
Definition at line 46 of file toolbarstatemessages.cpp.
Member Function Documentation
|
virtual |
Called when the current tool is changed to use another tool.
Executes base method and cleans the message.
Reimplemented from ToolBarState.
Definition at line 65 of file toolbarstatemessages.cpp.
|
protected |
Cleans the first widget and the temporal message line, if any.
Both are set to null, and the message line is also deleted.
Definition at line 297 of file toolbarstatemessages.cpp.
|
protected |
Returns the message type of this tool.
- Returns
- The message type of this tool.
Definition at line 279 of file toolbarstatemessages.cpp.
|
virtual |
Goes back to the initial state.
Reimplemented from ToolBarState.
Definition at line 54 of file toolbarstatemessages.cpp.
|
virtual |
Called when a mouse event happened.
It executes the base method and then updates the position of the message line, if any.
Reimplemented from ToolBarState.
Definition at line 77 of file toolbarstatemessages.cpp.
|
protectedvirtual |
Called when the release event happened on an empty space.
Cleans the message. Empty spaces are not only actual empty spaces, but also associations.
Reimplemented from ToolBarState.
Definition at line 174 of file toolbarstatemessages.cpp.
|
protectedvirtual |
Called when the release event happened on a widget.
If the button pressed isn't left button or the widget isn't an object widget, the message is cleaned. If the release event didn't happen on the line of an object and the first object wasn't selected, nothing is done. If the first object was already selected, a creation message is made. If the event happened on the line of an object, the first object or the second are set, depending on whether the first object was already set or not.
Reimplemented from ToolBarState.
Definition at line 143 of file toolbarstatemessages.cpp.
|
protectedvirtual |
Selects only widgets, but no associations.
Overrides base class method. If the press event happened on the line of an object, the object is set as current widget. If the press event happened on a widget, the widget is set as current widget.
Reimplemented from ToolBarState.
Definition at line 109 of file toolbarstatemessages.cpp.
|
protected |
Sets the first object of the message using the specified object.
The temporal visual message is created and mouse tracking enabled, so mouse events will be delivered.
- Parameters
-
firstObject The first object of the message.
Definition at line 215 of file toolbarstatemessages.cpp.
|
protected |
Sets the second object of the message using the specified widget and creates the message.
The association is created and added to the view. The dialog to select the operation of the message is shown.
- Parameters
-
secondObject The second object of the message. messageType The type of the message to create.
Definition at line 249 of file toolbarstatemessages.cpp.
|
virtualslot |
A widget was removed from the UMLView.
If the widget removed was the current widget, the current widget is set to 0. Also, if it was the first object, the message is cleaned.
Definition at line 93 of file toolbarstatemessages.cpp.
Member Data Documentation
|
protected |
The first object in the message.
Definition at line 97 of file toolbarstatemessages.h.
|
protected |
If there is a current widget, it is true if the press event happened on the line of an object, or false if it happened on a normal UMLWidget.
Definition at line 109 of file toolbarstatemessages.h.
|
protected |
The message line shown while the first widget is selected and the second one wasn't selected yet.
Definition at line 103 of file toolbarstatemessages.h.
The documentation for this class was generated from the following files:
Documentation copyright © 1996-2014 The KDE developers.
Generated on Tue Oct 14 2014 23:06:02 by doxygen 1.8.7 written by Dimitri van Heesch, © 1997-2006
KDE's Doxygen guidelines are available online.