umbrello: umbrello/umlwidgets/combinedfragmentwidget.h Source File

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

- Main Page
- Related Pages
- Modules
- Namespaces
- Classes
- Files

- File List
- File Members

combinedfragmentwidget.h
Go to the documentation of this file.
1/*
2 SPDX-License-Identifier: GPL-2.0-or-later
3 SPDX-FileCopyrightText: 2002-2021 Umbrello UML Modeller Authors <umbrello-devel@kde.org>
4*/
5
6#ifndef COMBINEDFRAGMENTWIDGET_H
7#define COMBINEDFRAGMENTWIDGET_H
8
9#include "umlwidget.h"
10#include "worktoolbar.h"
11#include "floatingdashlinewidget.h"
12
13#include <QList>
14
27 class CombinedFragmentWidget : public UMLWidget
28{
29 Q_OBJECT
30
31public:
32 enum CombinedFragmentType
33 {
34 Ref = 0,
35 Opt,
36 Break,
37 Loop,
38 Neg,
39 Crit,
40 Ass,
41 Alt,
42 Par
43 };
44
45 explicit CombinedFragmentWidget(UMLScene * scene,
46 CombinedFragmentType combinedfragmentType = Ref,
47 Uml::ID::Type id = Uml::ID::None);
48 virtual ~CombinedFragmentWidget();
49
50 virtual void paint(QPainter *painter, const QStyleOptionGraphicsItem *option, QWidget *widget = 0);
51
52 CombinedFragmentType combinedFragmentType() const;
53 CombinedFragmentType combinedFragmentType(const QString& combinedfragmentType) const;
54 void setCombinedFragmentType(CombinedFragmentType combinedfragmentType);
55 void setCombinedFragmentType(const QString& combinedfragmentType);
56
57 void askNameForWidgetType(UMLWidget* &targetWidget, const QString& dialogTitle,
58 const QString& dialogPrompt, const QString& defaultName);
59
60 void saveToXMI(QXmlStreamWriter& writer);
61 bool loadFromXMI(QDomElement & qElement);
62 void removeDashLine(FloatingDashLineWidget *line);
63
64 virtual void cleanup();
65
66 virtual bool activate(IDChangeLog* ChangeLog = 0);
67
68 virtual QRectF boundingRect() const;
69 virtual QPainterPath shape() const;
70
71public slots:
72 void slotMenuSelection(QAction* action);
73
74
75protected:
76 QSizeF minimumSize() const;
77 void toForeground();
78
80 CombinedFragmentType m_CombinedFragment;
81
82private:
83 void setDashLineGeometryAndPosition() const;
84
86 QList<FloatingDashLineWidget*> m_dashLines;
87 qreal m_labelWidth;
88};
89
90#endif
CombinedFragmentWidget
A graphical version of a UML combined fragment.
Definition combinedfragmentwidget.h:28
CombinedFragmentWidget::toForeground
void toForeground()
Definition combinedfragmentwidget.cpp:484
CombinedFragmentWidget::slotMenuSelection
void slotMenuSelection(QAction *action)
Definition combinedfragmentwidget.cpp:401
CombinedFragmentWidget::combinedFragmentType
CombinedFragmentType combinedFragmentType() const
Definition combinedfragmentwidget.cpp:215
CombinedFragmentWidget::askNameForWidgetType
void askNameForWidgetType(UMLWidget *&targetWidget, const QString &dialogTitle, const QString &dialogPrompt, const QString &defaultName)
Definition combinedfragmentwidget.cpp:275
CombinedFragmentWidget::setCombinedFragmentType
void setCombinedFragmentType(CombinedFragmentType combinedfragmentType)
Definition combinedfragmentwidget.cpp:223
CombinedFragmentWidget::m_dashLines
QList< FloatingDashLineWidget * > m_dashLines
Dash lines of an alternative or parallel combined fragment.
Definition combinedfragmentwidget.h:86
CombinedFragmentWidget::shape
virtual QPainterPath shape() const
Definition combinedfragmentwidget.cpp:494
CombinedFragmentWidget::~CombinedFragmentWidget
virtual ~CombinedFragmentWidget()
Definition combinedfragmentwidget.cpp:52
CombinedFragmentWidget::saveToXMI
void saveToXMI(QXmlStreamWriter &writer)
Definition combinedfragmentwidget.cpp:318
CombinedFragmentWidget::setDashLineGeometryAndPosition
void setDashLineGeometryAndPosition() const
Definition combinedfragmentwidget.cpp:471
CombinedFragmentWidget::removeDashLine
void removeDashLine(FloatingDashLineWidget *line)
Definition combinedfragmentwidget.cpp:374
CombinedFragmentWidget::boundingRect
virtual QRectF boundingRect() const
Definition combinedfragmentwidget.cpp:488
CombinedFragmentWidget::m_CombinedFragment
CombinedFragmentType m_CombinedFragment
Type of CombinedFragment.
Definition combinedfragmentwidget.h:80
CombinedFragmentWidget::activate
virtual bool activate(IDChangeLog *ChangeLog=0)
Definition combinedfragmentwidget.cpp:457
CombinedFragmentWidget::cleanup
virtual void cleanup()
Definition combinedfragmentwidget.cpp:384
CombinedFragmentWidget::minimumSize
QSizeF minimumSize() const
Definition combinedfragmentwidget.cpp:193
CombinedFragmentWidget::loadFromXMI
bool loadFromXMI(QDomElement &qElement)
Definition combinedfragmentwidget.cpp:337
CombinedFragmentWidget::paint
virtual void paint(QPainter *painter, const QStyleOptionGraphicsItem *option, QWidget *widget=0)
Definition combinedfragmentwidget.cpp:62
CombinedFragmentWidget::CombinedFragmentType
CombinedFragmentType
Definition combinedfragmentwidget.h:33
CombinedFragmentWidget::Opt
@ Opt
Definition combinedfragmentwidget.h:35
CombinedFragmentWidget::Loop
@ Loop
Definition combinedfragmentwidget.h:37
CombinedFragmentWidget::Ref
@ Ref
Definition combinedfragmentwidget.h:34
CombinedFragmentWidget::Neg
@ Neg
Definition combinedfragmentwidget.h:38
CombinedFragmentWidget::Break
@ Break
Definition combinedfragmentwidget.h:36
CombinedFragmentWidget::Par
@ Par
Definition combinedfragmentwidget.h:42
CombinedFragmentWidget::Alt
@ Alt
Definition combinedfragmentwidget.h:41
CombinedFragmentWidget::Crit
@ Crit
Definition combinedfragmentwidget.h:39
CombinedFragmentWidget::Ass
@ Ass
Definition combinedfragmentwidget.h:40
CombinedFragmentWidget::m_labelWidth
qreal m_labelWidth
Definition combinedfragmentwidget.h:87
FloatingDashLineWidget
A dash line for UML combined fragments.
Definition floatingdashlinewidget.h:29
IDChangeLog
Definition idchangelog.h:22
UMLScene
Definition umlscene.h:65
UMLWidget
The base class for graphical UML objects.
Definition umlwidget.h:36
floatingdashlinewidget.h
Uml::ID::None
const Type None
special value for uninitialized ID
Definition basictypes.h:373
Uml::ID::Type
std::string Type
Definition basictypes.h:371
umlwidget.h
worktoolbar.h