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  SPDX-License-Identifier: GPL-2.0-or-later
3  SPDX-FileCopyrightText: 2002-2020 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 
28 {
29  Q_OBJECT
30 
31 public:
33  {
34  Ref = 0,
35  Opt,
38  Neg,
40  Ass,
41  Alt,
43  };
44 
45  explicit CombinedFragmentWidget(UMLScene * scene,
46  CombinedFragmentType combinedfragmentType = Ref,
48  virtual ~CombinedFragmentWidget();
49 
50  virtual void paint(QPainter *painter, const QStyleOptionGraphicsItem *option, QWidget *widget = 0);
51 
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 saveToXMI1(QXmlStreamWriter& writer);
61  bool loadFromXMI1(QDomElement & qElement);
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 
71 public slots:
72  void slotMenuSelection(QAction* action);
73 
74 
75 protected:
76  QSizeF minimumSize() const;
77  void toForeground();
78 
81 
82 private:
83  void setDashLineGeometryAndPosition() const;
84 
86  QList<FloatingDashLineWidget*> m_dashLines;
87  qreal m_labelWidth;
88 };
89 
90 #endif
UMLWidget::selectionMarkerSize
static const int selectionMarkerSize
Definition: umlwidget.h:45
document
GNU GENERAL PUBLIC LICENSE June Free Software Inc Franklin Fifth USA Everyone is permitted to copy and distribute verbatim copies of this license document
Definition: GPL-2.0-only.txt:8
CombinedFragmentWidget::m_dashLines
QList< FloatingDashLineWidget * > m_dashLines
Dash lines of an alternative or parallel combined fragment.
Definition: combinedfragmentwidget.h:86
UMLWidget::height
qreal height() const
Definition: umlwidget.h:112
ListPopupMenu::mt_AddInteractionOperand
@ mt_AddInteractionOperand
Definition: listpopupmenu.h:229
x
int x
Definition: cxx11-lambda-functions-and-expressions.h:4
WidgetBase::textColor
QColor textColor() const
Definition: widgetbase.cpp:342
ListPopupMenu::mt_Properties
@ mt_Properties
Definition: listpopupmenu.h:177
CombinedFragmentWidget::slotMenuSelection
void slotMenuSelection(QAction *action)
Definition: combinedfragmentwidget.cpp:406
umlview.h
UMLWidget
The base class for graphical UML objects.
Definition: umlwidget.h:35
WidgetBase::name
QString name() const
Definition: widgetbase.cpp:316
UMLWidget::setPenFromSettings
void setPenFromSettings(QPainter &p)
Definition: umlwidget.cpp:1400
UMLWidget::FT_NORMAL
@ FT_NORMAL
Definition: umlwidget.h:216
UMLWidget::saveToXMI1
virtual void saveToXMI1(QXmlStreamWriter &writer)
Definition: umlwidget.cpp:2140
WidgetBase::umlScene
UMLScene * umlScene() const
Definition: widgetbase.cpp:169
CombinedFragmentWidget::boundingRect
virtual QRectF boundingRect() const
Definition: combinedfragmentwidget.cpp:493
DEBUG_REGISTER_DISABLED
#define DEBUG_REGISTER_DISABLED(src)
Definition: debug_utils.h:118
Uml::ID::None
const Type None
special value for uninitialized ID
Definition: basictypes.h:373
CombinedFragmentWidget::shape
virtual QPainterPath shape() const
Definition: combinedfragmentwidget.cpp:499
CombinedFragmentWidget::combinedFragmentType
CombinedFragmentType combinedFragmentType() const
Definition: combinedfragmentwidget.cpp:215
CombinedFragmentWidget::CombinedFragmentWidget
CombinedFragmentWidget(UMLScene *scene, CombinedFragmentType combinedfragmentType=Ref, Uml::ID::Type id=Uml::ID::None)
Definition: combinedfragmentwidget.cpp:41
Dialog_Utils::askNameForWidget
void askNameForWidget(UMLWidget *&targetWidget, const QString &dialogTitle, const QString &dialogPrompt, const QString &defaultName)
Definition: dialog_utils.cpp:168
UMLWidget::cleanup
virtual void cleanup()
Definition: umlwidget.cpp:1747
floatingdashlinewidget.h
FloatingDashLineWidget::loadFromXMI1
bool loadFromXMI1(QDomElement &qElement)
Definition: floatingdashlinewidget.cpp:172
CombinedFragmentWidget::Ass
@ Ass
Definition: combinedfragmentwidget.h:40
worktoolbar.h
CombinedFragmentWidget::minimumSize
QSizeF minimumSize() const
Definition: combinedfragmentwidget.cpp:193
WidgetBase::asCombinedFragmentWidget
CombinedFragmentWidget * asCombinedFragmentWidget()
Definition: widgetbase.cpp:1481
CombinedFragmentWidget::Neg
@ Neg
Definition: combinedfragmentwidget.h:38
Dialog_Utils::askName
bool askName(const QString &title, const QString &prompt, QString &name)
Definition: dialog_utils.cpp:190
WidgetBase::rect
QRectF rect() const
Definition: widgetbase.cpp:835
Uml::ID::Type
std::string Type
Definition: basictypes.h:371
CombinedFragmentWidget::m_CombinedFragment
CombinedFragmentType m_CombinedFragment
Type of CombinedFragment.
Definition: combinedfragmentwidget.h:80
CombinedFragmentWidget::toForeground
void toForeground()
Definition: combinedfragmentwidget.cpp:489
CombinedFragmentWidget::Ref
@ Ref
Definition: combinedfragmentwidget.h:34
CombinedFragmentWidget::paint
virtual void paint(QPainter *painter, const QStyleOptionGraphicsItem *option, QWidget *widget=0)
Definition: combinedfragmentwidget.cpp:62
UMLWidget::resizeMarkerLineCount
static const int resizeMarkerLineCount
Definition: umlwidget.h:46
UMLDoc::loading
bool loading() const
Definition: umldoc.cpp:1573
CombinedFragmentWidget::askNameForWidgetType
void askNameForWidgetType(UMLWidget *&targetWidget, const QString &dialogTitle, const QString &dialogPrompt, const QString &defaultName)
Definition: combinedfragmentwidget.cpp:275
CombinedFragmentWidget::loadFromXMI1
bool loadFromXMI1(QDomElement &qElement)
Definition: combinedfragmentwidget.cpp:342
CombinedFragmentWidget::Alt
@ Alt
Definition: combinedfragmentwidget.h:41
CombinedFragmentWidget::saveToXMI1
void saveToXMI1(QXmlStreamWriter &writer)
Definition: combinedfragmentwidget.cpp:323
UMLScene::setupNewWidget
void setupNewWidget(UMLWidget *w, bool setPosition=true)
Definition: umlscene.cpp:711
UMLWidget::getFontMetrics
QFontMetrics & getFontMetrics(UMLWidget::FontType fontType) const
Definition: umlwidget.cpp:1990
WidgetBase::font
virtual QFont font() const
Definition: widgetbase.cpp:550
initialLabelWidth
static const int initialLabelWidth
Definition: combinedfragmentwidget.cpp:30
UMLWidget::showPropertiesDialog
virtual bool showPropertiesDialog()
Definition: umlwidget.cpp:1366
IDChangeLog
Definition: idchangelog.h:21
WidgetBase::fillColor
QColor fillColor() const
Definition: widgetbase.cpp:384
defaultWidth
static const int defaultWidth
Definition: combinedfragmentwidget.cpp:28
CombinedFragmentWidget::cleanup
virtual void cleanup()
Definition: combinedfragmentwidget.cpp:389
CombinedFragmentWidget::Crit
@ Crit
Definition: combinedfragmentwidget.h:39
it
and that you know you can do these things To protect your we need to make restrictions that forbid anyone to deny you these rights or to ask you to surrender the rights These restrictions translate to certain responsibilities for you if you distribute copies of the or if you modify it For if you distribute copies of such a whether gratis or for a you must give the recipients all the rights that you have You must make sure that receive or can get the source code And you must show them these terms so they know their rights We protect your rights with two distribute and or modify the software for each author s protection and we want to make certain that everyone understands that there is no warranty for this free software If the software is modified by someone else and passed we want its recipients to know that what they have is not the so that any problems introduced by others will not reflect on the original authors reputations any free program is threatened constantly by software patents We wish to avoid the danger that redistributors of a free program will individually obtain patent in effect making the program proprietary To prevent we have made it clear that any patent must be licensed for everyone s free use or not licensed at all The precise terms and conditions for distribution and modification follow TERMS AND CONDITIONS FOR DISTRIBUTION AND MODIFICATION This License applies to any program or other work which contains a notice placed by the copyright holder saying it may be distributed under the terms of this General Public License The refers to any such program or and a work based on the Program means either the Program or any derivative work under copyright a work containing the Program or a portion of it
Definition: GPL-2.0-only.txt:64
number
it is up to the author donor to decide if he or she is willing to distribute software through any other system and a licensee cannot impose that choice This section is intended to make thoroughly clear what is believed to be a consequence of the rest of this License If the distribution and or use of the Library is restricted in certain countries either by patents or by copyrighted the original copyright holder who places the Library under this License may add an geographical distribution limitation excluding those so that distribution is permitted only in or among countries not thus excluded In such this License incorporates the limitation as if written in the body of this License The Free Software Foundation may publish revised and or new versions of the Library General Public License from time to time Such new versions will be similar in spirit to the present but may differ in detail to address new problems or concerns Each version is given a distinguishing version number If the Library specifies a version number of this License which applies to it and any later you have the option of following the terms and conditions either of that version or of any later version published by the Free Software Foundation If the Library does not specify a license version number
Definition: LGPL-2.0-only.txt:368
umlwidget.h
UMLWidget::clipSize
void clipSize()
Definition: umlwidget.cpp:1846
UMLWidget::defaultMargin
static const int defaultMargin
Definition: umlwidget.h:44
ListPopupMenu::MenuType
MenuType
< This type hosts all possible menu entry types
Definition: listpopupmenu.h:38
labelBorderMargin
static const int labelBorderMargin
Definition: combinedfragmentwidget.cpp:32
CombinedFragmentWidget::CombinedFragmentType
CombinedFragmentType
Definition: combinedfragmentwidget.h:32
i18n
#define i18n
Definition: main.cpp:34
CombinedFragmentWidget::activate
virtual bool activate(IDChangeLog *ChangeLog=0)
Definition: combinedfragmentwidget.cpp:462
CombinedFragmentWidget::m_labelWidth
qreal m_labelWidth
Definition: combinedfragmentwidget.h:87
CombinedFragmentWidget::~CombinedFragmentWidget
virtual ~CombinedFragmentWidget()
Definition: combinedfragmentwidget.cpp:52
int
int int y int
Definition: cxx11-lambda-functions-and-expressions.h:4
WidgetBase::m_scene
UMLScene * m_scene
Definition: widgetbase.h:312
CombinedFragmentWidget::Par
@ Par
Definition: combinedfragmentwidget.h:42
FloatingDashLineWidget
A dash line for UML combined fragments.
Definition: floatingdashlinewidget.h:28
labelHeight
static const int labelHeight
Definition: combinedfragmentwidget.cpp:31
UMLApp::app
static UMLApp * app()
Definition: uml.cpp:275
CombinedFragmentWidget::Opt
@ Opt
Definition: combinedfragmentwidget.h:35
WidgetBase::useFillColor
bool useFillColor()
Definition: widgetbase.cpp:426
WidgetBase
Common base class for UMLWidget and AssociationWidget.
Definition: widgetbase.h:100
Uml
Definition: basictypes.cpp:22
defaultHeight
static const int defaultHeight
Definition: combinedfragmentwidget.cpp:29
WidgetBase::lineColor
QColor lineColor() const
Definition: widgetbase.cpp:363
UMLScene::removeWidgetCmd
void removeWidgetCmd(UMLWidget *o)
Definition: umlscene.cpp:1305
uError
#define uError()
Definition: debug_utils.h:109
umlscene.h
uml.h
CombinedFragmentWidget::setCombinedFragmentType
void setCombinedFragmentType(CombinedFragmentType combinedfragmentType)
Definition: combinedfragmentwidget.cpp:223
debug_utils.h
UMLScene
Definition: umlscene.h:64
ListPopupMenu::typeFromAction
static MenuType typeFromAction(QAction *action)
Definition: listpopupmenu.cpp:406
WidgetBase::lineWidth
uint lineWidth() const
Definition: widgetbase.cpp:405
CombinedFragmentWidget::Loop
@ Loop
Definition: combinedfragmentwidget.h:37
WidgetBase::m_Doc
QString m_Doc
Only used if m_umlObject is not set.
Definition: widgetbase.h:314
CombinedFragmentWidget::removeDashLine
void removeDashLine(FloatingDashLineWidget *line)
Definition: combinedfragmentwidget.cpp:379
CombinedFragmentWidget::Break
@ Break
Definition: combinedfragmentwidget.h:36
ListPopupMenu::mt_Rename
@ mt_Rename
Definition: listpopupmenu.h:178
UMLScene::addWidgetCmd
void addWidgetCmd(UMLWidget *widget)
Definition: umlscene.cpp:610
listpopupmenu.h
dialog_utils.h
CombinedFragmentWidget
A graphical version of a UML combined fragment.
Definition: combinedfragmentwidget.h:27
combinedfragmentwidget.h
UMLWidget::width
qreal width() const
Definition: umlwidget.h:119
UMLWidget::loadFromXMI1
virtual bool loadFromXMI1(QDomElement &qElement)
Definition: umlwidget.cpp:2163
WidgetBase::m_Text
QString m_Text
Definition: widgetbase.h:315
UMLWidget::slotMenuSelection
virtual void slotMenuSelection(QAction *action)
Definition: umlwidget.cpp:776
UMLApp::document
UMLDoc * document() const
Definition: uml.cpp:1063
umldoc.h
CombinedFragmentWidget::setDashLineGeometryAndPosition
void setDashLineGeometryAndPosition() const
Definition: combinedfragmentwidget.cpp:476
UMLWidget::activate
virtual bool activate(IDChangeLog *changeLog=0)
Definition: umlwidget.cpp:1200
UMLWidget::paint
virtual void paint(QPainter *painter, const QStyleOptionGraphicsItem *option, QWidget *widget=0)
Definition: umlwidget.cpp:1910
UMLWidget::m_resizable
bool m_resizable
Definition: umlwidget.h:305