[Uml-devel] KDE/kdesdk/umbrello/umbrello

Oliver Kellogg okellogg at users.sourceforge.net
Mon Oct 10 11:06:18 UTC 2005


SVN commit 469322 by okellogg:

apply commit 469320 from branches/KDE/3.5

 M  +0 -1      Makefile.am  
 M  +3 -3      classifierwidget.cpp  
 M  +2 -2      classifierwidget.h  
 M  +2 -2      componentwidget.cpp  
 M  +2 -2      componentwidget.h  
 M  +2 -2      packagewidget.cpp  
 M  +2 -2      packagewidget.h  
 D             stereotypedwidget.cpp  
 D             stereotypedwidget.h  
 M  +14 -0     umlwidget.cpp  
 M  +19 -0     umlwidget.h  


--- trunk/KDE/kdesdk/umbrello/umbrello/Makefile.am #469321:469322
@@ -75,7 +75,6 @@
 seqlinewidget.cpp \
 statewidget.cpp \
 stereotype.cpp \
-stereotypedwidget.cpp \
 template.cpp \
 textblock.cpp \
 toolbarstate.cpp \
--- trunk/KDE/kdesdk/umbrello/umbrello/classifierwidget.cpp #469321:469322
@@ -28,7 +28,7 @@
 #include "listpopupmenu.h"
 
 ClassifierWidget::ClassifierWidget(UMLView * view, UMLClassifier *c)
