umbrello  2.31.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"
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 
34 {
35  Q_OBJECT
36 public:
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;
75 };
76 
77 #endif
void setText(const QString &text)
Definition: floatingdashlinewidget.cpp:81
bool onLine(const QPointF &point)
Definition: floatingdashlinewidget.cpp:89
~FloatingDashLineWidget()
Definition: floatingdashlinewidget.cpp:51
void setY(qreal y)
Definition: floatingdashlinewidget.cpp:121
qreal getDiffY() const
Definition: floatingdashlinewidget.cpp:154
void setYMax(qreal yMax)
Definition: floatingdashlinewidget.cpp:138
void slotMenuSelection(QAction *action)
Definition: floatingdashlinewidget.cpp:99
CombinedFragmentWidget * m_parent
Definition: floatingdashlinewidget.h:74
void setYMin(qreal yMin)
Definition: floatingdashlinewidget.cpp:130
A dash line for UML combined fragments.
Definition: floatingdashlinewidget.h:33
FloatingDashLineWidget(UMLScene *scene, Uml::ID::Type id=Uml::ID::None, CombinedFragmentWidget *parent=0)
Definition: floatingdashlinewidget.cpp:35
bool loadFromXMI1(QDomElement &qElement)
Definition: floatingdashlinewidget.cpp:176
std::string Type
Definition: basictypes.h:351
qreal getYMin() const
Definition: floatingdashlinewidget.cpp:146
void saveToXMI1(QDomDocument &qDoc, QDomElement &qElement)
Definition: floatingdashlinewidget.cpp:162
QString m_text
Definition: floatingdashlinewidget.h:61
A graphical version of a UML combined fragment.
Definition: combinedfragmentwidget.h:32
qreal m_yMin
Definition: floatingdashlinewidget.h:67
qreal m_yMax
Definition: floatingdashlinewidget.h:73
const Type None
special value for uninitialized ID
Definition: basictypes.h:353
Definition: umlscene.h:68
virtual void paint(QPainter *painter, const QStyleOptionGraphicsItem *option=0, QWidget *widget=0)
Definition: floatingdashlinewidget.cpp:60
The base class for graphical UML objects.
Definition: umlwidget.h:40