umbrello  2.31.90
Umbrello UML Modeller is a Unified Modelling Language (UML) diagram program based on KDE Technology
artifactwidget.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) 2003-2020 *
8  * Umbrello UML Modeller Authors <umbrello-devel@kde.org> *
9  ***************************************************************************/
10 
11 #ifndef ARTIFACTWIDGET_H
12 #define ARTIFACTWIDGET_H
13 
14 #include "umlwidget.h"
15 
16 class UMLScene;
17 class UMLArtifact;
18 
19 #define ARTIFACT_MARGIN 5
20 
30 class ArtifactWidget : public UMLWidget
31 {
32 public:
34  virtual ~ArtifactWidget();
35 
36  virtual void paint(QPainter *painter, const QStyleOptionGraphicsItem *option, QWidget *widget = 0);
37 
38  // Note: For loading from XMI, the inherited parent method is used.
39  virtual void saveToXMI1(QXmlStreamWriter& writer);
40 
41 protected:
42  QSizeF minimumSize() const;
43 
44 private:
45  void paintAsFile(QPainter *painter, const QStyleOptionGraphicsItem *option);
46  void paintAsLibrary(QPainter *painter, const QStyleOptionGraphicsItem *option);
47  void paintAsTable(QPainter *painter, const QStyleOptionGraphicsItem *option);
48  void paintAsNormal(QPainter *painter, const QStyleOptionGraphicsItem *option);
49 
50  QSize calculateIconSize() const;
51  QSize calculateNormalSize() const;
52 
53 };
54 
55 #endif
A graphical version of an Artifact.
Definition: artifactwidget.h:31
QSize calculateNormalSize() const
Definition: artifactwidget.cpp:133
QSize calculateIconSize() const
Definition: artifactwidget.cpp:116
void paintAsFile(QPainter *painter, const QStyleOptionGraphicsItem *option)
Definition: artifactwidget.cpp:155
void paintAsTable(QPainter *painter, const QStyleOptionGraphicsItem *option)
Definition: artifactwidget.cpp:224
QSizeF minimumSize() const
Definition: artifactwidget.cpp:100
void paintAsNormal(QPainter *painter, const QStyleOptionGraphicsItem *option)
Definition: artifactwidget.cpp:261
virtual ~ArtifactWidget()
Definition: artifactwidget.cpp:40
ArtifactWidget(UMLScene *scene, UMLArtifact *a)
Definition: artifactwidget.cpp:31
virtual void saveToXMI1(QXmlStreamWriter &writer)
Definition: artifactwidget.cpp:90
void paintAsLibrary(QPainter *painter, const QStyleOptionGraphicsItem *option)
Definition: artifactwidget.cpp:189
virtual void paint(QPainter *painter, const QStyleOptionGraphicsItem *option, QWidget *widget=0)
Definition: artifactwidget.cpp:48
Non-graphical information for a Artifact.
Definition: artifact.h:28
Definition: umlscene.h:70
The base class for graphical UML objects.
Definition: umlwidget.h:41
QString a
Definition: petalnode.cpp:18