-  : StereotypedWidget(view, c) {
+  : UMLWidget(view, c) {
     init();
     if (c != NULL && c->isInterface()) {
         WidgetBase::setBaseType(Uml::wt_Interface);
@@ -738,7 +738,7 @@
         conceptElement = qDoc.createElement("interfacewidget");
     else
         conceptElement = qDoc.createElement("classwidget");
-    StereotypedWidget::saveToXMI( qDoc, conceptElement );
+    UMLWidget::saveToXMI( qDoc, conceptElement );
     conceptElement.setAttribute( "showoperations", m_bShowOperations );
     conceptElement.setAttribute( "showpubliconly", m_bShowPublicOnly );
     conceptElement.setAttribute( "showopsigs", m_ShowOpSigs );
@@ -754,7 +754,7 @@
 }
 
 bool ClassifierWidget::loadFromXMI(QDomElement & qElement) {
-    if (!StereotypedWidget::loadFromXMI(qElement))
+    if (!UMLWidget::loadFromXMI(qElement))
         return false;
     QString showatts = qElement.attribute( "showattributes", "0" );
     QString showops = qElement.attribute( "showoperations", "1" );
--- trunk/KDE/kdesdk/umbrello/umbrello/classifierwidget.h #469321:469322
@@ -15,7 +15,7 @@
 #ifndef CLASSIFIERWIDGET_H
 #define CLASSIFIERWIDGET_H
 
-#include "stereotypedwidget.h"
+#include "umlwidget.h"
 
 class QPainter;
 class UMLClassifier;
@@ -27,7 +27,7 @@
  * @see UMLWidget
  * Bugs and comments to uml-devel at lists.sf.net or http://bugs.kde.org
  */
-class ClassifierWidget : public StereotypedWidget {
+class ClassifierWidget : public UMLWidget {
 public:
 
     /**
--- trunk/KDE/kdesdk/umbrello/umbrello/componentwidget.cpp #469321:469322
@@ -19,7 +19,7 @@
 #include <qpainter.h>
 
 ComponentWidget::ComponentWidget(UMLView * view, UMLComponent *c)
-  : StereotypedWidget(view, c) {
+  : UMLWidget(view, c) {
     init();
     setSize(100, 30);
     calculateSize();
@@ -136,7 +136,7 @@
 
 void ComponentWidget::saveToXMI(QDomDocument& qDoc, QDomElement& qElement) {
     QDomElement conceptElement = qDoc.createElement("componentwidget");
-    StereotypedWidget::saveToXMI(qDoc, conceptElement);
+    UMLWidget::saveToXMI(qDoc, conceptElement);
     qElement.appendChild(conceptElement);
 }
 
--- trunk/KDE/kdesdk/umbrello/umbrello/componentwidget.h #469321:469322
@@ -15,7 +15,7 @@
 #ifndef COMPONENTWIDGET_H
 #define COMPONENTWIDGET_H
 
-#include "stereotypedwidget.h"
+#include "umlwidget.h"
 
 class UMLComponent;
 
@@ -30,7 +30,7 @@
  * @see UMLWidget
  * Bugs and comments to uml-devel at lists.sf.net or http://bugs.kde.org
  */
-class ComponentWidget : public StereotypedWidget {
+class ComponentWidget : public UMLWidget {
 public:
 
     /**
--- trunk/KDE/kdesdk/umbrello/umbrello/packagewidget.cpp #469321:469322
@@ -20,7 +20,7 @@
 #include <qpainter.h>
 
 PackageWidget::PackageWidget(UMLView * view, UMLPackage *o)
-  : StereotypedWidget(view, o) {
+  : UMLWidget(view, o) {
     init();
     setSize(100, 30);
     calculateSize();
@@ -115,7 +115,7 @@
 
 void PackageWidget::saveToXMI(QDomDocument& qDoc, QDomElement& qElement) {
     QDomElement conceptElement = qDoc.createElement("packagewidget");
-    StereotypedWidget::saveToXMI(qDoc, conceptElement);
+    UMLWidget::saveToXMI(qDoc, conceptElement);
     qElement.appendChild(conceptElement);
 }
 
--- trunk/KDE/kdesdk/umbrello/umbrello/packagewidget.h #469321:469322
@@ -15,7 +15,7 @@
 #ifndef PACKAGEWIDGET_H
 #define PACKAGEWIDGET_H
 
-#include "stereotypedwidget.h"
+#include "umlwidget.h"
 
 class UMLPackage;
 
@@ -30,7 +30,7 @@
  * @see UMLWidget
  * Bugs and comments to uml-devel at lists.sf.net or http://bugs.kde.org
  */
-class PackageWidget : public StereotypedWidget {
+class PackageWidget : public UMLWidget {
 public:
 
     /**
--- trunk/KDE/kdesdk/umbrello/umbrello/umlwidget.cpp #469321:469322
@@ -1046,6 +1046,16 @@
     calculateSize();
 }
 
+void UMLWidget::setShowStereotype(bool _status) {
+    m_bShowStereotype = _status;
+    calculateSize();
+    update();
+}
+
+bool UMLWidget::getShowStereotype() const {
+    return m_bShowStereotype;
+}
+
 void UMLWidget::saveToXMI( QDomDocument & qDoc, QDomElement & qElement ) {
     /*
       Call after required actions in child class.
@@ -1069,6 +1079,8 @@
     qElement.setAttribute("isinstance", m_bIsInstance);
     if (!m_instanceName.isEmpty())
         qElement.setAttribute("instancename", m_instanceName);
+    if (m_bShowStereotype)
+        qElement.setAttribute("showstereotype", m_bShowStereotype);
 }
 
 bool UMLWidget::loadFromXMI( QDomElement & qElement ) {
@@ -1107,6 +1119,8 @@
     QString isinstance = qElement.attribute("isinstance", "0");
     m_bIsInstance = (bool)isinstance.toInt();
     m_instanceName = qElement.attribute("instancename", "");
+    QString showstereo = qElement.attribute("showstereotype", "0");
+    m_bShowStereotype = (bool)showstereo.toInt();
     return true;
 }
 
--- trunk/KDE/kdesdk/umbrello/umbrello/umlwidget.h #469321:469322
@@ -391,6 +391,20 @@
         return m_instanceName;
     }
 
+    /**
+     * Returns the status of whether to show Stereotype.
+     *
+     * @return  True if stereotype is shown.
+     */
+    bool getShowStereotype() const;
+
+    /**
+     * Set the status of whether to show Stereotype.
+     *
+     * @param _show             True if stereotype shall be shown.
+     */
+    virtual void setShowStereotype(bool _status);
+
     virtual void saveToXMI( QDomDocument & qDoc, QDomElement & qElement );
 
     virtual bool loadFromXMI( QDomElement & qElement );
@@ -591,6 +605,11 @@
      */
     QString m_instanceName;
 
+    /**
+     * Should it show the <<stereotype>> of the widget
+     */
+    bool m_bShowStereotype;
+
     ///////////////// End of Data Loaded/Saved //////////////////////////
 
     bool m_bMouseDown, m_bMouseOver, m_bSelected, m_bStartMove;




More information about the umbrello-devel mailing list