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

Ralf Habacker ralf.habacker at gmail.com
Fri Jan 13 23:22:48 UTC 2012


SVN commit 1273456 by habacker:

Reduced difference to soc-umbrello branch.

- renamed LinePath to AssociationLine
- moved AssociationLine to widgets subdir



 M  +1 -1      CMakeLists.txt  
 M  +1 -1      association.cpp  
 M  +10 -10    widgets/associationwidget.cpp  
 M  +8 -8      widgets/associationwidget.h  
 M  +1 -1      widgets/widgetbase.cpp  


--- trunk/KDE/kdesdk/umbrello/umbrello/CMakeLists.txt #1273455:1273456
@@ -366,6 +366,7 @@
     widgets/activitywidget.cpp
     widgets/actorwidget.cpp
     widgets/artifactwidget.cpp
+    widgets/associationline.cpp
     widgets/associationwidget.cpp
     widgets/boxwidget.cpp
     widgets/categorywidget.cpp
@@ -435,7 +436,6 @@
     foreignkeyconstraint.cpp
     icon_utils.cpp
     import_rose.cpp
-    linepath.cpp
     listpopupmenu.cpp
     main.cpp
     model_utils.cpp
--- trunk/KDE/kdesdk/umbrello/umbrello/association.cpp #1273455:1273456
@@ -415,7 +415,7 @@
     Uml::IDType roleBObjID = STR2ID(element.attribute( "roleb", "-1" ));
     if (assocType == Uml::AssociationType::Aggregation ||
         assocType == Uml::AssociationType::Composition) {
-        // Flip roles to compensate for changed diamond logic in LinePath.
+        // Flip roles to compensate for changed diamond logic in AssociationLine.
         // For further explanations see AssociationWidget::loadFromXMI.
         Uml::IDType tmp = roleAObjID;
         roleAObjID = roleBObjID;
--- trunk/KDE/kdesdk/umbrello/umbrello/widgets/associationwidget.cpp #1273455:1273456
@@ -1223,7 +1223,7 @@
 }
 
 
-/** Calculates and sets the first and last point in the Association's LinePath
+/** Calculates and sets the first and last point in the Association's AssociationLine
     Each point is a middle point of its respecting UMLWidget's Bounding rectangle
     or a corner of it
     This method picks which sides to use for the association */
@@ -1246,12 +1246,12 @@
      *
      * Each diagonal is defined by two corners of the bounding rectangle
      *
