classifierwidget.h
00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012 #ifndef CLASSIFIERWIDGET_H
00013 #define CLASSIFIERWIDGET_H
00014
00015 #include "umlwidget.h"
00016
00017 class QPainter;
00018 class UMLClassifier;
00019 class AssociationWidget;
00020
00027 class ClassifierWidget : public UMLWidget {
00028 public:
00029
00036 ClassifierWidget(UMLView * view, UMLClassifier * o);
00037
00041 virtual ~ClassifierWidget();
00042
00046 void toggleShowStereotype();
00047
00053 bool getShowOps() const;
00054
00060 void setShowOps(bool _show);
00061
00065 void toggleShowOps();
00066
00070 bool getShowPublicOnly() const;
00071
00075 void setShowPublicOnly(bool _status);
00076
00080 void toggleShowPublicOnly();
00081
00087 bool getShowVisibility() const;
00088
00094 void setShowVisibility(bool _visibility);
00095
00099 void toggleShowVisibility();
00100
00106 Uml::Signature_Type getShowOpSigs() const;
00107
00113 void setShowOpSigs(bool _show);
00114
00118 void toggleShowOpSigs();
00119
00125 bool getShowPackage() const;
00126
00132 void setShowPackage(bool _status);
00133
00137 void toggleShowPackage();
00138
00144 void setOpSignature(Uml::Signature_Type sig);
00145
00149 int displayedAttributes();
00150
00154 int displayedOperations();
00155
00162 bool getShowAtts() const {
00163 return m_bShowAttributes;
00164 }
00165
00170 void toggleShowAtts();
00171
00178 Uml::Signature_Type getShowAttSigs() {
00179 return m_ShowAttSigs;
00180 }
00181
00186 void toggleShowAttSigs();
00187
00194 void setShowAtts(bool _show);
00195
00202 void setShowAttSigs(bool _show);
00203
00210 void setAttSignature(Uml::Signature_Type sig);
00211
00218 bool getDrawAsCircle() const;
00219
00224 void toggleDrawAsCircle();
00225
00232 void setDrawAsCircle(bool drawAsCircle);
00233
00239 void changeToClass();
00240
00246 void changeToInterface();
00247
00252 void setClassAssocWidget(AssociationWidget *assocwidget);
00253
00258 AssociationWidget *getClassAssocWidget();
00259
00264 UMLClassifier *getClassifier();
00265
00270 void draw(QPainter & p, int offsetX, int offsetY);
00271
00282 virtual void adjustAssocs(int x, int y);
00283
00287 void saveToXMI(QDomDocument & qDoc, QDomElement & qElement);
00288
00292 bool loadFromXMI(QDomElement & qElement);
00293
00294 public slots:
00301 void slotMenuSelection(int sel);
00302
00303 protected:
00304
00308 void init();
00309
00316 QSize calculateTemplatesBoxSize();
00317
00321 QSize calculateSize();
00322
00327 void drawAsCircle(QPainter& p, int offsetX, int offsetY);
00328
00333 QSize calculateAsCircleSize();
00334
00338 void updateSigs();
00339
00344 int displayedMembers(Uml::Object_Type ot);
00345
00357 void drawMembers(QPainter & p, Uml::Object_Type ot, Uml::Signature_Type sigType,
00358 int x, int y, int fontHeight);
00359
00360 bool m_bShowOperations;
00361 bool m_bShowPublicOnly;
00362 bool m_bShowAccess;
00363 bool m_bShowPackage;
00364 bool m_bShowAttributes;
00365 bool m_bDrawAsCircle;
00366 Uml::Signature_Type m_ShowAttSigs;
00367 Uml::Signature_Type m_ShowOpSigs;
00368
00372 static const int MARGIN;
00373
00377 static const int CIRCLE_SIZE;
00378
00380 int m_bodyOffsetY;
00381
00386 AssociationWidget *m_pAssocWidget;
00387
00388 };
00389
00390 #endif
This file is part of the documentation for umbrello Version 3.1.0.