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(QDomDocument & qDoc, QDomElement & qElement);
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
UMLWidget::selectionMarkerSize
static const int selectionMarkerSize
Definition: umlwidget.h:50
CombinedFragmentWidget::m_dashLines
QList< FloatingDashLineWidget * > m_dashLines
Dash lines of an alternative or parallel combined fragment.
Definition: combinedfragmentwidget.h:91
UMLWidget::height
qreal height() const
Definition: umlwidget.h:114
ListPopupMenu::mt_AddInteractionOperand
@ mt_AddInteractionOperand
Definition: listpopupmenu.h:234
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
CombinedFragmentWidget::slotMenuSelection
void slotMenuSelection(QAction *action)
Definition: combinedfragmentwidget.cpp:410
umlview.h
UMLWidget
The base class for graphical UML objects.
Definition: umlwidget.h:41
WidgetBase::name
QString name() const
Definition: widgetbase.cpp:309
UMLWidget::setPenFromSettings
void setPenFromSettings(QPainter &p)
Definition: umlwidget.cpp:1392
UMLWidget::FT_NORMAL
@ FT_NORMAL
Definition: umlwidget.h:217
WidgetBase::umlScene
UMLScene * umlScene() const
Definition: widgetbase.cpp:162
CombinedFragmentWidget::boundingRect
virtual QRectF boundingRect() const
Definition: combinedfragmentwidget.cpp:497
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
CombinedFragmentWidget::shape
virtual QPainterPath shape() const
Definition: combinedfragmentwidget.cpp:503
CombinedFragmentWidget::combinedFragmentType
CombinedFragmentType combinedFragmentType() const
Definition: combinedfragmentwidget.cpp:219
CombinedFragmentWidget::CombinedFragmentWidget
CombinedFragmentWidget(UMLScene *scene, CombinedFragmentType combinedfragmentType=Ref, Uml::ID::Type id=Uml::ID::None)
Definition: combinedfragmentwidget.cpp:45
Dialog_Utils::askNameForWidget
void askNameForWidget(UMLWidget *&targetWidget, const QString &dialogTitle, const QString &dialogPrompt, const QString &defaultName)
Definition: dialog_utils.cpp:74
UMLWidget::cleanup
virtual void cleanup()
Definition: umlwidget.cpp:1706
CombinedFragmentWidget::saveToXMI1
void saveToXMI1(QDomDocument &qDoc, QDomElement &qElement)
Definition: combinedfragmentwidget.cpp:327
floatingdashlinewidget.h
FloatingDashLineWidget::loadFromXMI1
bool loadFromXMI1(QDomElement &qElement)
Definition: floatingdashlinewidget.cpp:176
CombinedFragmentWidget::Ass
@ Ass
Definition: combinedfragmentwidget.h:45
worktoolbar.h
CombinedFragmentWidget::minimumSize
QSizeF minimumSize() const
Definition: combinedfragmentwidget.cpp:197
WidgetBase::asCombinedFragmentWidget
CombinedFragmentWidget * asCombinedFragmentWidget()
Definition: widgetbase.cpp:1472
CombinedFragmentWidget::Neg
@ Neg
Definition: combinedfragmentwidget.h:43
Dialog_Utils::askName
bool askName(const QString &title, const QString &prompt, QString &name)
Definition: dialog_utils.cpp:96
WidgetBase::rect
QRectF rect() const
Definition: widgetbase.cpp:831
Uml::ID::Type
std::string Type
Definition: basictypes.h:351
CombinedFragmentWidget::m_CombinedFragment
CombinedFragmentType m_CombinedFragment
Type of CombinedFragment.
Definition: combinedfragmentwidget.h:85
CombinedFragmentWidget::toForeground
void toForeground()
Definition: combinedfragmentwidget.cpp:493
CombinedFragmentWidget::Ref
@ Ref
Definition: combinedfragmentwidget.h:39
CombinedFragmentWidget::paint
virtual void paint(QPainter *painter, const QStyleOptionGraphicsItem *option, QWidget *widget=0)
Definition: combinedfragmentwidget.cpp:66
UMLWidget::resizeMarkerLineCount
static const int resizeMarkerLineCount
Definition: umlwidget.h:51
UMLDoc::loading
bool loading() const
Definition: umldoc.cpp:1570
CombinedFragmentWidget::askNameForWidgetType
void askNameForWidgetType(UMLWidget *&targetWidget, const QString &dialogTitle, const QString &dialogPrompt, const QString &defaultName)
Definition: combinedfragmentwidget.cpp:279
CombinedFragmentWidget::loadFromXMI1
bool loadFromXMI1(QDomElement &qElement)
Definition: combinedfragmentwidget.cpp:346
CombinedFragmentWidget::Alt
@ Alt
Definition: combinedfragmentwidget.h:46
UMLScene::setupNewWidget
void setupNewWidget(UMLWidget *w, bool setPosition=true)
Definition: umlscene.cpp:715
UMLWidget::getFontMetrics
QFontMetrics & getFontMetrics(UMLWidget::FontType fontType) const
Definition: umlwidget.cpp:1936
WidgetBase::font
virtual QFont font() const
Definition: widgetbase.cpp:543
initialLabelWidth
static const int initialLabelWidth
Definition: combinedfragmentwidget.cpp:34
UMLWidget::showPropertiesDialog
virtual bool showPropertiesDialog()
Definition: umlwidget.cpp:1358
IDChangeLog
Definition: idchangelog.h:27
WidgetBase::fillColor
QColor fillColor() const
Definition: widgetbase.cpp:377
defaultWidth
static const int defaultWidth
Definition: combinedfragmentwidget.cpp:32
CombinedFragmentWidget::cleanup
virtual void cleanup()
Definition: combinedfragmentwidget.cpp:393
CombinedFragmentWidget::Crit
@ Crit
Definition: combinedfragmentwidget.h:44
umlwidget.h
UMLWidget::clipSize
void clipSize()
Definition: umlwidget.cpp:1805
UMLWidget::defaultMargin
static const int defaultMargin
Definition: umlwidget.h:49
ListPopupMenu::MenuType
MenuType
< This type hosts all possible menu entry types
Definition: listpopupmenu.h:44
labelBorderMargin
static const int labelBorderMargin
Definition: combinedfragmentwidget.cpp:36
CombinedFragmentWidget::CombinedFragmentType
CombinedFragmentType
Definition: combinedfragmentwidget.h:38
i18n
#define i18n
Definition: main.cpp:39
CombinedFragmentWidget::activate
virtual bool activate(IDChangeLog *ChangeLog=0)
Definition: combinedfragmentwidget.cpp:466
CombinedFragmentWidget::m_labelWidth
qreal m_labelWidth
Definition: combinedfragmentwidget.h:92
CombinedFragmentWidget::~CombinedFragmentWidget
virtual ~CombinedFragmentWidget()
Definition: combinedfragmentwidget.cpp:56
int
int int y int
Definition: cxx11-lambda-functions-and-expressions.h:4
WidgetBase::m_scene
UMLScene * m_scene
Definition: widgetbase.h:316
CombinedFragmentWidget::Par
@ Par
Definition: combinedfragmentwidget.h:47
FloatingDashLineWidget
A dash line for UML combined fragments.
Definition: floatingdashlinewidget.h:34
labelHeight
static const int labelHeight
Definition: combinedfragmentwidget.cpp:35
UMLApp::app
static UMLApp * app()
Definition: uml.cpp:269
CombinedFragmentWidget::Opt
@ Opt
Definition: combinedfragmentwidget.h:40
WidgetBase::useFillColor
bool useFillColor()
Definition: widgetbase.cpp:419
WidgetBase
Common base class for UMLWidget and AssociationWidget.
Definition: widgetbase.h:105
Uml
Definition: basictypes.cpp:37
defaultHeight
static const int defaultHeight
Definition: combinedfragmentwidget.cpp:33
WidgetBase::lineColor
QColor lineColor() const
Definition: widgetbase.cpp:356
UMLScene::removeWidgetCmd
void removeWidgetCmd(UMLWidget *o)
Definition: umlscene.cpp:1309
uError
#define uError()
Definition: debug_utils.h:123
umlscene.h
uml.h
CombinedFragmentWidget::setCombinedFragmentType
void setCombinedFragmentType(CombinedFragmentType combinedfragmentType)
Definition: combinedfragmentwidget.cpp:227
debug_utils.h
UMLScene
Definition: umlscene.h:69
ListPopupMenu::typeFromAction
static MenuType typeFromAction(QAction *action)
Definition: listpopupmenu.cpp:407
WidgetBase::lineWidth
uint lineWidth() const
Definition: widgetbase.cpp:398
CombinedFragmentWidget::Loop
@ Loop
Definition: combinedfragmentwidget.h:42
WidgetBase::m_Doc
QString m_Doc
Only used if m_umlObject is not set.
Definition: widgetbase.h:318
CombinedFragmentWidget::removeDashLine
void removeDashLine(FloatingDashLineWidget *line)
Definition: combinedfragmentwidget.cpp:383
CombinedFragmentWidget::Break
@ Break
Definition: combinedfragmentwidget.h:41
ListPopupMenu::mt_Rename
@ mt_Rename
Definition: listpopupmenu.h:183
UMLWidget::saveToXMI1
virtual void saveToXMI1(QDomDocument &qDoc, QDomElement &qElement)
Definition: umlwidget.cpp:2045
UMLScene::addWidgetCmd
void addWidgetCmd(UMLWidget *widget)
Definition: umlscene.cpp:614
listpopupmenu.h
dialog_utils.h
CombinedFragmentWidget
A graphical version of a UML combined fragment.
Definition: combinedfragmentwidget.h:33
combinedfragmentwidget.h
UMLWidget::width
qreal width() const
Definition: umlwidget.h:121
UMLWidget::loadFromXMI1
virtual bool loadFromXMI1(QDomElement &qElement)
Definition: umlwidget.cpp:2067
WidgetBase::m_Text
QString m_Text
Definition: widgetbase.h:319
UMLWidget::slotMenuSelection
virtual void slotMenuSelection(QAction *action)
Definition: umlwidget.cpp:768
UMLApp::document
UMLDoc * document() const
Definition: uml.cpp:1055
umldoc.h
CombinedFragmentWidget::setDashLineGeometryAndPosition
void setDashLineGeometryAndPosition() const
Definition: combinedfragmentwidget.cpp:480
UMLWidget::activate
virtual bool activate(IDChangeLog *changeLog=0)
Definition: umlwidget.cpp:1192
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