umbrello: umbrello/umlwidgets/floatingdashlinewidget.h Source File

umbrello 2.32.0 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(QXmlStreamWriter& writer);
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
CombinedFragmentWidget
A graphical version of a UML combined fragment.
Definition: combinedfragmentwidget.h:33
FloatingDashLineWidget
A dash line for UML combined fragments.
Definition: floatingdashlinewidget.h:34
FloatingDashLineWidget::m_yMin
qreal m_yMin
Definition: floatingdashlinewidget.h:67
FloatingDashLineWidget::m_text
QString m_text
Definition: floatingdashlinewidget.h:61
FloatingDashLineWidget::setY
void setY(qreal y)
Definition: floatingdashlinewidget.cpp:122
FloatingDashLineWidget::paint
virtual void paint(QPainter *painter, const QStyleOptionGraphicsItem *option=0, QWidget *widget=0)
Definition: floatingdashlinewidget.cpp:61
FloatingDashLineWidget::~FloatingDashLineWidget
~FloatingDashLineWidget()
Definition: floatingdashlinewidget.cpp:52
FloatingDashLineWidget::getDiffY
qreal getDiffY() const
Definition: floatingdashlinewidget.cpp:155
FloatingDashLineWidget::setYMin
void setYMin(qreal yMin)
Definition: floatingdashlinewidget.cpp:131
FloatingDashLineWidget::m_parent
CombinedFragmentWidget * m_parent
Definition: floatingdashlinewidget.h:74
FloatingDashLineWidget::FloatingDashLineWidget
FloatingDashLineWidget(UMLScene *scene, Uml::ID::Type id=Uml::ID::None, CombinedFragmentWidget *parent=0)
Definition: floatingdashlinewidget.cpp:36
FloatingDashLineWidget::loadFromXMI1
bool loadFromXMI1(QDomElement &qElement)
Definition: floatingdashlinewidget.cpp:177
FloatingDashLineWidget::saveToXMI1
void saveToXMI1(QXmlStreamWriter &writer)
Definition: floatingdashlinewidget.cpp:163
FloatingDashLineWidget::m_yMax
qreal m_yMax
Definition: floatingdashlinewidget.h:73
FloatingDashLineWidget::slotMenuSelection
void slotMenuSelection(QAction *action)
Definition: floatingdashlinewidget.cpp:100
FloatingDashLineWidget::getYMin
qreal getYMin() const
Definition: floatingdashlinewidget.cpp:147
FloatingDashLineWidget::onLine
bool onLine(const QPointF &point)
Definition: floatingdashlinewidget.cpp:90
FloatingDashLineWidget::setYMax
void setYMax(qreal yMax)
Definition: floatingdashlinewidget.cpp:139
FloatingDashLineWidget::setText
void setText(const QString &text)
Definition: floatingdashlinewidget.cpp:82
UMLScene
Definition: umlscene.h:70
UMLWidget
The base class for graphical UML objects.
Definition: umlwidget.h:41
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