umbrello: umbrello/umlwidgets/objectwidget.h Source File

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

objectwidget.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 OBJECTWIDGET_H
12 #define OBJECTWIDGET_H
13
14 #include "messagewidgetlist.h"
15 #include "umlwidget.h"
16
17 class MessageWidget;
18 class SeqLineWidget;
19 class UMLScene;
20
32 class ObjectWidget : public UMLWidget
33 {
34 Q_OBJECT
35 public:
36 ObjectWidget(UMLScene *scene, UMLObject *o);
37 virtual ~ObjectWidget();
38
39 virtual void setX(qreal x);
40 virtual void setY(qreal y);
41
42 qreal centerX();
43
44 void setMultipleInstance(bool multiple);
45 bool multipleInstance() const;
46
47 void setSelected(bool state);
48
49 virtual void paint(QPainter *painter, const QStyleOptionGraphicsItem *option, QWidget *widget = 0);
50
51 bool activate(IDChangeLog* ChangeLog = 0);
52
53 void cleanup();
54
55 virtual bool showPropertiesDialog();
56
57 void setDrawAsActor(bool drawAsActor);
58 bool drawAsActor() const;
59
60 void setShowDestruction(bool bShow);
61 bool showDestruction() const;
62
63 int topMargin();
64
65 void setEndLine(int yPosition);
66 int getEndLineY();
67
68 void messageAdded(MessageWidget* message);
69 void messageRemoved(MessageWidget* message);
70
71 bool canTabUp();
72
73 bool messageOverlap(qreal y, MessageWidget* messageWidget);
74
75 virtual void setLineColorCmd(const QColor &color);
76
77 SeqLineWidget *sequentialLine() const;
78
79 virtual void resizeWidget(qreal newW, qreal newH);
80
81 virtual void saveToXMI1(QDomDocument& qDoc, QDomElement& qElement);
82 virtual bool loadFromXMI1(QDomElement& qElement);
83
84 public slots:
85 void slotMenuSelection(QAction* action);
86 virtual void slotFillColorChanged(Uml::ID::Type viewID);
87 void slotMessageMoved();
88
89 protected:
90 virtual void mousePressEvent(QGraphicsSceneMouseEvent *me);
91 virtual void mouseMoveEvent(QGraphicsSceneMouseEvent *me);
92
93 QSizeF minimumSize() const;
94
95 virtual void moveEvent(QGraphicsSceneMouseEvent *event);
96 virtual void moveWidgetBy(qreal diffX, qreal diffY);
97 virtual void constrainMovementForAllWidgets(qreal &diffX, qreal &diffY);
98
99 virtual QCursor resizeCursor() const;
100
101 void paintActor(QPainter *p);
102 void paintObject(QPainter *p);
103
104 private:
105 void tabUp();
106 void tabDown();
107
108 void moveDestructionBy(qreal diffY);
109
110 SeqLineWidget* m_pLine;
111 bool m_multipleInstance;
112 bool m_drawAsActor;
113 bool m_showDestruction;
114 bool m_isOnDestructionBox;
115 MessageWidgetList m_messages;
116
117 friend class SeqLineWidget;
118 };
119
120 #endif
A_WIDTH
#define A_WIDTH
Definition: objectwidget.cpp:38
ObjectWidget::messageRemoved
void messageRemoved(MessageWidget *message)
Definition: objectwidget.cpp:577
UMLWidget::height
qreal height() const
Definition: umlwidget.h:114
messagewidgetlist.h
UMLWidget::resize
void resize()
Definition: umlwidget.cpp:1480
ObjectWidget::setMultipleInstance
void setMultipleInstance(bool multiple)
Definition: objectwidget.cpp:84
x
int x
Definition: cxx11-lambda-functions-and-expressions.h:4
WidgetBase::textColor
QColor textColor() const
Definition: widgetbase.cpp:335
ObjectWidget::m_multipleInstance
bool m_multipleInstance
draw an object as a multiple object
Definition: objectwidget.h:111
ObjectWidget::slotMessageMoved
void slotMessageMoved()
Definition: objectwidget.cpp:590
ListPopupMenu::mt_Properties
@ mt_Properties
Definition: listpopupmenu.h:182
seqlinewidget.h
docwindow.h
umlview.h
UMLWidget
The base class for graphical UML objects.
Definition: umlwidget.h:40
WidgetBase::name
QString name() const
Definition: widgetbase.cpp:309
ObjectWidget::topMargin
int topMargin()
Definition: objectwidget.cpp:494
ObjectWidget::tabUp
void tabUp()
Definition: objectwidget.cpp:469
UMLWidget::setPenFromSettings
void setPenFromSettings(QPainter &p)
Definition: umlwidget.cpp:1392
SeqLineWidget::setupDestructionBox
void setupDestructionBox()
Definition: seqlinewidget.cpp:138
ObjectWidget::messageAdded
void messageAdded(MessageWidget *message)
Definition: objectwidget.cpp:563
sequenceLineMargin
static const int sequenceLineMargin
Definition: objectwidget.cpp:48
ObjectWidget::ObjectWidget
ObjectWidget(UMLScene *scene, UMLObject *o)
Definition: objectwidget.cpp:56
DEBUG_REGISTER_DISABLED
#define DEBUG_REGISTER_DISABLED(src)
Definition: debug_utils.h:132
ObjectWidget::resizeCursor
virtual QCursor resizeCursor() const
Definition: objectwidget.cpp:655
ObjectWidget::resizeWidget
virtual void resizeWidget(qreal newW, qreal newH)
Definition: objectwidget.cpp:668
ObjectWidget::tabDown
void tabDown()
Definition: objectwidget.cpp:481
UMLScene::backgroundColor
const QColor & backgroundColor() const
Definition: umlscene.cpp:1355
UMLWidget::setLineColor
virtual void setLineColor(const QColor &color)
Definition: umlwidget.cpp:1137
ObjectWidget::showDestruction
bool showDestruction() const
Definition: objectwidget.cpp:526
UMLWidget::cleanup
virtual void cleanup()
Definition: umlwidget.cpp:1706
DocWindow::updateDocumentation
void updateDocumentation(bool clear=false, bool startup=false)
Definition: docwindow.cpp:273
UMLScene::isCollaborationDiagram
bool isCollaborationDiagram()
Definition: umlscene.h:319
Uml::ID::Type
std::string Type
Definition: basictypes.h:368
ObjectWidget::setDrawAsActor
void setDrawAsActor(bool drawAsActor)
Definition: objectwidget.cpp:229
ObjectWidget::setSelected
void setSelected(bool state)
Definition: objectwidget.cpp:104
UMLWidget::m_oldPos
QPointF m_oldPos
The X/Y position the widget had when the movement started.
Definition: umlwidget.h:329
UMLScene::fillColor
const QColor & fillColor() const
Definition: umlscene.cpp:474
ObjectWidget::moveEvent
virtual void moveEvent(QGraphicsSceneMouseEvent *event)
Definition: objectwidget.cpp:295
ClassPropertiesDialog
Definition: classpropertiesdialog.h:34
UMLObject
The base class for UML objects.
Definition: umlobject.h:73
UMLWidget::FT_UNDERLINE
@ FT_UNDERLINE
Definition: umlwidget.h:220
ObjectWidget::setShowDestruction
void setShowDestruction(bool bShow)
Definition: objectwidget.cpp:514
SeqLineWidget::cleanup
void cleanup()
Definition: seqlinewidget.cpp:103
SeqLineWidget::getLineLength
int getLineLength()
Definition: seqlinewidget.h:47
ObjectWidget::slotMenuSelection
void slotMenuSelection(QAction *action)
Definition: objectwidget.cpp:172
A_MARGIN
#define A_MARGIN
Definition: objectwidget.cpp:40
UMLWidget::getFontMetrics
QFontMetrics & getFontMetrics(UMLWidget::FontType fontType) const
Definition: umlwidget.cpp:1936
WidgetBase::font
virtual QFont font() const
Definition: widgetbase.cpp:543
ObjectWidget::slotFillColorChanged
virtual void slotFillColorChanged(Uml::ID::Type viewID)
Definition: objectwidget.cpp:359
ObjectWidget::getEndLineY
int getEndLineY()
Definition: objectwidget.cpp:548
ObjectWidget::m_showDestruction
bool m_showDestruction
show object destruction on sequence diagram line
Definition: objectwidget.h:113
IDChangeLog
Definition: idchangelog.h:26
WidgetBase::fillColor
QColor fillColor() const
Definition: widgetbase.cpp:377
UMLWidget::sigWidgetMoved
void sigWidgetMoved(Uml::ID::Type id)
UMLWidget::setX
virtual void setX(qreal x)
Definition: umlwidget.cpp:1685
ObjectWidget::setLineColorCmd
virtual void setLineColorCmd(const QColor &color)
Definition: objectwidget.cpp:630
MessageWidgetList
QList< QPointer< MessageWidget > > MessageWidgetList
Definition: messagewidgetlist.h:18
UMLWidget::setSelected
virtual void setSelected(bool _select)
Definition: umlwidget.cpp:1573
UMLApp::docWindow
DocWindow * docWindow() const
Definition: uml.cpp:1886
WidgetBase::m_nLocalID
Uml::ID::Type m_nLocalID
Definition: widgetbase.h:332
objectwidget.h
ObjectWidget::setX
virtual void setX(qreal x)
Definition: objectwidget.cpp:264
ObjectWidget::minimumSize
QSizeF minimumSize() const
Definition: objectwidget.cpp:200
umlwidget.h
UMLScene::type
Uml::DiagramType::Enum type() const
Definition: umlscene.cpp:426
SeqLineWidget
Widget class for graphical representation of sequence lines.
Definition: seqlinewidget.h:26
ListPopupMenu::MenuType
MenuType
< This type hosts all possible menu entry types
Definition: listpopupmenu.h:43
ListPopupMenu::mt_Down
@ mt_Down
Definition: listpopupmenu.h:218
ObjectWidget::saveToXMI1
virtual void saveToXMI1(QDomDocument &qDoc, QDomElement &qElement)
Definition: objectwidget.cpp:677
messagewidget.h
ObjectWidget::centerX
qreal centerX()
Definition: objectwidget.cpp:287
UMLScene::lineColor
const QColor & lineColor() const
Definition: umlscene.cpp:493
UMLWidget::setFillColor
virtual void setFillColor(const QColor &color)
Definition: umlwidget.cpp:1168
A_HEIGHT
#define A_HEIGHT
Definition: objectwidget.cpp:39
ObjectWidget::showPropertiesDialog
virtual bool showPropertiesDialog()
Definition: objectwidget.cpp:384
int
int int y int
Definition: cxx11-lambda-functions-and-expressions.h:4
WidgetBase::m_scene
UMLScene * m_scene
Definition: widgetbase.h:316
ObjectWidget::mouseMoveEvent
virtual void mouseMoveEvent(QGraphicsSceneMouseEvent *me)
Definition: objectwidget.cpp:322
ObjectWidget::paintActor
void paintActor(QPainter *p)
Definition: objectwidget.cpp:436
UMLApp::app
static UMLApp * app()
Definition: uml.cpp:269
ObjectWidget::~ObjectWidget
virtual ~ObjectWidget()
Definition: objectwidget.cpp:74
WidgetBase::useFillColor
bool useFillColor()
Definition: widgetbase.cpp:419
O_WIDTH
#define O_WIDTH
Definition: objectwidget.cpp:37
UMLWidget::setLineColorCmd
virtual void setLineColorCmd(const QColor &color)
Definition: umlwidget.cpp:1128
UMLDoc::setModified
void setModified(bool modified=true)
Definition: umldoc.cpp:3125
ObjectWidget::moveWidgetBy
virtual void moveWidgetBy(qreal diffX, qreal diffY)
Definition: objectwidget.cpp:127
WidgetBase
Common base class for UMLWidget and AssociationWidget.
Definition: widgetbase.h:104
UMLWidget::mousePressEvent
virtual void mousePressEvent(QGraphicsSceneMouseEvent *event)
Definition: umlwidget.cpp:364
ObjectWidget::m_drawAsActor
bool m_drawAsActor
object should be drawn as an Actor or an Object
Definition: objectwidget.h:112
ObjectWidget::constrainMovementForAllWidgets
virtual void constrainMovementForAllWidgets(qreal &diffX, qreal &diffY)
Definition: objectwidget.cpp:143
Uml::DiagramType::Sequence
@ Sequence
Definition: basictypes.h:100
ObjectWidget::activate
bool activate(IDChangeLog *ChangeLog=0)
Definition: objectwidget.cpp:248
UMLWidget::setY
virtual void setY(qreal y)
Definition: umlwidget.cpp:1697
UMLWidget::adjustAssocs
virtual void adjustAssocs(qreal dx, qreal dy)
Definition: umlwidget.cpp:1310
UMLWidget::m_instanceName
QString m_instanceName
instance name (used if on a deployment diagram)
Definition: umlwidget.h:295
ObjectWidget::messageOverlap
bool messageOverlap(qreal y, MessageWidget *messageWidget)
Definition: objectwidget.cpp:611
DocWindow::showDocumentation
void showDocumentation(UMLObject *object, bool overwrite=false)
Definition: docwindow.cpp:130
ObjectWidget::m_pLine
SeqLineWidget * m_pLine
Definition: objectwidget.h:110
ObjectWidget::moveDestructionBy
void moveDestructionBy(qreal diffY)
Definition: objectwidget.cpp:347
DEBUG
#define DEBUG(src)
Definition: debug_utils.h:129
WidgetBase::lineColor
QColor lineColor() const
Definition: widgetbase.cpp:356
UMLWidget::m_inResizeArea
bool m_inResizeArea
Definition: umlwidget.h:341
ObjectWidget
Displays an instance of a Concept.
Definition: objectwidget.h:32
uError
#define uError()
Definition: debug_utils.h:123
umlscene.h
uml.h
ListPopupMenu::mt_Up
@ mt_Up
Definition: listpopupmenu.h:217
UMLWidget::setSize
void setSize(qreal width, qreal height)
Definition: umlwidget.cpp:1745
ObjectWidget::loadFromXMI1
virtual bool loadFromXMI1(QDomElement &qElement)
Definition: objectwidget.cpp:690
debug_utils.h
UMLScene
Definition: umlscene.h:68
ListPopupMenu::typeFromAction
static MenuType typeFromAction(QAction *action)
Definition: listpopupmenu.cpp:407
DBG_SRC
#define DBG_SRC
Definition: import_utils.cpp:43
ObjectWidget::drawAsActor
bool drawAsActor() const
Definition: objectwidget.cpp:240
WidgetBase::lineWidth
uint lineWidth() const
Definition: widgetbase.cpp:398
UMLWidget::updateGeometry
void updateGeometry(bool withAssocs=true)
Definition: umlwidget.cpp:1781
umlobject.h
classpropertiesdialog.h
UMLWidget::saveToXMI1
virtual void saveToXMI1(QDomDocument &qDoc, QDomElement &qElement)
Definition: umlwidget.cpp:2045
SeqLineWidget::setStartPoint
void setStartPoint(int startX, int startY)
Definition: seqlinewidget.cpp:114
listpopupmenu.h
ObjectWidget::setY
virtual void setY(qreal y)
Definition: objectwidget.cpp:276
ObjectWidget::multipleInstance
bool multipleInstance() const
Definition: objectwidget.cpp:99
ObjectWidget::mousePressEvent
virtual void mousePressEvent(QGraphicsSceneMouseEvent *me)
Definition: objectwidget.cpp:307
ObjectWidget::setEndLine
void setEndLine(int yPosition)
Definition: objectwidget.cpp:536
O_MARGIN
#define O_MARGIN
Definition: objectwidget.cpp:36
UMLScene::isSequenceDiagram
bool isSequenceDiagram()
Definition: umlscene.h:318
dialog_utils.h
UMLWidget::mouseMoveEvent
virtual void mouseMoveEvent(QGraphicsSceneMouseEvent *event)
Definition: umlwidget.cpp:454
ObjectWidget::paint
virtual void paint(QPainter *painter, const QStyleOptionGraphicsItem *option, QWidget *widget=0)
Definition: objectwidget.cpp:154
ObjectWidget::canTabUp
bool canTabUp()
Definition: objectwidget.cpp:504
ObjectWidget::cleanup
void cleanup()
Definition: objectwidget.cpp:371
SeqLineWidget::onDestructionBox
bool onDestructionBox(const QPointF &p)
Definition: seqlinewidget.cpp:82
UMLWidget::width
qreal width() const
Definition: umlwidget.h:121
SeqLineWidget::setLineColorCmd
void setLineColorCmd(const QColor &color)
Definition: seqlinewidget.cpp:203
MessageWidget
Displays a message.
Definition: messagewidget.h:40
SeqLineWidget::setEndOfLine
void setEndOfLine(int yPosition)
Definition: seqlinewidget.cpp:187
UMLWidget::loadFromXMI1
virtual bool loadFromXMI1(QDomElement &qElement)
Definition: umlwidget.cpp:2067
UMLWidget::slotMenuSelection
virtual void slotMenuSelection(QAction *action)
Definition: umlwidget.cpp:768
UMLApp::document
UMLDoc * document() const
Definition: uml.cpp:1055
umldoc.h
ObjectWidget::sequentialLine
SeqLineWidget * sequentialLine() const
Definition: objectwidget.cpp:643
UMLWidget::activate
virtual bool activate(IDChangeLog *changeLog=0)
Definition: umlwidget.cpp:1192
ObjectWidget::paintObject
void paintObject(QPainter *p)
Definition: objectwidget.cpp:402
UMLWidget::paint
virtual void paint(QPainter *painter, const QStyleOptionGraphicsItem *option, QWidget *widget=0)
Definition: umlwidget.cpp:1869
ObjectWidget::m_messages
MessageWidgetList m_messages
message widgets with an end on this widget
Definition: objectwidget.h:115
ObjectWidget::m_isOnDestructionBox
bool m_isOnDestructionBox
true when a click occurred on the destruction box
Definition: objectwidget.h:114