umbrello  2.31.90
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(QXmlStreamWriter& writer);
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
Displays a box.
Definition: boxwidget.h:28
Displays a fork/join plate in a state diagram.
Definition: forkjoinwidget.h:26
ForkJoinWidget(UMLScene *scene, Qt::Orientation ori=Qt::Horizontal, Uml::ID::Type id=Uml::ID::None)
Definition: forkjoinwidget.cpp:33
virtual void saveToXMI1(QXmlStreamWriter &writer)
Definition: forkjoinwidget.cpp:107
virtual void paint(QPainter *painter, const QStyleOptionGraphicsItem *option, QWidget *widget=0)
Definition: forkjoinwidget.cpp:71
virtual bool loadFromXMI1(QDomElement &qElement)
Definition: forkjoinwidget.cpp:85
Qt::Orientation m_orientation
whether to draw the plate horizontally or vertically
Definition: forkjoinwidget.h:54
virtual void slotMenuSelection(QAction *action)
Definition: forkjoinwidget.cpp:139
void setOrientation(Qt::Orientation ori)
Definition: forkjoinwidget.cpp:60
void constrain(qreal &width, qreal &height)
Definition: forkjoinwidget.cpp:184
virtual void paintSelected(QPainter *p, int offsetX=0, int offsetY=0)
Definition: forkjoinwidget.cpp:174
virtual bool showPropertiesDialog()
Definition: forkjoinwidget.cpp:122
Qt::Orientation orientation
Definition: forkjoinwidget.h:28
virtual ~ForkJoinWidget()
Definition: forkjoinwidget.cpp:45
QSizeF minimumSize() const
Definition: forkjoinwidget.cpp:160
Definition: umlscene.h:70
qreal width() const
Definition: umlwidget.h:124
qreal height() const
Definition: umlwidget.h:117
const Type None
special value for uninitialized ID
Definition: basictypes.h:387
std::string Type
Definition: basictypes.h:385