umbrello: umbrello/umlwidgets/activitywidget.h Source File

umbrello 2.32.0 Umbrello UML Modeller is a Unified Modelling Language (UML) diagram program based on KDE Technology

activitywidget.h
Go to the documentation of this file.
1 /***************************************************************************
2 * This program is free software; you can redistribute it and/or modify *
3 * it under the terms of the GNU General Public License as published by *
4 * the Free Software Foundation; either version 2 of the License, or *
5 * (at your option) any later version. *
6 * *
7 * copyright (C) 2002-2020 *
8 * Umbrello UML Modeller Authors <umbrello-devel@kde.org> *
9 ***************************************************************************/
10
11 #ifndef ACTIVITYWIDGET_H
12 #define ACTIVITYWIDGET_H
13
14 #include "umlwidget.h"
15 #include "worktoolbar.h"
16
17 #define ACTIVITY_MARGIN 5
18 #define ACTIVITY_WIDTH 30
19 #define ACTIVITY_HEIGHT 10
20
33 class ActivityWidget : public UMLWidget
34 {
35 Q_OBJECT
36 Q_ENUMS(ActivityType)
37 public:
38 enum ActivityType
39 {
40 Initial = 0,
41 Normal,
42 End,
43 Final,
44 Branch,
45 Invok,
46 Param
47 };
48
49 explicit ActivityWidget(UMLScene * scene, ActivityType activityType = Normal, Uml::ID::Type id = Uml::ID::None);
50 virtual ~ActivityWidget();
51
52 ActivityType activityType() const;
53 QString activityTypeStr() const;
54 void setActivityType(ActivityType activityType);
55
56 static bool isActivity(WorkToolBar::ToolBar_Buttons tbb,
57 ActivityType& resultType);
58
59 QString preconditionText() const;
60 void setPreconditionText(const QString&);
61
62 QString postconditionText() const;
63 void setPostconditionText(const QString&);
64
65 virtual bool showPropertiesDialog();
66 virtual void paint(QPainter *painter, const QStyleOptionGraphicsItem *option, QWidget *widget = 0);
67 virtual void moveWidgetBy(qreal diffX, qreal diffY);
68
69 virtual bool loadFromXMI1(QDomElement & qElement);
70 virtual void saveToXMI1(QXmlStreamWriter& writer);
71
72 void constrain(qreal& width, qreal& height);
73
74 signals:
83 void sigActMoved(qreal diffX, qreal diffY);
84
85 public Q_SLOTS:
86 virtual void slotMenuSelection(QAction* action);
87
88 protected:
89 virtual QSizeF minimumSize() const;
90 virtual QSizeF maximumSize();
91
92 ActivityType m_activityType;
93
94 QString m_preconditionText;
95 QString m_postconditionText;
96 };
97
98 #endif
ActivityWidget
A graphical version of a UML Activity.
Definition: activitywidget.h:34
ActivityWidget::preconditionText
QString preconditionText() const
Definition: activitywidget.cpp:121
ActivityWidget::ActivityType
ActivityType
Definition: activitywidget.h:39
ActivityWidget::Branch
@ Branch
Definition: activitywidget.h:44
ActivityWidget::Param
@ Param
Definition: activitywidget.h:46
ActivityWidget::End
@ End
Definition: activitywidget.h:42
ActivityWidget::Initial
@ Initial
Definition: activitywidget.h:40
ActivityWidget::Final
@ Final
Definition: activitywidget.h:43
ActivityWidget::Invok
@ Invok
Definition: activitywidget.h:45
ActivityWidget::Normal
@ Normal
Definition: activitywidget.h:41
ActivityWidget::slotMenuSelection
virtual void slotMenuSelection(QAction *action)
Definition: activitywidget.cpp:370
ActivityWidget::~ActivityWidget
virtual ~ActivityWidget()
Definition: activitywidget.cpp:52
ActivityWidget::setPreconditionText
void setPreconditionText(const QString &)
Definition: activitywidget.cpp:129
ActivityWidget::showPropertiesDialog
virtual bool showPropertiesDialog()
Definition: activitywidget.cpp:158
ActivityWidget::ActivityWidget
ActivityWidget(UMLScene *scene, ActivityType activityType=Normal, Uml::ID::Type id=Uml::ID::None)
Definition: activitywidget.cpp:41
ActivityWidget::paint
virtual void paint(QPainter *painter, const QStyleOptionGraphicsItem *option, QWidget *widget=0)
Definition: activitywidget.cpp:176
ActivityWidget::m_postconditionText
QString m_postconditionText
Definition: activitywidget.h:95
ActivityWidget::setPostconditionText
void setPostconditionText(const QString &)
Definition: activitywidget.cpp:147
ActivityWidget::saveToXMI1
virtual void saveToXMI1(QXmlStreamWriter &writer)
Definition: activitywidget.cpp:337
ActivityWidget::loadFromXMI1
virtual bool loadFromXMI1(QDomElement &qElement)
Definition: activitywidget.cpp:319
ActivityWidget::m_preconditionText
QString m_preconditionText
Definition: activitywidget.h:94
ActivityWidget::setActivityType
void setActivityType(ActivityType activityType)
Definition: activitywidget.cpp:75
ActivityWidget::minimumSize
virtual QSizeF minimumSize() const
Definition: activitywidget.cpp:397
ActivityWidget::activityType
ActivityType activityType() const
Definition: activitywidget.cpp:59
ActivityWidget::activityTypeStr
QString activityTypeStr() const
Definition: activitywidget.cpp:67
ActivityWidget::m_activityType
ActivityType m_activityType
Type of activity.
Definition: activitywidget.h:92
ActivityWidget::maximumSize
virtual QSizeF maximumSize()
Definition: activitywidget.cpp:437
ActivityWidget::sigActMoved
void sigActMoved(qreal diffX, qreal diffY)
ActivityWidget::moveWidgetBy
virtual void moveWidgetBy(qreal diffX, qreal diffY)
Definition: activitywidget.cpp:310
ActivityWidget::postconditionText
QString postconditionText() const
Definition: activitywidget.cpp:139
ActivityWidget::constrain
void constrain(qreal &width, qreal &height)
Definition: activitywidget.cpp:352
ActivityWidget::isActivity
static bool isActivity(WorkToolBar::ToolBar_Buttons tbb, ActivityType &resultType)
Definition: activitywidget.cpp:91
UMLScene
Definition: umlscene.h:70
UMLWidget
The base class for graphical UML objects.
Definition: umlwidget.h:41
UMLWidget::width
qreal width() const
Definition: umlwidget.h:124
UMLWidget::height
qreal height() const
Definition: umlwidget.h:117
WorkToolBar::ToolBar_Buttons
ToolBar_Buttons
Definition: worktoolbar.h:57
Uml::ID::None
const Type None
special value for uninitialized ID
Definition: basictypes.h:387
Uml::ID::Type
std::string Type
Definition: basictypes.h:385
umlwidget.h
worktoolbar.h