-     * To calculate the first point in the LinePath we have to find out in which
+     * To calculate the first point in the AssociationLine we have to find out in which
      * Region (defined by WidgetA's diagonals) is WidgetB's center
      * (let's call it Region M.) After that the first point will be the middle
      * point of the rectangle's side contained in Region M.
      *
-     * To calculate the last point in the LinePath we repeat the above but
+     * To calculate the last point in the AssociationLine we repeat the above but
      * in the opposite direction (from widgetB to WidgetA)
      */
 
@@ -1475,7 +1475,7 @@
  * Auxiliary method for widgetMoved():
  * Saves all ideally computed floatingtext positions before doing any
  * kind of change.  This is necessary because a single invocation of
- * calculateEndingPoints() modifies the LinePath ending points on ALL
+ * calculateEndingPoints() modifies the AssociationLine ending points on ALL
  * AssociationWidgets.  This means that if we don't save the old ideal
  * positions then they are irretrievably lost as soon as
  * calculateEndingPoints() is invoked.
@@ -1722,7 +1722,7 @@
     return swapped;
 }
 
-/* Returns the total length of the association's LinePath:
+/* Returns the total length of the association's AssociationLine:
    result = segment_1_length + segment_2_length + ..... + segment_n_length
  */
 float AssociationWidget::totalLength()
@@ -2264,7 +2264,7 @@
 /**
  * Calculates the m_unNameLineSegment value according to the new
  * NameText topleft corner PT.
- * It iterates through all LinePath's segments and for each one
+ * It iterates through all AssociationLine's segments and for each one
  * calculates the sum of PT's distance to the start point + PT's
  * distance to the end point. The segment with the smallest sum will
  * be the RoleTextSegment (if this segment moves then the RoleText
@@ -3250,7 +3250,7 @@
             continue;
         // Determine intercept position on the edge indicated by `region'.
         UMLWidget * otherWidget = (inWidgetARegion ? wB : wA);
-        LinePath *linepath = assocwidget->getLinePath();
+        AssociationLine *linepath = assocwidget->getLinePath();
         QPoint refpoint;
         if (assocwidget->linePathStartsAt(otherWidget))
             refpoint = linepath->getPoint(linepath->count() - 2);
@@ -3413,8 +3413,8 @@
         m_LinePath.setPoint( 0, pt );
     else {
         m_LinePath.setPoint( m_LinePath.count() - 1, pt );
-        LinePath::Region r = ( region == South || region == North ) ?
-                             LinePath::TopBottom : LinePath::LeftRight;
+        AssociationLine::Region r = ( region == South || region == North ) ?
+                             AssociationLine::TopBottom : AssociationLine::LeftRight;
         m_LinePath.setDockRegion( r );
     }
 }
@@ -3974,7 +3974,7 @@
                 if (aType == AssociationType::Aggregation || aType == AssociationType::Composition) {
                     uWarning()<<" Old Style save file? swapping roles on association widget"<<this;
                     // We have to swap the A and B widgets to compensate
-                    // for the long standing bug in LinePath of drawing
+                    // for the long standing bug in AssociationLine of drawing
                     // the diamond at the wrong end which was fixed
                     // just before the 1.2 release.
                     // The logic here is that the user has understood
--- trunk/KDE/kdesdk/umbrello/umbrello/widgets/associationwidget.h #1273455:1273456
@@ -16,7 +16,7 @@
 #include "umlwidgetlist.h"
 #include "messagewidgetlist.h"
 #include "associationwidgetlist.h"
-#include "linepath.h"
+#include "associationline.h"
 
 #include <QMouseEvent>
 #include <QMoveEvent>
@@ -270,7 +270,7 @@
     /**
      * Returns a pointer to the association widget's line path.
      */
-    LinePath* getLinePath() {
+    AssociationLine* getLinePath() {
         return &m_LinePath;
     }
 
@@ -293,7 +293,7 @@
      * Auxiliary method for widgetMoved():
      * Saves all ideally computed floatingtext positions before doing any
      * kind of change.  This is necessary because a single invocation of
-     * calculateEndingPoints() modifies the LinePath ending points on ALL
+     * calculateEndingPoints() modifies the AssociationLine ending points on ALL
      * AssociationWidgets.  This means that if we don't save the old ideal
      * positions then they are irretrievably lost as soon as
      * calculateEndingPoints() is invoked.
@@ -303,7 +303,7 @@
     /**
      * Calculates the m_unNameLineSegment value according to the new
      * NameText topleft corner PT.
-     * It iterates through all LinePath's segments and for each one
+     * It iterates through all AssociationLine's segments and for each one
      * calculates the sum of PT's distance to the start point + PT's
      * distance to the end point. The segment with the smallest sum will
      * be the RoleTextSegment (if this segment moves then the RoleText
@@ -535,7 +535,7 @@
 
     /**
      * Calculates and sets the first and last point in the association's
-     * LinePath.
+     * AssociationLine.
      * Each point is a middle point of its respective UMLWidget's bounding
      * rectangle.
      * This method picks which sides to use for the association.
@@ -669,7 +669,7 @@
     static QPoint swapXY(const QPoint &p);
 
     /**
-     * Returns the total length of the association's LinePath:
+     * Returns the total length of the association's AssociationLine:
      * result = segment_1_length + segment_2_length + ... + segment_n_length
      */
     float totalLength();
@@ -891,7 +891,7 @@
 
     /**
      * When the association has a Role Floating Text this text should move
-     * when the LinePath moves but only if the closest segment to the
+     * when the AssociationLine moves but only if the closest segment to the
      * role text moves.
      * This segment is:
      * m_LinePath[m_unNameLineSegment] -- m_LinePath[m_unNameLineSegment+1]
@@ -947,7 +947,7 @@
     /**
      * The definition points for the association line.
      */
-    LinePath m_LinePath;
+    AssociationLine m_LinePath;
 
     // The following items are only used if m_pObject is not set.
     Uml::AssociationType m_AssocType;
--- trunk/KDE/kdesdk/umbrello/umbrello/widgets/widgetbase.cpp #1273455:1273456
@@ -87,7 +87,7 @@
 
 /**
  * Deliver a pointer to the connected UMLView
- * ( needed esp. by event handling of LinePath ).
+ * ( needed esp. by event handling of AssociationLine ).
  */
 UMLScene* WidgetBase::umlScene() const
 {




More information about the umbrello-devel mailing list