umbrello 2.32.3 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(QDomDocument & qDoc, QDomElement & qElement);
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
UMLWidget::height
qreal height() const
Definition: umlwidget.h:114
ActivityWidget::maximumSize
virtual QSizeF maximumSize()
Definition: activitywidget.cpp:436
ActivityWidget::setPostconditionText
void setPostconditionText(const QString &)
Definition: activitywidget.cpp:146
x
int x
Definition: cxx11-lambda-functions-and-expressions.h:4
WidgetBase::textColor
QColor textColor() const
Definition: widgetbase.cpp:335
ListPopupMenu::mt_Properties
@ mt_Properties
Definition: listpopupmenu.h:182
docwindow.h
umlview.h
activitywidget.h
ActivityWidget::m_activityType
ActivityType m_activityType
Type of activity.
Definition: activitywidget.h:92
UMLWidget
The base class for graphical UML objects.
Definition: umlwidget.h:41
WidgetBase::name
QString name() const
Definition: widgetbase.cpp:309
WidgetBase::setDocumentation
virtual void setDocumentation(const QString &doc)
Definition: widgetbase.cpp:294
ActivityWidget::Final
@ Final
Definition: activitywidget.h:43
ActivityDialog
Definition: activitydialog.h:32
UMLWidget::setPenFromSettings
void setPenFromSettings(QPainter &p)
Definition: umlwidget.cpp:1392
UMLWidget::FT_NORMAL
@ FT_NORMAL
Definition: umlwidget.h:217
ActivityWidget::Invok
@ Invok
Definition: activitywidget.h:45
WidgetBase::umlScene
UMLScene * umlScene() const
Definition: widgetbase.cpp:162
ActivityWidget
A graphical version of a UML Activity.
Definition: activitywidget.h:34
DEBUG_REGISTER_DISABLED
#define DEBUG_REGISTER_DISABLED(src)
Definition: debug_utils.h:132
Uml::ID::None
const Type None
special value for uninitialized ID
Definition: basictypes.h:353
ActivityWidget::isActivity
static bool isActivity(WorkToolBar::ToolBar_Buttons tbb, ActivityType &resultType)
Definition: activitywidget.cpp:90
UMLWidget::maximumSize
virtual QSizeF maximumSize()
Definition: umlwidget.cpp:240
ACTIVITY_HEIGHT
#define ACTIVITY_HEIGHT
Definition: activitywidget.h:19
ActivityWidget::~ActivityWidget
virtual ~ActivityWidget()
Definition: activitywidget.cpp:51
UMLWidget::moveWidgetBy
virtual void moveWidgetBy(qreal diffX, qreal diffY)
Definition: umlwidget.cpp:281
DocWindow::updateDocumentation
void updateDocumentation(bool clear=false, bool startup=false)
Definition: docwindow.cpp:273
worktoolbar.h
WorkToolBar::ToolBar_Buttons
ToolBar_Buttons
Definition: worktoolbar.h:57
ActivityWidget::constrain
void constrain(qreal &width, qreal &height)
Definition: activitywidget.cpp:351
Uml::ID::Type
std::string Type
Definition: basictypes.h:351
ACTIVITY_WIDTH
#define ACTIVITY_WIDTH
Definition: activitywidget.h:18
ENUM_NAME
#define ENUM_NAME(o, e, v)
Definition: debug_utils.h:143
ActivityWidget::ActivityWidget
ActivityWidget(UMLScene *scene, ActivityType activityType=Normal, Uml::ID::Type id=Uml::ID::None)
Definition: activitywidget.cpp:40
ActivityWidget::setPreconditionText
void setPreconditionText(const QString &)
Definition: activitywidget.cpp:128
UMLWidget::getFontMetrics
QFontMetrics & getFontMetrics(UMLWidget::FontType fontType) const
Definition: umlwidget.cpp:1936
WidgetBase::font
virtual QFont font() const
Definition: widgetbase.cpp:543
ActivityWidget::slotMenuSelection
virtual void slotMenuSelection(QAction *action)
Definition: activitywidget.cpp:369
activitydialog.h
WidgetBase::fillColor
QColor fillColor() const
Definition: widgetbase.cpp:377
UMLApp::docWindow
DocWindow * docWindow() const
Definition: uml.cpp:1895
ACTIVITY_MARGIN
#define ACTIVITY_MARGIN
Definition: activitywidget.h:17
ActivityWidget::End
@ End
Definition: activitywidget.h:42
umlwidget.h
ListPopupMenu::MenuType
MenuType
< This type hosts all possible menu entry types
Definition: listpopupmenu.h:44
ActivityWidget::moveWidgetBy
virtual void moveWidgetBy(qreal diffX, qreal diffY)
Definition: activitywidget.cpp:309
ActivityWidget::Param
@ Param
Definition: activitywidget.h:46
WorkToolBar::tbb_End_Activity
@ tbb_End_Activity
Definition: worktoolbar.h:107
WidgetBase::documentation
QString documentation() const
Definition: widgetbase.cpp:269
int
int int y int
Definition: cxx11-lambda-functions-and-expressions.h:4
ActivityWidget::Normal
@ Normal
Definition: activitywidget.h:41
WorkToolBar::tbb_Final_Activity
@ tbb_Final_Activity
Definition: worktoolbar.h:108
WorkToolBar::tbb_Branch
@ tbb_Branch
Definition: worktoolbar.h:111
UMLApp::app
static UMLApp * app()
Definition: uml.cpp:278
WidgetBase::useFillColor
bool useFillColor()
Definition: widgetbase.cpp:419
UMLDoc::setModified
void setModified(bool modified=true)
Definition: umldoc.cpp:3136
WidgetBase
Common base class for UMLWidget and AssociationWidget.
Definition: widgetbase.h:105
Uml
Definition: basictypes.cpp:37
ActivityWidget::saveToXMI1
virtual void saveToXMI1(QDomDocument &qDoc, QDomElement &qElement)
Definition: activitywidget.cpp:336
ActivityWidget::showPropertiesDialog
virtual bool showPropertiesDialog()
Definition: activitywidget.cpp:157
UMLWidget::adjustAssocs
virtual void adjustAssocs(qreal dx, qreal dy)
Definition: umlwidget.cpp:1310
DocWindow::showDocumentation
void showDocumentation(UMLObject *object, bool overwrite=false)
Definition: docwindow.cpp:130
ActivityWidget::activityTypeStr
QString activityTypeStr() const
Definition: activitywidget.cpp:66
ActivityWidget::Branch
@ Branch
Definition: activitywidget.h:44
WidgetBase::lineColor
QColor lineColor() const
Definition: widgetbase.cpp:356
ActivityWidget::Initial
@ Initial
Definition: activitywidget.h:40
umlscene.h
uml.h
UMLWidget::setSize
void setSize(qreal width, qreal height)
Definition: umlwidget.cpp:1745
debug_utils.h
dialogspopupmenu.h
UMLScene
Definition: umlscene.h:69
ListPopupMenu::typeFromAction
static MenuType typeFromAction(QAction *action)
Definition: listpopupmenu.cpp:407
ActivityWidget::preconditionText
QString preconditionText() const
Definition: activitywidget.cpp:120
UMLWidget::updateGeometry
void updateGeometry(bool withAssocs=true)
Definition: umlwidget.cpp:1781
WidgetBase::wt_Activity
@ wt_Activity
Definition: widgetbase.h:128
ActivityWidget::m_preconditionText
QString m_preconditionText
Definition: activitywidget.h:94
ListPopupMenu::mt_Rename
@ mt_Rename
Definition: listpopupmenu.h:183
ActivityWidget::sigActMoved
void sigActMoved(qreal diffX, qreal diffY)
Definition: moc_activitywidget.cpp:174
UMLWidget::saveToXMI1
virtual void saveToXMI1(QDomDocument &qDoc, QDomElement &qElement)
Definition: umlwidget.cpp:2045
WorkToolBar::tbb_Activity
@ tbb_Activity
Definition: worktoolbar.h:106
ActivityWidget::loadFromXMI1
virtual bool loadFromXMI1(QDomElement &qElement)
Definition: activitywidget.cpp:318
WidgetBase::setName
virtual void setName(const QString &strName)
Definition: widgetbase.cpp:322
dialog_utils.h
WorkToolBar::tbb_Initial_Activity
@ tbb_Initial_Activity
Definition: worktoolbar.h:105
ActivityWidget::activityType
ActivityType activityType() const
Definition: activitywidget.cpp:58
UMLWidget::width
qreal width() const
Definition: umlwidget.h:121
Dialog_Utils::askRenameName
bool askRenameName(WidgetBase::WidgetType type, QString &name)
Definition: dialog_utils.cpp:164
ActivityWidget::m_postconditionText
QString m_postconditionText
Definition: activitywidget.h:95
UMLWidget::loadFromXMI1
virtual bool loadFromXMI1(QDomElement &qElement)
Definition: umlwidget.cpp:2067
UMLWidget::slotMenuSelection
virtual void slotMenuSelection(QAction *action)
Definition: umlwidget.cpp:768
UMLApp::document
UMLDoc * document() const
Definition: uml.cpp:1064
ActivityWidget::ActivityType
ActivityType
Definition: activitywidget.h:39
ActivityWidget::postconditionText
QString postconditionText() const
Definition: activitywidget.cpp:138
umldoc.h
ActivityWidget::paint
virtual void paint(QPainter *painter, const QStyleOptionGraphicsItem *option, QWidget *widget=0)
Definition: activitywidget.cpp:175
UMLWidget::constrain
virtual void constrain(qreal &width, qreal &height)
Definition: umlwidget.cpp:675
ActivityWidget::minimumSize
virtual QSizeF minimumSize() const
Definition: activitywidget.cpp:396
ActivityWidget::setActivityType
void setActivityType(ActivityType activityType)
Definition: activitywidget.cpp:74
UMLWidget::paint
virtual void paint(QPainter *painter, const QStyleOptionGraphicsItem *option, QWidget *widget=0)
Definition: umlwidget.cpp:1869
UMLWidget::m_resizable
bool m_resizable
Definition: umlwidget.h:306