StateWidget Class Reference
This class is the graphical version of a UML State. A graphical version of a UML State. More...
#include <statewidget.h>
Inheritance diagram for StateWidget:

Public Types | |
| enum | StateType { Initial = 0, Normal, End } |
| Enumeration that codes the different types of state. More... | |
Public Slots | |
| void | slotMenuSelection (int sel) |
| Captures any popup menu signals for menus it created. | |
Public Member Functions | |
| StateWidget (UMLView *view, StateType stateType=Normal, Uml::IDType id=Uml::id_None) | |
| Creates a State widget. | |
| virtual | ~StateWidget () |
| destructor | |
| void | draw (QPainter &p, int offsetX, int offsetY) |
| Overrides the standard paint event. | |
| virtual void | setName (const QString &strName) |
| Sets the name of the State. | |
| virtual QString | getName () const |
| Returns the name of the State. | |
| StateType | getStateType () const |
| Returns the type of state. | |
| void | setStateType (StateType stateType) |
| Sets the type of state. | |
| bool | addActivity (const QString &activity) |
| Adds the given activity to the state. | |
| bool | removeActivity (const QString &activity) |
| Removes the given activity from the state. | |
| bool | renameActivity (const QString &activity, const QString &newName) |
| Renames the given activity. | |
| void | setActivities (QStringList &list) |
| Sets the states activities to the ones given. | |
| QStringList & | getActivityList () |
| Returns the list of activities. | |
| void | showProperties () |
| Show a properties dialog for a StateWidget. | |
| void | saveToXMI (QDomDocument &qDoc, QDomElement &qElement) |
| Creates the <statewidget> XMI element. | |
| bool | loadFromXMI (QDomElement &qElement) |
| Loads a <statewidget> XMI element. | |
Static Public Member Functions | |
| static bool | isState (WorkToolBar::ToolBar_Buttons tbb, StateType &resultType) |
| Returns true if the given toolbar button represents a State. | |
Protected Member Functions | |
| QSize | calculateSize () |
| Overrides method from UMLWidget. | |
Protected Attributes | |
| StateType | m_StateType |
| Type of state. | |
| QStringList | m_Activities |
| List of activities for the state. | |
Detailed Description
This class is the graphical version of a UML State. A graphical version of a UML State.A StateWidget is created by a UMLView. A StateWidget belongs to only one UMLView instance. When the UMLView instance that this class belongs to is destroyed, it will be automatically deleted.
The StateWidget class inherits from the UMLWidget class which adds most of the functionality to this class.
- Author:
- Paul Hensgen <phensgen@techie.com> Bugs and comments to uml-devel@lists.sf.net or http://bugs.kde.org
Definition at line 38 of file statewidget.h.
Member Enumeration Documentation
|
|
Enumeration that codes the different types of state.
Definition at line 43 of file statewidget.h. |
Constructor & Destructor Documentation
|
||||||||||||||||
|
Creates a State widget.
Definition at line 32 of file statewidget.cpp. References m_StateType, WidgetBase::setBaseType(), and UMLWidget::updateComponentSize(). |
|
|
destructor
Definition at line 40 of file statewidget.cpp. |
Member Function Documentation
|
||||||||||||||||
|
Overrides the standard paint event.
Implements UMLWidget. Definition at line 42 of file statewidget.cpp. References UMLWidget::drawSelected(), UMLWidget::getFont(), UMLWidget::getFontMetrics(), getName(), UMLWidget::getUseFillColour(), m_Activities, m_StateType, and UMLWidget::setPen(). |
|
|
Sets the name of the State.
Reimplemented from UMLWidget. Definition at line 140 of file statewidget.cpp. References UMLWidget::adjustAssocs(), UMLWidget::getX(), UMLWidget::getY(), and UMLWidget::updateComponentSize(). Referenced by UMLView::slotMenuSelection(), and slotMenuSelection(). |
|
|
Returns the name of the State.
Reimplemented from UMLWidget. Definition at line 146 of file statewidget.cpp. Referenced by calculateSize(), draw(), and slotMenuSelection(). |
|
|
Returns the type of state.
Definition at line 150 of file statewidget.cpp. References m_StateType. Referenced by AssocRules::allowAssociation(). |
|
|
Sets the type of state.
Definition at line 154 of file statewidget.cpp. References m_StateType. |
|
|
Adds the given activity to the state.
Definition at line 187 of file statewidget.cpp. References m_Activities, and UMLWidget::updateComponentSize(). Referenced by slotMenuSelection(). |
|
|
Removes the given activity from the state.
Definition at line 193 of file statewidget.cpp. References m_Activities, and UMLWidget::updateComponentSize(). |
|
||||||||||||
|
Renames the given activity.
Definition at line 211 of file statewidget.cpp. References m_Activities. |
|
|
Sets the states activities to the ones given.
Definition at line 202 of file statewidget.cpp. References m_Activities, and UMLWidget::updateComponentSize(). |
|
|
Returns the list of activities.
Definition at line 207 of file statewidget.cpp. References m_Activities. |
|
|
Show a properties dialog for a StateWidget.
Reimplemented from UMLWidget. Definition at line 219 of file statewidget.cpp. References StateDialog::getChangesMade(), UMLApp::getDocument(), UMLApp::getDocWindow(), UMLDoc::setModified(), DocWindow::showDocumentation(), and DocWindow::updateDocumentation(). Referenced by slotMenuSelection(). |
|
||||||||||||
|
Returns true if the given toolbar button represents a State.
Definition at line 230 of file statewidget.cpp. |
|
||||||||||||
|
Creates the <statewidget> XMI element.
Reimplemented from UMLWidget. Definition at line 250 of file statewidget.cpp. References m_Activities, and m_StateType. |
|
|
Loads a <statewidget> XMI element.
Reimplemented from UMLWidget. Definition at line 269 of file statewidget.cpp. References m_Activities, and m_StateType. |
|
|
Overrides method from UMLWidget.
Reimplemented from UMLWidget. Definition at line 113 of file statewidget.cpp. References UMLWidget::getFontMetrics(), getName(), m_Activities, and m_StateType. |
|
|
Captures any popup menu signals for menus it created.
Reimplemented from UMLWidget. Definition at line 158 of file statewidget.cpp. References addActivity(), getName(), setName(), showProperties(), and UMLWidget::slotMenuSelection(). |
Member Data Documentation
|
|
Type of state.
Definition at line 148 of file statewidget.h. Referenced by calculateSize(), draw(), getStateType(), loadFromXMI(), saveToXMI(), setStateType(), and StateWidget(). |
|
|
List of activities for the state.
Definition at line 153 of file statewidget.h. Referenced by addActivity(), calculateSize(), draw(), getActivityList(), loadFromXMI(), removeActivity(), renameActivity(), saveToXMI(), and setActivities(). |
The documentation for this class was generated from the following files:
