umbrello: umbrello/umlwidgets/combinedfragmentwidget.h Source File

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

combinedfragmentwidget.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 COMBINEDFRAGMENTWIDGET_H
12 #define COMBINEDFRAGMENTWIDGET_H
13
14 #include "umlwidget.h"
15 #include "worktoolbar.h"
16 #include "floatingdashlinewidget.h"
17
18 #include <QList>
19
32 class CombinedFragmentWidget : public UMLWidget
33 {
34 Q_OBJECT
35
36 public:
37 enum CombinedFragmentType
38 {
39 Ref = 0,
40 Opt,
41 Break,
42 Loop,
43 Neg,
44 Crit,
45 Ass,
46 Alt,
47 Par
48 };
49
50 explicit CombinedFragmentWidget(UMLScene * scene,
51 CombinedFragmentType combinedfragmentType = Ref,
52 Uml::ID::Type id = Uml::ID::None);
53 virtual ~CombinedFragmentWidget();
54
55 virtual void paint(QPainter *painter, const QStyleOptionGraphicsItem *option, QWidget *widget = 0);
56
57 CombinedFragmentType combinedFragmentType() const;
58 CombinedFragmentType combinedFragmentType(const QString& combinedfragmentType) const;
59 void setCombinedFragmentType(CombinedFragmentType combinedfragmentType);
60 void setCombinedFragmentType(const QString& combinedfragmentType);
61
62 void askNameForWidgetType(UMLWidget* &targetWidget, const QString& dialogTitle,
63 const QString& dialogPrompt, const QString& defaultName);
64
65 void saveToXMI1(QXmlStreamWriter& writer);
66 bool loadFromXMI1(QDomElement & qElement);
67 void removeDashLine(FloatingDashLineWidget *line);
68
69 virtual void cleanup();
70
71 virtual bool activate(IDChangeLog* ChangeLog = 0);
72
73 virtual QRectF boundingRect() const;
74 virtual QPainterPath shape() const;
75
76 public slots:
77 void slotMenuSelection(QAction* action);
78
79
80 protected:
81 QSizeF minimumSize() const;
82 void toForeground();
83
85 CombinedFragmentType m_CombinedFragment;
86
87 private:
88 void setDashLineGeometryAndPosition() const;
89
91 QList<FloatingDashLineWidget*> m_dashLines;
92 qreal m_labelWidth;
93 };
94
95 #endif
CombinedFragmentWidget
A graphical version of a UML combined fragment.
Definition: combinedfragmentwidget.h:33
CombinedFragmentWidget::toForeground
void toForeground()
Definition: combinedfragmentwidget.cpp:494
CombinedFragmentWidget::slotMenuSelection
void slotMenuSelection(QAction *action)
Definition: combinedfragmentwidget.cpp:411
CombinedFragmentWidget::combinedFragmentType
CombinedFragmentType combinedFragmentType() const
Definition: combinedfragmentwidget.cpp:220
CombinedFragmentWidget::askNameForWidgetType
void askNameForWidgetType(UMLWidget *&targetWidget, const QString &dialogTitle, const QString &dialogPrompt, const QString &defaultName)
Definition: combinedfragmentwidget.cpp:280
CombinedFragmentWidget::setCombinedFragmentType
void setCombinedFragmentType(CombinedFragmentType combinedfragmentType)
Definition: combinedfragmentwidget.cpp:228
CombinedFragmentWidget::CombinedFragmentWidget
CombinedFragmentWidget(UMLScene *scene, CombinedFragmentType combinedfragmentType=Ref, Uml::ID::Type id=Uml::ID::None)
Definition: combinedfragmentwidget.cpp:46
CombinedFragmentWidget::m_dashLines
QList< FloatingDashLineWidget * > m_dashLines
Dash lines of an alternative or parallel combined fragment.
Definition: combinedfragmentwidget.h:91
CombinedFragmentWidget::shape
virtual QPainterPath shape() const
Definition: combinedfragmentwidget.cpp:504
CombinedFragmentWidget::~CombinedFragmentWidget
virtual ~CombinedFragmentWidget()
Definition: combinedfragmentwidget.cpp:57
CombinedFragmentWidget::setDashLineGeometryAndPosition
void setDashLineGeometryAndPosition() const
Definition: combinedfragmentwidget.cpp:481
CombinedFragmentWidget::removeDashLine
void removeDashLine(FloatingDashLineWidget *line)
Definition: combinedfragmentwidget.cpp:384
CombinedFragmentWidget::saveToXMI1
void saveToXMI1(QXmlStreamWriter &writer)
Definition: combinedfragmentwidget.cpp:328
CombinedFragmentWidget::loadFromXMI1
bool loadFromXMI1(QDomElement &qElement)
Definition: combinedfragmentwidget.cpp:347
CombinedFragmentWidget::boundingRect
virtual QRectF boundingRect() const
Definition: combinedfragmentwidget.cpp:498
CombinedFragmentWidget::m_CombinedFragment
CombinedFragmentType m_CombinedFragment
Type of CombinedFragment.
Definition: combinedfragmentwidget.h:85
CombinedFragmentWidget::activate
virtual bool activate(IDChangeLog *ChangeLog=0)
Definition: combinedfragmentwidget.cpp:467
CombinedFragmentWidget::cleanup
virtual void cleanup()
Definition: combinedfragmentwidget.cpp:394
CombinedFragmentWidget::minimumSize
QSizeF minimumSize() const
Definition: combinedfragmentwidget.cpp:198
CombinedFragmentWidget::paint
virtual void paint(QPainter *painter, const QStyleOptionGraphicsItem *option, QWidget *widget=0)
Definition: combinedfragmentwidget.cpp:67
CombinedFragmentWidget::CombinedFragmentType
CombinedFragmentType
Definition: combinedfragmentwidget.h:38
CombinedFragmentWidget::Opt
@ Opt
Definition: combinedfragmentwidget.h:40
CombinedFragmentWidget::Loop
@ Loop
Definition: combinedfragmentwidget.h:42
CombinedFragmentWidget::Ref
@ Ref
Definition: combinedfragmentwidget.h:39
CombinedFragmentWidget::Neg
@ Neg
Definition: combinedfragmentwidget.h:43
CombinedFragmentWidget::Break
@ Break
Definition: combinedfragmentwidget.h:41
CombinedFragmentWidget::Par
@ Par
Definition: combinedfragmentwidget.h:47
CombinedFragmentWidget::Alt
@ Alt
Definition: combinedfragmentwidget.h:46
CombinedFragmentWidget::Crit
@ Crit
Definition: combinedfragmentwidget.h:44
CombinedFragmentWidget::Ass
@ Ass
Definition: combinedfragmentwidget.h:45
CombinedFragmentWidget::m_labelWidth
qreal m_labelWidth
Definition: combinedfragmentwidget.h:92
FloatingDashLineWidget
A dash line for UML combined fragments.
Definition: floatingdashlinewidget.h:34
IDChangeLog
Definition: idchangelog.h:27
UMLScene
Definition: umlscene.h:70
UMLWidget
The base class for graphical UML objects.
Definition: umlwidget.h:41
floatingdashlinewidget.h
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