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

floatingdashlinewidget.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 FLOATINGDASHLINEWIDGET_H
12 #define FLOATINGDASHLINEWIDGET_H
13
14 #include "umlwidget.h"
15 class CombinedFragmentWidget;
16
17 #define FLOATING_DASH_LINE_MARGIN 25
18 #define FLOATING_DASH_LINE_TEXT_MARGIN 5
19
20 /* how many pixels a user could click around a point */
21 #define POINT_DELTA 5
22
33 class FloatingDashLineWidget : public UMLWidget
34 {
35 Q_OBJECT
36 public:
37 explicit FloatingDashLineWidget(UMLScene * scene, Uml::ID::Type id = Uml::ID::None, CombinedFragmentWidget *parent = 0);
38 ~FloatingDashLineWidget();
39
40 virtual void paint(QPainter *painter, const QStyleOptionGraphicsItem *option = 0, QWidget *widget = 0);
41
42 void slotMenuSelection(QAction* action);
43
44 bool onLine(const QPointF& point);
45
46 void setText(const QString& text);
47
48 void setY(qreal y);
49 void setYMin(qreal yMin);
50 void setYMax(qreal yMax);
51 qreal getYMin() const;
52 qreal getDiffY() const;
53
54 void saveToXMI1(QDomDocument & qDoc, QDomElement & qElement);
55 bool loadFromXMI1(QDomElement & qElement);
56
57 private:
61 QString m_text;
62
67 qreal m_yMin;
68
73 qreal m_yMax;
74 CombinedFragmentWidget *m_parent;
75 };
76
77 #endif
FLOATING_DASH_LINE_TEXT_MARGIN
#define FLOATING_DASH_LINE_TEXT_MARGIN
Definition: floatingdashlinewidget.h:18
FloatingDashLineWidget::setYMin
void setYMin(qreal yMin)
Definition: floatingdashlinewidget.cpp:130
UMLWidget::height
qreal height() const
Definition: umlwidget.h:114
FloatingDashLineWidget::m_text
QString m_text
Definition: floatingdashlinewidget.h:61
WidgetBase::textColor
QColor textColor() const
Definition: widgetbase.cpp:335
FloatingDashLineWidget::slotMenuSelection
void slotMenuSelection(QAction *action)
Definition: floatingdashlinewidget.cpp:99
FloatingDashLineWidget::saveToXMI1
void saveToXMI1(QDomDocument &qDoc, QDomElement &qElement)
Definition: floatingdashlinewidget.cpp:162
umlview.h
FloatingDashLineWidget::m_parent
CombinedFragmentWidget * m_parent
Definition: floatingdashlinewidget.h:74
UMLWidget
The base class for graphical UML objects.
Definition: umlwidget.h:41
WidgetBase::name
QString name() const
Definition: widgetbase.cpp:309
FloatingDashLineWidget::m_yMin
qreal m_yMin
Definition: floatingdashlinewidget.h:67
UMLWidget::FT_NORMAL
@ FT_NORMAL
Definition: umlwidget.h:217
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
floatingdashlinewidget.h
FloatingDashLineWidget::loadFromXMI1
bool loadFromXMI1(QDomElement &qElement)
Definition: floatingdashlinewidget.cpp:176
Dialog_Utils::askName
bool askName(const QString &title, const QString &prompt, QString &name)
Definition: dialog_utils.cpp:97
Uml::ID::Type
std::string Type
Definition: basictypes.h:351
FloatingDashLineWidget::FloatingDashLineWidget
FloatingDashLineWidget(UMLScene *scene, Uml::ID::Type id=Uml::ID::None, CombinedFragmentWidget *parent=0)
Definition: floatingdashlinewidget.cpp:35
FloatingDashLineWidget::setText
void setText(const QString &text)
Definition: floatingdashlinewidget.cpp:81
FloatingDashLineWidget::getDiffY
qreal getDiffY() const
Definition: floatingdashlinewidget.cpp:154
UMLWidget::getFontMetrics
QFontMetrics & getFontMetrics(UMLWidget::FontType fontType) const
Definition: umlwidget.cpp:1936
WidgetBase::font
virtual QFont font() const
Definition: widgetbase.cpp:543
FLOATING_DASH_LINE_MARGIN
#define FLOATING_DASH_LINE_MARGIN
Definition: floatingdashlinewidget.h:17
umlwidget.h
ListPopupMenu::MenuType
MenuType
< This type hosts all possible menu entry types
Definition: listpopupmenu.h:44
i18n
#define i18n
Definition: main.cpp:39
FloatingDashLineWidget::setYMax
void setYMax(qreal yMax)
Definition: floatingdashlinewidget.cpp:138
FloatingDashLineWidget
A dash line for UML combined fragments.
Definition: floatingdashlinewidget.h:34
FloatingDashLineWidget::m_yMax
qreal m_yMax
Definition: floatingdashlinewidget.h:73
POINT_DELTA
#define POINT_DELTA
Definition: floatingdashlinewidget.h:21
widget_utils.h
FloatingDashLineWidget::onLine
bool onLine(const QPointF &point)
Definition: floatingdashlinewidget.cpp:89
WidgetBase
Common base class for UMLWidget and AssociationWidget.
Definition: widgetbase.h:105
FloatingDashLineWidget::~FloatingDashLineWidget
~FloatingDashLineWidget()
Definition: floatingdashlinewidget.cpp:51
Uml
Definition: basictypes.cpp:37
UMLWidget::setY
virtual void setY(qreal y)
Definition: umlwidget.cpp:1697
FloatingDashLineWidget::paint
virtual void paint(QPainter *painter, const QStyleOptionGraphicsItem *option=0, QWidget *widget=0)
Definition: floatingdashlinewidget.cpp:60
WidgetBase::lineColor
QColor lineColor() const
Definition: widgetbase.cpp:356
debug_utils.h
UMLScene
Definition: umlscene.h:69
ListPopupMenu::typeFromAction
static MenuType typeFromAction(QAction *action)
Definition: listpopupmenu.cpp:407
FloatingDashLineWidget::setY
void setY(qreal y)
Definition: floatingdashlinewidget.cpp:121
CombinedFragmentWidget::removeDashLine
void removeDashLine(FloatingDashLineWidget *line)
Definition: combinedfragmentwidget.cpp:383
ListPopupMenu::mt_Rename
@ mt_Rename
Definition: listpopupmenu.h:183
UMLWidget::saveToXMI1
virtual void saveToXMI1(QDomDocument &qDoc, QDomElement &qElement)
Definition: umlwidget.cpp:2045
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
FloatingDashLineWidget::getYMin
qreal getYMin() const
Definition: floatingdashlinewidget.cpp:146
UMLWidget::paint
virtual void paint(QPainter *painter, const QStyleOptionGraphicsItem *option, QWidget *widget=0)
Definition: umlwidget.cpp:1869