umbrello API Documentation

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:

UMLWidget WidgetBase List of all members.

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

enum StateWidget::StateType
 

Enumeration that codes the different types of state.

Definition at line 43 of file statewidget.h.


Constructor & Destructor Documentation

StateWidget::StateWidget UMLView view,
StateType  stateType = Normal,
Uml::IDType  id = Uml::id_None
[explicit]
 

Creates a State widget.

Parameters:
view The parent of the widget.
stateType The type of state.
id The ID to assign (-1 will prompt a new ID.)

Definition at line 32 of file statewidget.cpp.

References m_StateType, WidgetBase::setBaseType(), and UMLWidget::updateComponentSize().

StateWidget::~StateWidget  )  [virtual]
 

destructor

Definition at line 40 of file statewidget.cpp.


Member Function Documentation

void StateWidget::draw QPainter &  p,
int  offsetX,
int  offsetY
[virtual]
 

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

void StateWidget::setName const QString &  strName  )  [virtual]
 

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

QString StateWidget::getName  )  const [virtual]
 

Returns the name of the State.

Reimplemented from UMLWidget.

Definition at line 146 of file statewidget.cpp.

Referenced by calculateSize(), draw(), and slotMenuSelection().

StateWidget::StateType StateWidget::getStateType  )  const
 

Returns the type of state.

Definition at line 150 of file statewidget.cpp.

References m_StateType.

Referenced by AssocRules::allowAssociation().

void StateWidget::setStateType StateType  stateType  ) 
 

Sets the type of state.

Definition at line 154 of file statewidget.cpp.

References m_StateType.

bool StateWidget::addActivity const QString &  activity  ) 
 

Adds the given activity to the state.

Definition at line 187 of file statewidget.cpp.

References m_Activities, and UMLWidget::updateComponentSize().

Referenced by slotMenuSelection().

bool StateWidget::removeActivity const QString &  activity  ) 
 

Removes the given activity from the state.

Definition at line 193 of file statewidget.cpp.

References m_Activities, and UMLWidget::updateComponentSize().

bool StateWidget::renameActivity const QString &  activity,
const QString &  newName
 

Renames the given activity.

Definition at line 211 of file statewidget.cpp.

References m_Activities.

void StateWidget::setActivities QStringList &  list  ) 
 

Sets the states activities to the ones given.

Definition at line 202 of file statewidget.cpp.

References m_Activities, and UMLWidget::updateComponentSize().

QStringList & StateWidget::getActivityList  ) 
 

Returns the list of activities.

Definition at line 207 of file statewidget.cpp.

References m_Activities.

void StateWidget::showProperties  )  [virtual]
 

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

bool StateWidget::isState WorkToolBar::ToolBar_Buttons  tbb,
StateType resultType
[static]
 

Returns true if the given toolbar button represents a State.

Parameters:
tbb Input value of type WorkToolBar::ToolBar_Buttons.
resultType Output value, the StateType that corresponds to tbb. Only set if the method returns true.

Definition at line 230 of file statewidget.cpp.

void StateWidget::saveToXMI QDomDocument &  qDoc,
QDomElement &  qElement
[virtual]
 

Creates the <statewidget> XMI element.

Reimplemented from UMLWidget.

Definition at line 250 of file statewidget.cpp.

References m_Activities, and m_StateType.

bool StateWidget::loadFromXMI QDomElement &  qElement  )  [virtual]
 

Loads a <statewidget> XMI element.

Reimplemented from UMLWidget.

Definition at line 269 of file statewidget.cpp.

References m_Activities, and m_StateType.

QSize StateWidget::calculateSize  )  [protected, virtual]
 

Overrides method from UMLWidget.

Reimplemented from UMLWidget.

Definition at line 113 of file statewidget.cpp.

References UMLWidget::getFontMetrics(), getName(), m_Activities, and m_StateType.

void StateWidget::slotMenuSelection int  sel  )  [virtual, slot]
 

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

StateType StateWidget::m_StateType [protected]
 

Type of state.

Definition at line 148 of file statewidget.h.

Referenced by calculateSize(), draw(), getStateType(), loadFromXMI(), saveToXMI(), setStateType(), and StateWidget().

QStringList StateWidget::m_Activities [protected]
 

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:
KDE Logo
This file is part of the documentation for umbrello Version 3.1.0.
Documentation copyright © 1996-2004 the KDE developers.
Generated on Tue Jun 26 08:08:06 2007 by doxygen 1.4.1 written by Dimitri van Heesch, © 1997-2003