objectwidget.h
00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012 #ifndef OBJECTWIDGET_H
00013 #define OBJECTWIDGET_H
00014
00015 #define O_MARGIN 5
00016 #define O_WIDTH 40
00017 #define A_WIDTH 20
00018 #define A_HEIGHT 40
00019 #define A_MARGIN 5
00020
00021 #include "messagewidgetlist.h"
00022 #include "messagewidget.h"
00023
00024
00025 class SeqLineWidget;
00026
00035 class ObjectWidget : public UMLWidget {
00036 Q_OBJECT
00037 public:
00045 ObjectWidget(UMLView * view, UMLObject *o, Uml::IDType lid = Uml::id_None );
00046
00050 virtual ~ObjectWidget();
00051
00058 virtual void setX( int x );
00059
00066 virtual void setY( int y );
00067
00075 Uml::IDType getLocalID() const {
00076 return m_nLocalID;
00077 }
00078
00084 QString getInstanceName() const {
00085 return m_InstanceName;
00086 }
00087
00093 void setInstanceName(const QString &name) {
00094 m_InstanceName = name;
00095 }
00096
00102 bool getMultipleInstance() const {
00103 return m_bMultipleInstance;
00104 }
00105
00111 void setMultipleInstance(bool multiple);
00112
00118 void setLocalID(Uml::IDType id) {
00119 m_nLocalID = id;
00120 }
00121
00125 bool activate(IDChangeLog* ChangeLog = 0);
00126
00130 void draw(QPainter & p, int offsetX, int offsetY);
00131
00135 virtual void moveEvent(QMoveEvent *);
00136
00140 void cleanup();
00141
00145 void showProperties();
00146
00152 bool getDrawAsActor() const {
00153 return m_bDrawAsActor;
00154 }
00155
00161 void setDrawAsActor( bool drawAsActor );
00162
00168 void setShowDestruction( bool bShow );
00169
00175 bool getShowDestruction() const {
00176 return m_bShowDestruction;
00177 }
00178
00185 int topMargin();
00186
00192 int getEndLineY();
00193
00199 void messageAdded(MessageWidget* message);
00200
00206 void messageRemoved(MessageWidget* message);
00207
00213 bool canTabUp();
00214
00223 bool messageOverlap(int y, MessageWidget* messageWidget);
00224
00230 SeqLineWidget *getSeqLine();
00231
00235 void saveToXMI( QDomDocument & qDoc, QDomElement & qElement );
00236
00240 bool loadFromXMI( QDomElement & qElement );
00241
00242 public slots:
00246 void slotMenuSelection(int sel);
00247
00251 virtual void slotColorChanged(Uml::IDType viewID);
00252
00258 void slotMessageMoved();
00259
00260 protected:
00261 SeqLineWidget * m_pLine;
00262
00266 QSize calculateSize();
00267
00271 void drawActor(QPainter & p, int offsetX, int offsetY);
00272
00276 void drawObject(QPainter & p, int offsetX, int offsetY);
00277
00281 void tabUp();
00282
00286 void tabDown();
00287
00288
00289
00293 QString m_InstanceName;
00294
00299 Uml::IDType m_nLocalID;
00300
00305 bool m_bMultipleInstance;
00306
00311 bool m_bDrawAsActor;
00312
00317 bool m_bShowDestruction;
00318
00319 private:
00323 void init();
00324
00328 MessageWidgetList messageWidgetList;
00329 };
00330
00331 #endif
This file is part of the documentation for umbrello Version 3.1.0.