umbrello  2.31.3
Umbrello UML Modeller is a Unified Modelling Language (UML) diagram program based on KDE Technology
forkjoinwidget.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) 2005-2020 *
8  * Umbrello UML Modeller Authors <umbrello-devel@kde.org> *
9  ***************************************************************************/
10 
11 #ifndef FORKJOINWIDGET_H
12 #define FORKJOINWIDGET_H
13 
14 //app includes
15 #include "boxwidget.h"
16 
25 class ForkJoinWidget : public BoxWidget
26 {
27  Q_OBJECT
28  Q_PROPERTY(Qt::Orientation orientation READ orientation WRITE setOrientation)
29 public:
30  explicit ForkJoinWidget(UMLScene * scene, Qt::Orientation ori = Qt::Horizontal, Uml::ID::Type id = Uml::ID::None);
31  virtual ~ForkJoinWidget();
32 
33  Qt::Orientation orientation() const;
34  void setOrientation(Qt::Orientation ori);
35 
36  virtual void paint(QPainter *painter, const QStyleOptionGraphicsItem *option, QWidget *widget = 0);
37 
38  virtual bool loadFromXMI1(QDomElement & qElement);
39  virtual void saveToXMI1(QDomDocument& qDoc, QDomElement& qElement);
40 
41  virtual bool showPropertiesDialog();
42 
43 public Q_SLOTS:
44  virtual void slotMenuSelection(QAction* action);
45 
46 protected:
47  QSizeF minimumSize() const;
48 
49  virtual void paintSelected(QPainter * p, int offsetX = 0, int offsetY = 0);
50 
51  void constrain(qreal& width, qreal& height);
52 
53 private:
54  Qt::Orientation m_orientation;
55 };
56 
57 #endif
QSizeF minimumSize() const
Definition: forkjoinwidget.cpp:159
Qt::Orientation m_orientation
whether to draw the plate horizontally or vertically
Definition: forkjoinwidget.h:54
virtual void paintSelected(QPainter *p, int offsetX=0, int offsetY=0)
Definition: forkjoinwidget.cpp:173
void constrain(qreal &width, qreal &height)
Definition: forkjoinwidget.cpp:183
Displays a fork/join plate in a state diagram.
Definition: forkjoinwidget.h:25
qreal height() const
Definition: umlwidget.h:114
void setOrientation(Qt::Orientation ori)
Definition: forkjoinwidget.cpp:59
virtual bool loadFromXMI1(QDomElement &qElement)
Definition: forkjoinwidget.cpp:84
virtual void slotMenuSelection(QAction *action)
Definition: forkjoinwidget.cpp:138
virtual ~ForkJoinWidget()
Definition: forkjoinwidget.cpp:44
std::string Type
Definition: basictypes.h:351
qreal width() const
Definition: umlwidget.h:121
Displays a box.
Definition: boxwidget.h:27
virtual void saveToXMI1(QDomDocument &qDoc, QDomElement &qElement)
Definition: forkjoinwidget.cpp:106
virtual bool showPropertiesDialog()
Definition: forkjoinwidget.cpp:121
virtual void paint(QPainter *painter, const QStyleOptionGraphicsItem *option, QWidget *widget=0)
Definition: forkjoinwidget.cpp:70
ForkJoinWidget(UMLScene *scene, Qt::Orientation ori=Qt::Horizontal, Uml::ID::Type id=Uml::ID::None)
Definition: forkjoinwidget.cpp:32
const Type None
special value for uninitialized ID
Definition: basictypes.h:353
Qt::Orientation orientation() const
Definition: umlscene.h:68