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

Andi Fischer andi.fischer at hispeed.ch
Wed Jan 25 19:06:31 UTC 2012


SVN commit 1275888 by fischer:

Method comments moved from h to cpp file.

 M  +18 -1     packagewidget.cpp  
 M  +5 -27     packagewidget.h  
 M  +42 -3     seqlinewidget.cpp  
 M  +9 -67     seqlinewidget.h  


--- trunk/KDE/kdesdk/umbrello/umbrello/widgets/packagewidget.cpp #1275887:1275888
@@ -22,6 +22,12 @@
 #include "umlview.h"
 #include "umlobject.h"
 
+/**
+ * Constructs a PackageWidget.
+ *
+ * @param scene              The parent of this PackageWidget.
+ * @param o         The UMLObject this will be representing.
+ */
 PackageWidget::PackageWidget(UMLScene * scene, UMLPackage *o)
   : UMLWidget(scene, WidgetBase::wt_Package, o)
 {
@@ -35,10 +41,16 @@
     }
 }
 
+/**
+ * Destructor.
+ */
 PackageWidget::~PackageWidget()
 {
 }
 
+/**
+ * Overrides standard method.
+ */
 void PackageWidget::paint(QPainter & p, int offsetX, int offsetY)
 {
     setPenFromSettings(p);
@@ -89,6 +101,9 @@
     }
 }
 
