umbrello: umbrello/umlscene.h Source File

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

- Main Page
- Related Pages
- Modules
- Namespaces
- Classes
- Files

- File List
- File Members

umlscene.h
Go to the documentation of this file.
1/*
2 SPDX-License-Identifier: GPL-2.0-or-later
3 SPDX-FileCopyrightText: 2002-2022 Umbrello UML Modeller Authors <umbrello-devel@kde.org>
4*/
5
6#ifndef UMLSCENE_H
7#define UMLSCENE_H
8
9// local includes
10#include "associationwidgetlist.h"
11#include "basictypes.h"
12#include "classifierwidget.h"
13#include "messagewidgetlist.h"
14#include "optionstate.h"
15#include "umlobject.h"
16#include "umlobjectlist.h"
17#include "umlwidgetlist.h"
18#include "worktoolbar.h"
19#include "widgetbase.h"
20
21// Qt includes
22#include <QDomDocument>
23#include <QGraphicsScene>
24#include <QGraphicsItem>
25#include <QGraphicsSceneMouseEvent>
26#include <QGraphicsPolygonItem>
27#include <QKeyEvent>
28#include <QMouseEvent>
29#include <QPixmap>
30#include <QXmlStreamWriter>
31
32// forward declarations
33class ClassOptionsPage;
34class IDChangeLog;
35class LayoutGrid;
36class FloatingTextWidget;
37class ObjectWidget;
38class ToolBarState;
39class ToolBarStateFactory;
40class UMLFolder;
41class UMLDoc;
42class UMLAttribute;
43class UMLCanvasObject;
44class UMLClassifier;
45class UMLViewImageExporter;
46class UMLForeignKeyConstraint;
47class UMLEntity;
48class UMLView;
49
50class QHideEvent;
51class QMouseEvent;
52class QPrinter;
53class QShowEvent;
54class UMLScenePrivate;
55
56// migration wrapper for QGraphicsScene items
57 typedef QList<QGraphicsItem*> UMLSceneItemList;
58
64 class UMLScene : public QGraphicsScene
65{
66 Q_OBJECT
67public:
68 friend class UMLViewImageExporterModel;
69
70 explicit UMLScene(UMLFolder *parentFolder, UMLView *view = 0);
71 virtual ~UMLScene();
72
73 UMLView* activeView() const;
74
75 // Accessors and other methods dealing with loaded/saved data
76
77 UMLFolder* folder() const;
78 void setFolder(UMLFolder *folder);
79
80 QString documentation() const;
81 void setDocumentation(const QString &doc);
82
83 bool autoIncrementSequence() const;
84 void setAutoIncrementSequence(bool state);
85 QString autoIncrementSequenceValue();
86
87 QString name() const;
88 void setName(const QString &name);
89
90 Uml::DiagramType::Enum type() const;
91 void setType(Uml::DiagramType::Enum type);
92
93 Uml::ID::Type ID() const;
94 void setID(Uml::ID::Type id);
95
96 QPointF pos() const;
97 void setPos(const QPointF &pos);
98
99 const QColor& fillColor() const;
100 void setFillColor(const QColor &color);
101
102 const QColor& lineColor() const;
103 void setLineColor(const QColor &color);
104
105 uint lineWidth() const;
106 void setLineWidth(uint width);
107
108 const QColor& textColor() const;
109 void setTextColor(const QColor& color);
110
111 const QColor& gridDotColor() const;
112 void setGridDotColor(const QColor& color);
113
114 const QColor& backgroundColor() const;
115
116 bool snapToGrid() const;
117 void setSnapToGrid(bool bSnap);
118
119 bool snapComponentSizeToGrid() const;
120 void setSnapComponentSizeToGrid(bool bSnap);
121
122 int snapX() const;
123 int snapY() const;
124 void setSnapSpacing(int x, int y);
125
126 qreal snappedX(qreal x);
127 qreal snappedY(qreal y);
128
129 bool isSnapGridVisible() const;
130 void setSnapGridVisible(bool bShow);
131
132 bool isShowDocumentationIndicator() const;
133 void setShowDocumentationIndicator(bool bShow);
134
135 bool useFillColor() const;
136 void setUseFillColor(bool ufc);
137
138 QFont font() const;
139 void setFont(QFont font, bool changeAllWidgets = false);
140
141 bool showOpSig() const;
142 void setShowOpSig(bool bShowOpSig);
143
144 Settings::OptionState& optionState();
145 void setOptionState(const Settings::OptionState& options);
146
147 AssociationWidgetList associationList() const;
148 MessageWidgetList messageList() const;
149 UMLWidgetList widgetList() const;
150 void addWidgetCmd(UMLWidget* widget);
151 void addWidgetCmd(AssociationWidget *widget);
152
153 bool isOpen() const;
154 void setIsOpen(bool isOpen);
155
156 // End of accessors and methods that only deal with loaded/saved data
158
159 void print(QPrinter *pPrinter, QPainter & pPainter);
160
161 void hideEvent(QHideEvent *he);
162 void showEvent(QShowEvent *se);
163
164 void checkMessages(ObjectWidget * w);
165
166 UMLWidget* findWidget(Uml::ID::Type id);
167
168 AssociationWidget* findAssocWidget(Uml::ID::Type id);
169 AssociationWidget* findAssocWidget(Uml::AssociationType::Enum at,
170 UMLWidget *pWidgetA, UMLWidget *pWidgetB);
171 AssociationWidget* findAssocWidget(UMLWidget *pWidgetA,
172 UMLWidget *pWidgetB, const QString& roleNameB);
173
174 void removeWidget(UMLWidget *o);
175 void removeWidget(AssociationWidget *w);
176 void removeWidgetCmd(UMLWidget *o);
177private:
178 void removeOwnedWidgets(UMLWidget* o);
179public:
180
181 UMLWidgetList selectedWidgets() const;
182 AssociationWidgetList selectedAssociationWidgets() const;
183 UMLWidgetList selectedMessageWidgets() const;
184 void clearSelected();
185
186 void moveSelectedBy(qreal dX, qreal dY);
187
188 int selectedCount(bool filterText = false) const;
189
190 void selectionUseFillColor(bool useFC);
191 void selectionSetFont(const QFont &font);
192 void selectionSetLineColor(const QColor &color);
193 void selectionSetLineWidth(uint width);
194 void selectionSetFillColor(const QColor &color);
195 void selectionSetVisualProperty(ClassifierWidget::VisualProperty property, bool value);
196
197private:
198 void unselectChildrenOfSelectedWidgets();
199public:
200 void deleteSelection();
201 void resizeSelection();
202
203 void selectAll();
204
205 UMLWidget* widgetOnDiagram(Uml::ID::Type id);
206 UMLWidget *widgetOnDiagram(WidgetBase::WidgetType type);
207
208 bool isSavedInSeparateFile();
209
210 void setMenu(const QPoint& pos);
211
212 void resetToolbar();
213 void triggerToolbarButton(WorkToolBar::ToolBar_Buttons button);
214
215 bool getPaste() const;
216 void setPaste(bool paste);
217
218 void activate();
219
220 AssociationWidgetList selectedAssocs();
221 UMLWidgetList selectedWidgetsExt(bool filterText = true);
222
223 void activateAfterLoad(bool bUseLog = false);
224
225 void endPartialWidgetPaste();
226 void beginPartialWidgetPaste();
227
228 void removeWidgetCmd(AssociationWidget* pAssoc);
229 void removeAssociations(UMLWidget* pWidget);
230 void selectAssociations(bool bSelect);
231
232 void getWidgetAssocs(UMLObject* Obj, AssociationWidgetList & Associations);
233
234 void removeAllAssociations();
235
236 void removeAllWidgets();
237
238 void getDiagram(QPixmap & diagram, const QRectF &rect);
239 void getDiagram(QPainter &painter, const QRectF &source, const QRectF &target = QRectF());
240
241 void copyAsImage(QPixmap*& pix);
242
243 UMLViewImageExporter* getImageExporter();
244
245 bool addAssociation(AssociationWidget* pAssoc, bool isPasteOperation = false);
246
247 void removeAssocInViewAndDoc(AssociationWidget* assoc);
248
249 void addFloatingTextWidget(FloatingTextWidget* pWidget);
250
251 QPointF getPastePoint();
252 void resetPastePoint();
253
254 void setStartedCut();
255
256 void createAutoAssociations(UMLWidget * widget);
257 void createAutoAttributeAssociations(UMLWidget *widget);
258 void createAutoConstraintAssociations(UMLWidget* widget);
259 void createAutoAttributeAssociations2(UMLWidget *widget);
260
261 void updateContainment(UMLCanvasObject *self);
262
263 void setClassWidgetOptions(ClassOptionsPage * page);
264
265 WidgetBase::WidgetType getUniqueSelectionType();
266
267 void clearDiagram();
268
269 void applyLayout(const QString &actionText);
270
271 void toggleSnapToGrid();
272 void toggleSnapComponentSizeToGrid();
273 void toggleShowGrid();
274
275 void fileLoaded();
276
277 // Load/Save interface:
278
279 virtual void saveToXMI(QXmlStreamWriter& writer);
280 virtual bool loadFromXMI(QDomElement & qElement);
281
282 bool loadUISDiagram(QDomElement & qElement);
283 UMLWidget* loadWidgetFromXMI(QDomElement& widgetElement);
284
285 void addObject(UMLObject *object);
286
287 void selectWidgets(qreal px, qreal py, qreal qx, qreal qy);
288 void selectWidgets(UMLWidgetList &widgets);
289 void selectWidget(UMLWidget* widget, QRectF* rect = 0);
290 void selectWidgetsOfAssoc(AssociationWidget *a);
291
292 ObjectWidget * onWidgetLine(const QPointF &point) const;
293 ObjectWidget * onWidgetDestructionBox(const QPointF &point) const;
294
295 UMLWidget* getFirstMultiSelectedWidget() const;
296
297 UMLWidget* widgetAt(const QPointF& p);
298 AssociationWidget* associationAt(const QPointF& p);
299 MessageWidget* messageAt(const QPointF& p);
300
301 void setupNewWidget(UMLWidget *w, bool setPosition=true);
302
303 bool getCreateObject() const;
304 void setCreateObject(bool bCreate);
305
306 int generateCollaborationId();
307
308 UMLSceneItemList collisions(const QPointF &p, int delta = 3);
309
310 bool isClassDiagram() const { return type() == Uml::DiagramType::Class; }
311 bool isUseCaseDiagram() const { return type() == Uml::DiagramType::UseCase; }
312 bool isSequenceDiagram() const { return type() == Uml::DiagramType::Sequence; }
313 bool isCollaborationDiagram() const { return type() == Uml::DiagramType::Collaboration; }
314 bool isStateDiagram() const { return type() == Uml::DiagramType::State; }
315 bool isActivityDiagram() const { return type() == Uml::DiagramType::Activity; }
316 bool isComponentDiagram() const { return type() == Uml::DiagramType::Component; }
317 bool isDeploymentDiagram() const { return type() == Uml::DiagramType::Deployment; }
318 bool isEntityRelationshipDiagram() const { return type() == Uml::DiagramType::EntityRelationship; }
319 bool isObjectDiagram() const { return type() == Uml::DiagramType::Object; }
320
321 void setWidgetLink(WidgetBase *w);
322 WidgetBase *widgetLink();
323
324 static qreal maxCanvasSize();
325
326 void updateCanvasSizeEstimate(qreal x, qreal y, qreal w, qreal h);
327
328 qreal fixX() const;
329 qreal fixY() const;
330
331protected:
332 // Methods and members related to loading/saving
333
334 bool loadWidgetsFromXMI(QDomElement & qElement);
335 bool loadMessagesFromXMI(QDomElement & qElement);
336 bool loadAssociationsFromXMI(QDomElement & qElement);
337 bool loadUisDiagramPresentation(QDomElement & qElement);
338
343 Uml::ID::Type m_nLocalID;
344
345 Uml::ID::Type m_nID;
346 Uml::DiagramType::Enum m_Type;
347 QString m_Name;
348 QString m_Documentation;
349 Settings::OptionState m_Options;
350
351 bool m_bUseSnapToGrid;
352 bool m_bUseSnapComponentSizeToGrid;
353 bool m_isOpen;
354
355 // End of methods and members related to loading/saving
357
358 void dragEnterEvent(QGraphicsSceneDragDropEvent* enterEvent);
359 void dragMoveEvent(QGraphicsSceneDragDropEvent* moveEvent);
360 void dropEvent(QGraphicsSceneDragDropEvent* dropEvent);
361
362 void mouseMoveEvent(QGraphicsSceneMouseEvent* mouseEvent);
363 void mousePressEvent(QGraphicsSceneMouseEvent* mouseEvent);
364 void mouseDoubleClickEvent(QGraphicsSceneMouseEvent* mouseEvent);
365 void mouseReleaseEvent(QGraphicsSceneMouseEvent* mouseEvent);
366 virtual void contextMenuEvent(QGraphicsSceneContextMenuEvent* event);
367
368 QRectF diagramRect();
369
370 void makeSelected(UMLWidget* uw);
371
372 void updateComponentSizes();
373
374 void findMaxBoundingRectangle(const FloatingTextWidget* ft,
375 qreal& px, qreal& py, qreal& qx, qreal& qy);
376 void forceUpdateWidgetFontMetrics(QPainter *painter);
377
378 virtual void drawBackground(QPainter *painter, const QRectF &rect);
379
380#if !(QT_DEPRECATED_SINCE(5, 0))
381 inline QGraphicsItem *itemAt(const QPointF &position) const {
382 QList<QGraphicsItem *> itemsAtPoint = items(position);
383 return itemsAtPoint.isEmpty() ? 0 : itemsAtPoint.first();
384 }
385#endif
386
387 int m_nCollaborationId;
388 QPointF m_pos;
389 bool m_bCreateObject;
390 bool m_bDrawSelectedOnly;
391 bool m_bPaste;
392 bool m_bStartedCut;
393
394private:
395 UMLScenePrivate *m_d;
396 static const qreal s_defaultCanvasWidth;
397 static const qreal s_defaultCanvasHeight;
398 static const qreal s_maxCanvasSize;
399 static bool s_showDocumentationIndicator;
400
401 UMLView *m_view;
402 UMLFolder *m_pFolder;
403
404 IDChangeLog * m_pIDChangesLog;
405 bool m_isActivated;
406 bool m_bPopupShowing;
407 QPointF m_PastePoint;
408 UMLDoc* m_doc;
409 UMLViewImageExporter* m_pImageExporter;
410 LayoutGrid* m_layoutGrid;
411 bool m_autoIncrementSequence;
412 qreal m_minX, m_minY;
413 qreal m_maxX, m_maxY;
414 qreal m_fixX;
415 qreal m_fixY;
416
417 void createAutoAttributeAssociation(UMLClassifier *type,
418 UMLAttribute *attr,
419 UMLWidget *widget);
420 void createAutoConstraintAssociation(UMLEntity* refEntity,
421 UMLForeignKeyConstraint* fkConstraint,
422 UMLWidget* widget);
423
424public slots:
425 void slotToolBarChanged(int c);
426 void slotObjectCreated(UMLObject * o);
427 void slotObjectRemoved(UMLObject * o);
428 void slotMenuSelection(QAction* action);
429 void slotActivate();
430 void slotCutSuccessful();
431 void slotShowView();
432
433 void alignLeft();
434 void alignRight();
435 void alignTop();
436 void alignBottom();
437 void alignVerticalMiddle();
438 void alignHorizontalMiddle();
439 void alignVerticalDistribute();
440 void alignHorizontalDistribute();
441
442signals:
443 void sigResetToolBar();
444
445 void sigFillColorChanged(Uml::ID::Type);
446 void sigGridColorChanged(Uml::ID::Type);
447 void sigLineColorChanged(Uml::ID::Type);
448 void sigTextColorChanged(Uml::ID::Type);
449 void sigLineWidthChanged(Uml::ID::Type);
450 void sigSnapToGridToggled(bool);
451 void sigSnapComponentSizeToGridToggled(bool);
452 void sigShowGridToggled(bool);
453 void sigAssociationRemoved(AssociationWidget*);
454 void sigWidgetRemoved(UMLWidget*);
455
456 friend class DiagramProxyWidget;
457};
458
459QDebug operator<<(QDebug dbg, UMLScene *item);
460
461#endif // UMLSCENE_H
associationwidgetlist.h
AssociationWidgetList
QList< QPointer< AssociationWidget > > AssociationWidgetList
Definition: associationwidgetlist.h:17
basictypes.h
AssociationWidget
This class represents an association inside a diagram. Bugs and comments to umbrello-devel@kde....
Definition: associationwidget.h:47
ClassOptionsPage
A dialog page to display the class related options.
Definition: classoptionspage.h:35
ClassifierWidget::VisualProperty
VisualProperty
Definition: classifierwidget.h:37
DiagramProxyWidget
Definition: diagramproxywidget.h:25
FloatingTextWidget
Displays a line of text or an operation.
Definition: floatingtextwidget.h:32
IDChangeLog
Definition: idchangelog.h:22
LayoutGrid
Definition: layoutgrid.h:23
MessageWidget
Displays a message.
Definition: messagewidget.h:36
ObjectWidget
Displays an instance of a Concept.
Definition: objectwidget.h:28
Settings::OptionState
Definition: optionstate.h:308
ToolBarStateFactory
Definition: toolbarstatefactory.h:29
ToolBarState
Definition: toolbarstate.h:65
UMLAttribute
Sets up attribute information.
Definition: attribute.h:23
UMLCanvasObject
Non-graphical information for a UMLCanvasObject.
Definition: umlcanvasobject.h:32
UMLClassifier
Information for a non-graphical Concept/Class.
Definition: classifier.h:35
UMLDoc
Definition: umldoc.h:63
UMLEntity
Non-graphical Information for an Entity.
Definition: entity.h:30
UMLFolder
Non-graphical management of objects and diagrams of a Folder.
Definition: folder.h:30
UMLForeignKeyConstraint
Sets up Foreign Key entity constraint information.
Definition: foreignkeyconstraint.h:28
UMLObject
The base class for UML objects.
Definition: umlobject.h:70
UMLScenePrivate
Definition: umlscene.cpp:112
UMLScene
Definition: umlscene.h:65
UMLScene::removeWidget
void removeWidget(UMLWidget *o)
Definition: umlscene.cpp:1311
UMLScene::isComponentDiagram
bool isComponentDiagram() const
Definition: umlscene.h:316
UMLScene::alignHorizontalMiddle
void alignHorizontalMiddle()
Definition: umlscene.cpp:4485
UMLScene::createAutoAttributeAssociations
void createAutoAttributeAssociations(UMLWidget *widget)
Definition: umlscene.cpp:2644
UMLScene::loadFromXMI
virtual bool loadFromXMI(QDomElement &qElement)
Definition: umlscene.cpp:3874
UMLScene::onWidgetDestructionBox
ObjectWidget * onWidgetDestructionBox(const QPointF &point) const
Definition: umlscene.cpp:1061
UMLScene::setIsOpen
void setIsOpen(bool isOpen)
Definition: umlscene.cpp:679
UMLScene::toggleSnapComponentSizeToGrid
void toggleSnapComponentSizeToGrid()
Definition: umlscene.cpp:3561
UMLScene::endPartialWidgetPaste
void endPartialWidgetPaste()
Definition: umlscene.cpp:2258
UMLScene::snapComponentSizeToGrid
bool snapComponentSizeToGrid() const
Definition: umlscene.cpp:3595
UMLScene::setPos
void setPos(const QPointF &pos)
Definition: umlscene.cpp:482
UMLScene::setSnapGridVisible
void setSnapGridVisible(bool bShow)
Definition: umlscene.cpp:3681
UMLScene::setupNewWidget
void setupNewWidget(UMLWidget *w, bool setPosition=true)
Definition: umlscene.cpp:733
UMLScene::s_defaultCanvasWidth
static const qreal s_defaultCanvasWidth
The default width of a diagram in pixels.
Definition: umlscene.h:396
UMLScene::m_maxY
qreal m_maxY
Gather data for estimating required canvas size (used during loadFromXMI)
Definition: umlscene.h:413
UMLScene::s_showDocumentationIndicator
static bool s_showDocumentationIndicator
Status of documentation indicator.
Definition: umlscene.h:399
UMLScene::isClassDiagram
bool isClassDiagram() const
Definition: umlscene.h:310
UMLScene::font
QFont font() const
Definition: umlscene.cpp:3462
UMLScene::setOptionState
void setOptionState(const Settings::OptionState &options)
Definition: umlscene.cpp:595
UMLScene::alignRight
void alignRight()
Definition: umlscene.cpp:4405
UMLScene::m_d
UMLScenePrivate * m_d
Definition: umlscene.h:395
UMLScene::setMenu
void setMenu(const QPoint &pos)
UMLScene::loadUISDiagram
bool loadUISDiagram(QDomElement &qElement)
Definition: umlscene.cpp:4348
UMLScene::snapY
int snapY() const
Definition: umlscene.cpp:3621
UMLScene::triggerToolbarButton
void triggerToolbarButton(WorkToolBar::ToolBar_Buttons button)
Definition: umlscene.cpp:2988
UMLScene::snapToGrid
bool snapToGrid() const
Definition: umlscene.cpp:3578
UMLScene::isObjectDiagram
bool isObjectDiagram() const
Definition: umlscene.h:319
UMLScene::checkMessages
void checkMessages(ObjectWidget *w)
Definition: umlscene.cpp:1141
UMLScene::copyAsImage
void copyAsImage(QPixmap *&pix)
Definition: umlscene.cpp:2909
UMLScene::selectWidgets
void selectWidgets(qreal px, qreal py, qreal qx, qreal qy)
Definition: umlscene.cpp:1804
UMLScene::mouseReleaseEvent
void mouseReleaseEvent(QGraphicsSceneMouseEvent *mouseEvent)
Definition: umlscene.cpp:1024
UMLScene::setShowDocumentationIndicator
void setShowDocumentationIndicator(bool bShow)
Definition: umlscene.cpp:3698
UMLScene::messageAt
MessageWidget * messageAt(const QPointF &p)
Definition: umlscene.cpp:1127
UMLScene::m_nID
Uml::ID::Type m_nID
The ID of the view. Allocated by UMLDoc.
Definition: umlscene.h:345
UMLScene::snappedX
qreal snappedX(qreal x)
Definition: umlscene.cpp:3637
UMLScene::setFolder
void setFolder(UMLFolder *folder)
Definition: umlscene.cpp:356
UMLScene::getImageExporter
UMLViewImageExporter * getImageExporter()
Definition: umlscene.cpp:1972
UMLScene::widgetOnDiagram
UMLWidget * widgetOnDiagram(Uml::ID::Type id)
Definition: umlscene.cpp:1161
UMLScene::contextMenuEvent
virtual void contextMenuEvent(QGraphicsSceneContextMenuEvent *event)
Definition: umlscene.cpp:2996
UMLScene::m_bDrawSelectedOnly
bool m_bDrawSelectedOnly
Definition: umlscene.h:390
UMLScene::createAutoConstraintAssociations
void createAutoConstraintAssociations(UMLWidget *widget)
Definition: umlscene.cpp:2774
UMLScene::m_pFolder
UMLFolder * m_pFolder
The folder in which this UMLView is contained.
Definition: umlscene.h:402
UMLScene::selectedAssociationWidgets
AssociationWidgetList selectedAssociationWidgets() const
Definition: umlscene.cpp:1445
UMLScene::setLineColor
void setLineColor(const QColor &color)
Definition: umlscene.cpp:519
UMLScene::setStartedCut
void setStartedCut()
Definition: umlscene.cpp:3454
UMLScene::autoIncrementSequence
bool autoIncrementSequence() const
Definition: umlscene.cpp:388
UMLScene::sigTextColorChanged
void sigTextColorChanged(Uml::ID::Type)
UMLScene::dragMoveEvent
void dragMoveEvent(QGraphicsSceneDragDropEvent *moveEvent)
Definition: umlscene.cpp:916
UMLScene::hideEvent
void hideEvent(QHideEvent *he)
Definition: umlscene.cpp:791
UMLScene::maxCanvasSize
static qreal maxCanvasSize()
Definition: umlscene.cpp:341
UMLScene::sigLineWidthChanged
void sigLineWidthChanged(Uml::ID::Type)
UMLScene::removeAllAssociations
void removeAllAssociations()
Definition: umlscene.cpp:2370
UMLScene::getPaste
bool getPaste() const
Definition: umlscene.cpp:3013
UMLScene::sigSnapComponentSizeToGridToggled
void sigSnapComponentSizeToGridToggled(bool)
UMLScene::snappedY
qreal snappedY(qreal y)
Definition: umlscene.cpp:3655
UMLScene::folder
UMLFolder * folder() const
Definition: umlscene.cpp:348
UMLScene::forceUpdateWidgetFontMetrics
void forceUpdateWidgetFontMetrics(QPainter *painter)
Definition: umlscene.cpp:3749
UMLScene::selectionSetLineWidth
void selectionSetLineWidth(uint width)
Definition: umlscene.cpp:1566
UMLScene::getWidgetAssocs
void getWidgetAssocs(UMLObject *Obj, AssociationWidgetList &Associations)
Definition: umlscene.cpp:2354
UMLScene::selectWidgetsOfAssoc
void selectWidgetsOfAssoc(AssociationWidget *a)
Definition: umlscene.cpp:1784
UMLScene::m_view
UMLView * m_view
The view to which this scene is related.
Definition: umlscene.h:401
UMLScene::dropEvent
void dropEvent(QGraphicsSceneDragDropEvent *dropEvent)
Definition: umlscene.cpp:924
UMLScene::fillColor
const QColor & fillColor() const
Definition: umlscene.cpp:490
UMLScene::loadUisDiagramPresentation
bool loadUisDiagramPresentation(QDomElement &qElement)
Definition: umlscene.cpp:4247
UMLScene::removeAllWidgets
void removeAllWidgets()
Definition: umlscene.cpp:2381
UMLScene::selectAssociations
void selectAssociations(bool bSelect)
Definition: umlscene.cpp:2336
UMLScene::selectionSetFillColor
void selectionSetFillColor(const QColor &color)
Definition: umlscene.cpp:1586
UMLScene::toggleSnapToGrid
void toggleSnapToGrid()
Definition: umlscene.cpp:3552
UMLScene::findWidget
UMLWidget * findWidget(Uml::ID::Type id)
Definition: umlscene.cpp:1206
UMLScene::isEntityRelationshipDiagram
bool isEntityRelationshipDiagram() const
Definition: umlscene.h:318
UMLScene::setTextColor
void setTextColor(const QColor &color)
Definition: umlscene.cpp:557
UMLScene::type
Uml::DiagramType::Enum type() const
Definition: umlscene.cpp:442
UMLScene::setShowOpSig
void setShowOpSig(bool bShowOpSig)
Definition: umlscene.cpp:3714
UMLScene::resetToolbar
void resetToolbar()
Definition: umlscene.cpp:2983
UMLScene::isShowDocumentationIndicator
bool isShowDocumentationIndicator() const
Definition: umlscene.cpp:3690
UMLScene::s_maxCanvasSize
static const qreal s_maxCanvasSize
The maximum supported canvas size.
Definition: umlscene.h:398
UMLScene::selectedWidgets
UMLWidgetList selectedWidgets() const
Definition: umlscene.cpp:1428
UMLScene::createAutoAssociations
void createAutoAssociations(UMLWidget *widget)
Definition: umlscene.cpp:2455
UMLScene::m_Type
Uml::DiagramType::Enum m_Type
The type of diagram to represent.
Definition: umlscene.h:346
UMLScene::slotCutSuccessful
void slotCutSuccessful()
Definition: umlscene.cpp:3412
UMLScene::s_defaultCanvasHeight
static const qreal s_defaultCanvasHeight
The default height of a diagram in pixels.
Definition: umlscene.h:397
UMLScene::activateAfterLoad
void activateAfterLoad(bool bUseLog=false)
Definition: umlscene.cpp:2230
UMLScene::findAssocWidget
AssociationWidget * findAssocWidget(Uml::ID::Type id)
Definition: umlscene.cpp:1235
UMLScene::m_bPaste
bool m_bPaste
Definition: umlscene.h:391
UMLScene::setFont
void setFont(QFont font, bool changeAllWidgets=false)
Definition: umlscene.cpp:3470
UMLScene::activate
void activate()
Definition: umlscene.cpp:1988
UMLScene::addWidgetCmd
void addWidgetCmd(UMLWidget *widget)
Definition: umlscene.cpp:630
UMLScene::fixY
qreal fixY() const
Definition: umlscene.cpp:4631
UMLScene::unselectChildrenOfSelectedWidgets
void unselectChildrenOfSelectedWidgets()
Definition: umlscene.cpp:1616
UMLScene::getDiagram
void getDiagram(QPixmap &diagram, const QRectF &rect)
Definition: umlscene.cpp:1910
UMLScene::beginPartialWidgetPaste
void beginPartialWidgetPaste()
Definition: umlscene.cpp:2249
UMLScene::m_pIDChangesLog
IDChangeLog * m_pIDChangesLog
LocalID Changes Log for paste actions.
Definition: umlscene.h:404
UMLScene::alignLeft
void alignLeft()
Definition: umlscene.cpp:4387
UMLScene::setAutoIncrementSequence
void setAutoIncrementSequence(bool state)
Definition: umlscene.cpp:393
UMLScene::setType
void setType(Uml::DiagramType::Enum type)
Definition: umlscene.cpp:450
UMLScene::removeAssocInViewAndDoc
void removeAssocInViewAndDoc(AssociationWidget *assoc)
Definition: umlscene.cpp:2289
UMLScene::m_isOpen
bool m_isOpen
Flag is set to true when diagram is open, i.e. shown to the user.
Definition: umlscene.h:353
UMLScene::alignBottom
void alignBottom()
Definition: umlscene.cpp:4440
UMLScene::sigAssociationRemoved
void sigAssociationRemoved(AssociationWidget *)
UMLScene::createAutoConstraintAssociation
void createAutoConstraintAssociation(UMLEntity *refEntity, UMLForeignKeyConstraint *fkConstraint, UMLWidget *widget)
Definition: umlscene.cpp:2823
UMLScene::sigSnapToGridToggled
void sigSnapToGridToggled(bool)
UMLScene::setWidgetLink
void setWidgetLink(WidgetBase *w)
Definition: umlscene.cpp:4584
UMLScene::widgetList
UMLWidgetList widgetList() const
Definition: umlscene.cpp:619
UMLScene::drawBackground
virtual void drawBackground(QPainter *painter, const QRectF &rect)
Definition: umlscene.cpp:3760
UMLScene::m_minY
qreal m_minY
Gather data for estimating required canvas size (used during loadFromXMI)
Definition: umlscene.h:412
UMLScene::diagramRect
QRectF diagramRect()
Definition: umlscene.cpp:1418
UMLScene::selectWidget
void selectWidget(UMLWidget *widget, QRectF *rect=0)
Definition: umlscene.cpp:1855
UMLScene::addAssociation
bool addAssociation(AssociationWidget *pAssoc, bool isPasteOperation=false)
Definition: umlscene.cpp:2139
UMLScene::isSequenceDiagram
bool isSequenceDiagram() const
Definition: umlscene.h:312
UMLScene::resizeSelection
void resizeSelection()
Definition: umlscene.cpp:1695
UMLScene::selectAll
void selectAll()
Definition: umlscene.cpp:1718
UMLScene::m_fixY
qreal m_fixY
Compensate for QGraphicsScene offsets, https://bugs.kde.org/show_bug.cgi?id=449622.
Definition: umlscene.h:415
UMLScene::setDocumentation
void setDocumentation(const QString &doc)
Definition: umlscene.cpp:380
UMLScene::textColor
const QColor & textColor() const
Definition: umlscene.cpp:547
UMLScene::backgroundColor
const QColor & backgroundColor() const
Definition: umlscene.cpp:1392
UMLScene::snapX
int snapX() const
Definition: umlscene.cpp:3613
UMLScene::updateContainment
void updateContainment(UMLCanvasObject *self)
Definition: umlscene.cpp:2403
UMLScene::findMaxBoundingRectangle
void findMaxBoundingRectangle(const FloatingTextWidget *ft, qreal &px, qreal &py, qreal &qx, qreal &qy)
Definition: umlscene.cpp:2886
UMLScene::sigLineColorChanged
void sigLineColorChanged(Uml::ID::Type)
UMLScene::sigResetToolBar
void sigResetToolBar()
UMLScene::sigShowGridToggled
void sigShowGridToggled(bool)
UMLScene::setFillColor
void setFillColor(const QColor &color)
Definition: umlscene.cpp:500
UMLScene::selectedWidgetsExt
UMLWidgetList selectedWidgetsExt(bool filterText=true)
Definition: umlscene.cpp:2066
UMLScene::loadMessagesFromXMI
bool loadMessagesFromXMI(QDomElement &qElement)
Definition: umlscene.cpp:4172
UMLScene::onWidgetLine
ObjectWidget * onWidgetLine(const QPointF &point) const
Definition: umlscene.cpp:1036
UMLScene::selectedAssocs
AssociationWidgetList selectedAssocs()
Definition: umlscene.cpp:2085
UMLScene::clearDiagram
void clearDiagram()
Definition: umlscene.cpp:3529
UMLScene::setSnapToGrid
void setSnapToGrid(bool bSnap)
Definition: umlscene.cpp:3586
UMLScene::setGridDotColor
void setGridDotColor(const QColor &color)
Definition: umlscene.cpp:578
UMLScene::collisions
UMLSceneItemList collisions(const QPointF &p, int delta=3)
Definition: umlscene.cpp:1761
UMLScene::name
QString name() const
Definition: umlscene.cpp:426
UMLScene::moveSelectedBy
void moveSelectedBy(qreal dX, qreal dY)
Definition: umlscene.cpp:1503
UMLScene::lineColor
const QColor & lineColor() const
Definition: umlscene.cpp:509
UMLScene::lineWidth
uint lineWidth() const
Definition: umlscene.cpp:528
UMLScene::m_minX
qreal m_minX
Definition: umlscene.h:412
UMLScene::isSnapGridVisible
bool isSnapGridVisible() const
Definition: umlscene.cpp:3673
UMLScene::slotShowView
void slotShowView()
Definition: umlscene.cpp:3423
UMLScene::resetPastePoint
void resetPastePoint()
Definition: umlscene.cpp:3445
UMLScene::mouseMoveEvent
void mouseMoveEvent(QGraphicsSceneMouseEvent *mouseEvent)
Definition: umlscene.cpp:975
UMLScene::deleteSelection
void deleteSelection()
Definition: umlscene.cpp:1633
UMLScene::itemAt
QGraphicsItem * itemAt(const QPointF &position) const
Definition: umlscene.h:381
UMLScene::fixX
qreal fixX() const
Definition: umlscene.cpp:4623
UMLScene::setClassWidgetOptions
void setClassWidgetOptions(ClassOptionsPage *page)
Definition: umlscene.cpp:3484
UMLScene::m_bPopupShowing
bool m_bPopupShowing
Status of a popupmenu on view. True - a popup is on view.
Definition: umlscene.h:406
UMLScene::documentation
QString documentation() const
Definition: umlscene.cpp:372
UMLScene::sigGridColorChanged
void sigGridColorChanged(Uml::ID::Type)
UMLScene::sigWidgetRemoved
void sigWidgetRemoved(UMLWidget *)
UMLScene::isDeploymentDiagram
bool isDeploymentDiagram() const
Definition: umlscene.h:317
UMLScene::m_Options
Settings::OptionState m_Options
Options used by view.
Definition: umlscene.h:349
UMLScene::setLineWidth
void setLineWidth(uint width)
Definition: umlscene.cpp:538
UMLScene::m_nLocalID
Uml::ID::Type m_nLocalID
Definition: umlscene.h:343
UMLScene::m_fixX
qreal m_fixX
Compensate for QGraphicsScene offsets, https://bugs.kde.org/show_bug.cgi?id=449622.
Definition: umlscene.h:414
UMLScene::slotObjectCreated
void slotObjectCreated(UMLObject *o)
Definition: umlscene.cpp:813
UMLScene::isStateDiagram
bool isStateDiagram() const
Definition: umlscene.h:314
UMLScene::mousePressEvent
void mousePressEvent(QGraphicsSceneMouseEvent *mouseEvent)
Definition: umlscene.cpp:988
UMLScene::isOpen
bool isOpen() const
Definition: umlscene.cpp:670
UMLScene::m_PastePoint
QPointF m_PastePoint
The offset at which to paste the clipboard.
Definition: umlscene.h:407
UMLScene::setSnapSpacing
void setSnapSpacing(int x, int y)
Definition: umlscene.cpp:3629
UMLScene::alignVerticalMiddle
void alignVerticalMiddle()
Definition: umlscene.cpp:4457
UMLScene::dragEnterEvent
void dragEnterEvent(QGraphicsSceneDragDropEvent *enterEvent)
Definition: umlscene.cpp:870
UMLScene::print
void print(QPrinter *pPrinter, QPainter &pPainter)
Definition: umlscene.cpp:687
UMLScene::showEvent
void showEvent(QShowEvent *se)
Definition: umlscene.cpp:778
UMLScene::loadWidgetsFromXMI
bool loadWidgetsFromXMI(QDomElement &qElement)
Definition: umlscene.cpp:4125
UMLScene::m_bStartedCut
bool m_bStartedCut
Flag if view/children started cut operation.
Definition: umlscene.h:392
UMLScene::pos
QPointF pos() const
Definition: umlscene.cpp:474
UMLScene::autoIncrementSequenceValue
QString autoIncrementSequenceValue()
Definition: umlscene.cpp:401
UMLScene::setCreateObject
void setCreateObject(bool bCreate)
Definition: umlscene.cpp:770
UMLScene::mouseDoubleClickEvent
void mouseDoubleClickEvent(QGraphicsSceneMouseEvent *mouseEvent)
Definition: umlscene.cpp:1007
UMLScene::slotToolBarChanged
void slotToolBarChanged(int c)
Definition: umlscene.cpp:804
UMLScene::alignTop
void alignTop()
Definition: umlscene.cpp:4422
UMLScene::isSavedInSeparateFile
bool isSavedInSeparateFile()
Definition: umlscene.cpp:1727
UMLScene::m_doc
UMLDoc * m_doc
Pointer to the UMLDoc.
Definition: umlscene.h:408
UMLScene::m_pImageExporter
UMLViewImageExporter * m_pImageExporter
Used to export the view.
Definition: umlscene.h:409
UMLScene::applyLayout
void applyLayout(const QString &actionText)
Definition: umlscene.cpp:3539
UMLScene::m_bUseSnapToGrid
bool m_bUseSnapToGrid
Flag to use snap to grid. The default is off.
Definition: umlscene.h:351
UMLScene::selectionSetFont
void selectionSetFont(const QFont &font)
Definition: umlscene.cpp:1534
UMLScene::getUniqueSelectionType
WidgetBase::WidgetType getUniqueSelectionType()
Definition: umlscene.cpp:3505
UMLScene::m_Documentation
QString m_Documentation
The documentation of the diagram.
Definition: umlscene.h:348
UMLScene::m_pos
QPointF m_pos
Definition: umlscene.h:388
UMLScene::widgetLink
WidgetBase * widgetLink()
Definition: umlscene.cpp:4589
UMLScene::updateCanvasSizeEstimate
void updateCanvasSizeEstimate(qreal x, qreal y, qreal w, qreal h)
Definition: umlscene.cpp:4608
UMLScene::createAutoAttributeAssociation
void createAutoAttributeAssociation(UMLClassifier *type, UMLAttribute *attr, UMLWidget *widget)
Definition: umlscene.cpp:2712
UMLScene::associationList
AssociationWidgetList associationList() const
Definition: umlscene.cpp:605
UMLScene::m_Name
QString m_Name
The name of the diagram.
Definition: umlscene.h:347
UMLScene::getFirstMultiSelectedWidget
UMLWidget * getFirstMultiSelectedWidget() const
Definition: umlscene.cpp:1082
UMLScene::slotActivate
void slotActivate()
Definition: umlscene.cpp:1980
UMLScene::toggleShowGrid
void toggleShowGrid()
Definition: umlscene.cpp:3570
UMLScene::getCreateObject
bool getCreateObject() const
Definition: umlscene.cpp:762
UMLScene::showOpSig
bool showOpSig() const
Definition: umlscene.cpp:3706
UMLScene::slotObjectRemoved
void slotObjectRemoved(UMLObject *o)
Definition: umlscene.cpp:854
UMLScene::m_autoIncrementSequence
bool m_autoIncrementSequence
state of auto increment sequence
Definition: umlscene.h:411
UMLScene::generateCollaborationId
int generateCollaborationId()
Definition: umlscene.cpp:661
UMLScene::~UMLScene
virtual ~UMLScene()
Definition: umlscene.cpp:310
UMLScene::setPaste
void setPaste(bool paste)
Definition: umlscene.cpp:3021
UMLScene::messageList
MessageWidgetList messageList() const
Definition: umlscene.cpp:647
UMLScene::isUseCaseDiagram
bool isUseCaseDiagram() const
Definition: umlscene.h:311
UMLScene::createAutoAttributeAssociations2
void createAutoAttributeAssociations2(UMLWidget *widget)
Definition: umlscene.cpp:2855
UMLScene::getPastePoint
QPointF getPastePoint()
Definition: umlscene.cpp:3434
UMLScene::sigFillColorChanged
void sigFillColorChanged(Uml::ID::Type)
UMLScene::fileLoaded
void fileLoaded()
Definition: umlscene.cpp:3723
UMLScene::addObject
void addObject(UMLObject *object)
Definition: umlscene.cpp:4238
UMLScene::useFillColor
bool useFillColor() const
Definition: umlscene.cpp:1400
UMLScene::clearSelected
void clearSelected()
Definition: umlscene.cpp:1483
UMLScene::m_bUseSnapComponentSizeToGrid
bool m_bUseSnapComponentSizeToGrid
Flag to use snap to grid for component size. The default is off.
Definition: umlscene.h:352
UMLScene::alignHorizontalDistribute
void alignHorizontalDistribute()
Definition: umlscene.cpp:4544
UMLScene::isCollaborationDiagram
bool isCollaborationDiagram() const
Definition: umlscene.h:313
UMLScene::slotMenuSelection
void slotMenuSelection(QAction *action)
Definition: umlscene.cpp:3030
UMLScene::associationAt
AssociationWidget * associationAt(const QPointF &p)
Definition: umlscene.cpp:1112
UMLScene::makeSelected
void makeSelected(UMLWidget *uw)
Definition: umlscene.cpp:1774
UMLScene::selectedCount
int selectedCount(bool filterText=false) const
Definition: umlscene.cpp:2041
UMLScene::removeAssociations
void removeAssociations(UMLWidget *pWidget)
Definition: umlscene.cpp:2322
UMLScene::selectionSetVisualProperty
void selectionSetVisualProperty(ClassifierWidget::VisualProperty property, bool value)
Definition: umlscene.cpp:1601
UMLScene::m_nCollaborationId
int m_nCollaborationId
Used for creating unique name of collaboration messages.
Definition: umlscene.h:387
UMLScene::saveToXMI
virtual void saveToXMI(QXmlStreamWriter &writer)
Definition: umlscene.cpp:3800
UMLScene::selectedMessageWidgets
UMLWidgetList selectedMessageWidgets() const
Definition: umlscene.cpp:1462
UMLScene::selectionUseFillColor
void selectionUseFillColor(bool useFC)
Definition: umlscene.cpp:1516
UMLScene::setUseFillColor
void setUseFillColor(bool ufc)
Definition: umlscene.cpp:1408
UMLScene::optionState
Settings::OptionState & optionState()
Definition: umlscene.cpp:587
UMLScene::m_isActivated
bool m_isActivated
True if the view was activated after the deserialization(load).
Definition: umlscene.h:405
UMLScene::activeView
UMLView * activeView() const
Definition: umlscene.cpp:364
UMLScene::loadAssociationsFromXMI
bool loadAssociationsFromXMI(QDomElement &qElement)
Definition: umlscene.cpp:4200
UMLScene::addFloatingTextWidget
void addFloatingTextWidget(FloatingTextWidget *pWidget)
Definition: umlscene.cpp:2099
UMLScene::setName
void setName(const QString &name)
Definition: umlscene.cpp:434
UMLScene::widgetAt
UMLWidget * widgetAt(const QPointF &p)
Definition: umlscene.cpp:1096
UMLScene::removeWidgetCmd
void removeWidgetCmd(UMLWidget *o)
Definition: umlscene.cpp:1331
UMLScene::m_bCreateObject
bool m_bCreateObject
Definition: umlscene.h:389
UMLScene::isActivityDiagram
bool isActivityDiagram() const
Definition: umlscene.h:315
UMLScene::m_layoutGrid
LayoutGrid * m_layoutGrid
layout grid in the background
Definition: umlscene.h:410
UMLScene::alignVerticalDistribute
void alignVerticalDistribute()
Definition: umlscene.cpp:4513
UMLScene::removeOwnedWidgets
void removeOwnedWidgets(UMLWidget *o)
Definition: umlscene.cpp:1377
UMLScene::setID
void setID(Uml::ID::Type id)
Definition: umlscene.cpp:466
UMLScene::gridDotColor
const QColor & gridDotColor() const
Definition: umlscene.cpp:568
UMLScene::selectionSetLineColor
void selectionSetLineColor(const QColor &color)
Definition: umlscene.cpp:1548
UMLScene::updateComponentSizes
void updateComponentSizes()
Definition: umlscene.cpp:3731
UMLScene::m_maxX
qreal m_maxX
Definition: umlscene.h:413
UMLScene::setSnapComponentSizeToGrid
void setSnapComponentSizeToGrid(bool bSnap)
Definition: umlscene.cpp:3603
UMLScene::ID
Uml::ID::Type ID() const
Definition: umlscene.cpp:458
UMLScene::loadWidgetFromXMI
UMLWidget * loadWidgetFromXMI(QDomElement &widgetElement)
Definition: umlscene.cpp:4151
UMLViewImageExporterModel
Definition: umlviewimageexportermodel.h:29
UMLViewImageExporter
Definition: umlviewimageexporter.h:23
UMLView
Definition: umlview.h:30
UMLWidget
The base class for graphical UML objects.
Definition: umlwidget.h:36
WidgetBase
Common base class for UMLWidget and AssociationWidget.
Definition: widgetbase.h:101
WidgetBase::WidgetType
WidgetType
Definition: widgetbase.h:107
WorkToolBar::ToolBar_Buttons
ToolBar_Buttons
Definition: worktoolbar.h:52
classifierwidget.h
x
int x
Definition: cxx11-lambda-functions-and-expressions.h:4
messagewidgetlist.h
MessageWidgetList
QList< QPointer< MessageWidget > > MessageWidgetList
Definition: messagewidgetlist.h:15
Uml::AssociationType::Enum
Enum
Definition: basictypes.h:92
Uml::DiagramType::Enum
Enum
Definition: basictypes.h:63
Uml::DiagramType::Component
@ Component
Definition: basictypes.h:73
Uml::DiagramType::Collaboration
@ Collaboration
Definition: basictypes.h:70
Uml::DiagramType::Activity
@ Activity
Definition: basictypes.h:72
Uml::DiagramType::State
@ State
Definition: basictypes.h:71
Uml::DiagramType::Object
@ Object
Definition: basictypes.h:76
Uml::DiagramType::UseCase
@ UseCase
Definition: basictypes.h:68
Uml::DiagramType::Sequence
@ Sequence
Definition: basictypes.h:69
Uml::DiagramType::Class
@ Class
Definition: basictypes.h:67
Uml::DiagramType::EntityRelationship
@ EntityRelationship
Definition: basictypes.h:75
Uml::DiagramType::Deployment
@ Deployment
Definition: basictypes.h:74
Uml::ID::Type
std::string Type
Definition: basictypes.h:371
optionstate.h
a
QString a
Definition: petalnode.cpp:13
umlobject.h
umlobjectlist.h
UMLSceneItemList
QList< QGraphicsItem * > UMLSceneItemList
Definition: umlscene.h:57
operator<<
QDebug operator<<(QDebug dbg, UMLScene *item)
Definition: umlscene.cpp:4575
umlwidgetlist.h
UMLWidgetList
QList< QPointer< UMLWidget > > UMLWidgetList
Definition: umlwidgetlist.h:15
widgetbase.h
worktoolbar.h