+/**
+ * Overrides method from UMLWidget
+ */
 UMLSceneSize PackageWidget::minimumSize()
 {
     if ( !m_pObject ) {
@@ -118,10 +133,12 @@
     return UMLSceneSize(width, height);
 }
 
+/**
+ * Saves to the "packagewidget" XMI element.
+ */
 void PackageWidget::saveToXMI(QDomDocument& qDoc, QDomElement& qElement)
 {
     QDomElement conceptElement = qDoc.createElement("packagewidget");
     UMLWidget::saveToXMI(qDoc, conceptElement);
     qElement.appendChild(conceptElement);
 }
-
--- trunk/KDE/kdesdk/umbrello/umbrello/widgets/packagewidget.h #1275887:1275888
@@ -18,51 +18,29 @@
 #define PACKAGE_MARGIN 5
 
 /**
- * Defines a graphical version of the Package.  Most of the functionality
- * will come from the @ref UMLPackage class.
+ * Defines a graphical version of the Package.  Most of the
+ * functionality will come from the @ref UMLPackage class.
  *
  * @short A graphical version of a Package.
  * @author Jonathan Riddell
  * @see UMLWidget
  * Bugs and comments to uml-devel at lists.sf.net or http://bugs.kde.org
  */
-class PackageWidget : public UMLWidget {
+class PackageWidget : public UMLWidget
+{
 public:
-
-    /**
-     * Constructs a PackageWidget.
-     *
-     * @param scene              The parent of this PackageWidget.
-     * @param o         The UMLObject this will be representing.
-     */
     PackageWidget(UMLScene * scene, UMLPackage * o);
-
-    /**
-     * destructor
-     */
     virtual ~PackageWidget();
 
-    /**
-     * Overrides standard method.
-     */
     void paint(QPainter& p, int offsetX, int offsetY);
 
-    /**
-     * Saves to the "packagewidget" XMI element.
-     */
     void saveToXMI(QDomDocument& qDoc, QDomElement& qElement);
 
 protected:
-    /**
-     * Overrides method from UMLWidget
-     */
     UMLSceneSize minimumSize();
 
 private:
-    /**
-     * The right mouse button menu.
-     */
-    ListPopupMenu* m_pMenu;
+    ListPopupMenu* m_pMenu;  ///< the right mouse button menu
 };
 
 #endif
--- trunk/KDE/kdesdk/umbrello/umbrello/widgets/seqlinewidget.cpp #1275887:1275888
@@ -11,9 +11,6 @@
 // own header
 #include "seqlinewidget.h"
 
-//kde includes
-#include <kcursor.h>
-
 //qt includes
 #include <QtGui/QPainter>
 
@@ -25,6 +22,9 @@
 // class members
 int const SeqLineWidget::m_nMouseDownEpsilonX = 20;
 
+/**
+ * Constructor.
+ */
 SeqLineWidget::SeqLineWidget( UMLView * pView, ObjectWidget * pObject )
   : UMLSceneLine( pView -> canvas() )
 {
@@ -38,10 +38,20 @@
     setupDestructionBox();
 }
 
+/**
+ * Destructor.
+ */
 SeqLineWidget::~SeqLineWidget()
 {
 }
 
+/**
+ * Return whether on seq. line.
+ * Takes into account destruction box if shown.
+ *
+ * @param p The point to investigate.
+ * @return  Non-zero if point is on this sequence line.
+ */
 int SeqLineWidget::onWidget( const QPoint & p )
 {
     int nOnWidget = 0;
@@ -57,6 +67,12 @@
     return nOnWidget;
 }
 
+/**
+ * Return whether on the destruction box.
+ *
+ * @param p The point to investigate.
+ * @return  Non-zero if point is on the destruction box of this sequence line.
+ */
 int SeqLineWidget::onDestructionBox ( const QPoint & p )
 {
     int nOnDestructionBox = 0;
@@ -75,11 +91,20 @@
     return nOnDestructionBox;
 }
 
+/**
+ * Clean up anything before deletion.
+ */
 void SeqLineWidget::cleanup()
 {
     cleanupDestructionBox();
 }
 
+/**
+ * Set the start point of the line.
+ *
+ * @param startX    X coordinate of the start point.
+ * @param startY    Y coordinate of the start point.
+ */
 void SeqLineWidget::setStartPoint( int startX, int startY )
 {
     int endX = startX;
@@ -88,6 +113,9 @@
     moveDestructionBox();
 }
 
+/**
+ * Clean up destruction box.
+ */
 void SeqLineWidget::cleanupDestructionBox()
 {
     if ( m_DestructionBox.line1 ) {
@@ -98,6 +126,9 @@
     }
 }
 
+/**
+ * Set up destruction box.
+ */
 void SeqLineWidget::setupDestructionBox()
 {
     cleanupDestructionBox();
@@ -123,6 +154,9 @@
     m_DestructionBox.line2->setZ( 3 );
 }
 
+/**
+ * Move destruction box.
+ */
 void SeqLineWidget::moveDestructionBox()
 {
     if( !m_DestructionBox.line1 ) {
@@ -137,6 +171,11 @@
     m_DestructionBox.setLine2Points(rect);
 }
 
+/**
+ * Sets the y position of the bottom of the vertical line.
+ *
+ * @param yPosition The y coordinate for the bottom of the line.
+ */
 void SeqLineWidget::setEndOfLine(int yPosition)
 {
     QPoint sp = startPoint();
--- trunk/KDE/kdesdk/umbrello/umbrello/widgets/seqlinewidget.h #1275887:1275888
@@ -4,7 +4,7 @@
  *   the Free Software Foundation; either version 2 of the License, or     *
  *   (at your option) any later version.                                   *
  *                                                                         *
- *   copyright (C) 2002-2007                                               *
+ *   copyright (C) 2002-2011                                               *
  *   Umbrello UML Modeller Authors <uml-devel at uml.sf.net>                  *
  ***************************************************************************/
 
@@ -13,7 +13,6 @@
 
 #include "umlscene.h"
 
-class UMLScene;
 class ObjectWidget;
 
 /**
@@ -21,52 +20,20 @@
  * @author Paul Hensgen
  * Bugs and comments to uml-devel at lists.sf.net or http://bugs.kde.org
  */
-class SeqLineWidget : public UMLSceneLine {
+class SeqLineWidget : public UMLSceneLine
+{
 public:
-    /**
-     * Constructor.
-     */
     SeqLineWidget( UMLView * pView, ObjectWidget * pObject );
+    virtual ~SeqLineWidget();
 
-    /**
-     * Destructor.
-     */
-    ~SeqLineWidget();
-
-    /**
-     * Return whether on seq. line.
-     * Takes into account destruction box if shown.
-     *
-     * @param p The point to investigate.
-     * @return  Non-zero if point is on this sequence line.
-     */
     int onWidget(const QPoint & p);
 
-    /**
-     * Return whether on the destruction box.
-     *
-     * @param p The point to investigate.
-     * @return  Non-zero if point is on the destruction box of this sequence line.
-     */
     int onDestructionBox ( const QPoint & p );
 
-
-    /**
-     * Clean up anything before deletion.
-     */
     void cleanup();
 
-    /**
-     * Set up destruction box.
-     */
     void setupDestructionBox();
 
-    /**
-     * Set the start point of the line.
-     *
-     * @param startX    X coordinate of the start point.
-     * @param startY    Y coordinate of the start point.
-     */
     void setStartPoint( int startX, int startY );
 
     /**
@@ -87,35 +54,16 @@
         return m_pObject;
     }
 
-    /**
-     * Sets the y position of the bottom of the vertical line.
-     *
-     * @param yPosition The y coordinate for the bottom of the line.
-     */
     void setEndOfLine(int yPosition);
 
 protected:
-    /**
-     * Clean up destruction box.
-     */
     void cleanupDestructionBox();
 
-    /**
-     * Move destruction box.
-     */
     void moveDestructionBox();
 
-    /**
-     * ObjectWidget associated with this sequence line.
-     */
-    ObjectWidget * m_pObject;
+    ObjectWidget* m_pObject;  ///< ObjectWidget associated with this sequence line
+    UMLView*      m_scene;    ///< view displayed on
 
-    /**
-     * View displayed on.
-     */
-    UMLView * m_scene;
-
-    /// The destruction box.
     struct DestructionBox {
         UMLSceneLine * line1;
         UMLSceneLine * line2;
@@ -127,17 +75,11 @@
             line2->setPoints( rect.x(), rect.y() + rect.height(),
                               rect.x() + rect.width(), rect.y() );
         }
-    } m_DestructionBox;
+    } m_DestructionBox;  ///< the destruction box
 
-    /**
-     * The length of the line.
-     */
-    int m_nLengthY;
+    int m_nLengthY;  ///< the length of the line
 
-    /**
-     * Margin used for mouse clicks.
-     */
-    static int const m_nMouseDownEpsilonX;
+    static int const m_nMouseDownEpsilonX;   ///< margin used for mouse clicks
 };
 
 #endif




More information about the umbrello-devel mailing list