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

Andi Fischer andi.fischer at hispeed.ch
Sun Mar 18 14:04:53 UTC 2012


SVN commit 1286188 by fischer:

Some getters renamed.

 M  +2 -2      dotgenerator.cpp  
 M  +7 -7      layoutgenerator.h  
 M  +3 -3      toolbarstate.cpp  
 M  +1 -1      toolbarstateassociation.cpp  
 M  +6 -6      toolbarstatemessages.cpp  
 M  +4 -4      umlview.cpp  
 M  +3 -3      umlview.h  
 M  +14 -6     widgets/associationwidget.cpp  
 M  +17 -22    widgets/associationwidget.h  


--- trunk/KDE/kdesdk/umbrello/umbrello/dotgenerator.cpp #1286187:1286188
@@ -299,7 +299,7 @@
     QString data;
     QTextStream out(&data);
 
-    foreach(UMLWidget *widget, scene->getWidgetList()) {
+    foreach(UMLWidget *widget, scene->widgetList()) {
         QStringList params;
 
         if (m_nodeParameters.contains("all"))
@@ -352,7 +352,7 @@
                 << " [" << params.join(",") << "];\n";
     }
 
-    foreach(AssociationWidget *assoc, scene->getAssociationList()) {
+    foreach(AssociationWidget *assoc, scene->associationList()) {
         QString type = assoc->associationType().toString().toLower();
         QString key = "type::" + type;
         bool swapId = m_edgeParameters.contains("id::" + key) && m_edgeParameters["id::" + key] == "swap";
--- trunk/KDE/kdesdk/umbrello/umbrello/layoutgenerator.h #1286187:1286188
@@ -197,8 +197,8 @@
      */
     bool apply(UMLScene *scene)
     {
-        foreach(AssociationWidget *assoc, scene->getAssociationList()) {
-            AssociationLine *path = assoc->getLinePath();
+        foreach(AssociationWidget *assoc, scene->associationList()) {
+            AssociationLine *path = assoc->associationLine();
             QString type = assoc->associationType().toString().toLower();
             QString key = "type::" + type;
 
@@ -211,7 +211,7 @@
             // adjust associations not used in the dot file
             if (!m_edges.contains(id)) {
                 // shorten line path
-                AssociationLine *path = assoc->getLinePath();
+                AssociationLine *path = assoc->associationLine();
                 if (path->count() > 2 && assoc->getWidgetID(Uml::A) != assoc->getWidgetID(Uml::B)) {
                     while(path->count() > 2)
                         path->removePoint(1);
@@ -245,7 +245,7 @@
             */
         }
 
-        foreach(UMLWidget *widget, scene->getWidgetList()) {
+        foreach(UMLWidget *widget, scene->widgetList()) {
             QString id = ID2STR(widget->id());
             if (!m_nodes.contains(id))
                 continue;
@@ -255,10 +255,10 @@
             widget->adjustAssocs(widget->getX(), widget->getY());    // adjust assoc lines
         }
 
-        foreach(AssociationWidget *assoc, scene->getAssociationList()) {
+        foreach(AssociationWidget *assoc, scene->associationList()) {
             assoc->calculateEndingPoints();
-            if (assoc->getLinePath())
-                assoc->getLinePath()->update();
+            if (assoc->associationLine())
+                assoc->associationLine()->update();
             assoc->resetTextPositions();
         }
         return true;
--- trunk/KDE/kdesdk/umbrello/umbrello/toolbarstate.cpp #1286187:1286188
@@ -478,7 +478,7 @@
  */
 MessageWidget* ToolBarState::getMessageAt(const QPoint& pos)
 {
-    foreach (  MessageWidget* message, m_pUMLScene->getMessageList() ) {
+    foreach (  MessageWidget* message, m_pUMLScene->messageList() ) {
         if (message->isVisible() && message->onWidget(pos)) {
             return message;
         }
@@ -497,7 +497,7 @@
  */
 AssociationWidget* ToolBarState::getAssociationAt(const QPoint& pos)
 {
-    foreach ( AssociationWidget* association, m_pUMLScene->getAssociationList() ) {
+    foreach ( AssociationWidget* association, m_pUMLScene->associationList() ) {
         if (association->onAssociation(pos)) {
             return association;
         }
@@ -517,7 +517,7 @@
 {
     FloatingDashLineWidget* floatingline = 0;
 
-    foreach ( UMLWidget* widget, m_pUMLScene->getWidgetList() ) {
+    foreach ( UMLWidget* widget, m_pUMLScene->widgetList() ) {
         if (widget->baseType() == WidgetBase::wt_FloatingDashLine){
             if (dynamic_cast<FloatingDashLineWidget*>(widget)->onLine(pos)) {
                 floatingline = dynamic_cast<FloatingDashLineWidget*>(widget);
--- trunk/KDE/kdesdk/umbrello/umbrello/toolbarstateassociation.cpp #1286187:1286188
@@ -117,7 +117,7 @@
 
     getCurrentAssociation()->createAssocClassLine(
             static_cast<ClassifierWidget*>(m_firstWidget),
-            getCurrentAssociation()->getLinePath()->closestPointIndex(m_pMouseEvent->pos()));
+            getCurrentAssociation()->associationLine()->closestPointIndex(m_pMouseEvent->pos()));
     m_firstWidget->addAssoc( getCurrentAssociation() );
     cleanAssociation();
 }
--- trunk/KDE/kdesdk/umbrello/umbrello/toolbarstatemessages.cpp #1286187:1286188
@@ -180,7 +180,7 @@
         MessageWidget* message = new MessageWidget(m_pUMLScene, m_firstObject,xclick, yclick, msgType);
 
         cleanMessage();
-        m_pUMLScene->getMessageList().append(message);
+        m_pUMLScene->messageList().append(message);
         xclick = 0;
         yclick = 0;
 
@@ -189,7 +189,7 @@
         //Shouldn't it cancel also the whole creation?
         ft->showOperationDialog();
         message->setTextPosition();
-        m_pUMLScene->getWidgetList().append(ft);
+        m_pUMLScene->widgetList().append(ft);
 
         UMLApp::app()->document()->setModified();
     }
@@ -226,7 +226,7 @@
     if (msgType ==  Uml::sequence_message_found && xclick!=0 && yclick!=0) {
         MessageWidget* message = new MessageWidget(m_pUMLScene, m_firstObject,xclick, yclick, msgType);
         cleanMessage();
-        m_pUMLScene->getMessageList().append(message);
+        m_pUMLScene->messageList().append(message);
 
         xclick = 0;
         yclick = 0;
@@ -236,7 +236,7 @@
         //Shouldn't it cancel also the whole creation?
         ft->showOperationDialog();
         message->setTextPosition();
-        m_pUMLScene->getWidgetList().append(ft);
+        m_pUMLScene->widgetList().append(ft);
 
         UMLApp::app()->document()->setModified();
     }
@@ -284,14 +284,14 @@
 
     cleanMessage();
 
-    m_pUMLScene->getMessageList().append(message);
+    m_pUMLScene->messageList().append(message);
 
     FloatingTextWidget *ft = message->floatingTextWidget();
     //TODO cancel doesn't cancel the creation of the message, only cancels setting an operation.
     //Shouldn't it cancel also the whole creation?
     ft->showOperationDialog();
     message->setTextPosition();
-    m_pUMLScene->getWidgetList().append(ft);
+    m_pUMLScene->widgetList().append(ft);
 
     UMLApp::app()->document()->setModified();
 }
--- trunk/KDE/kdesdk/umbrello/umbrello/umlview.cpp #1286187:1286188
@@ -1305,8 +1305,8 @@
     makeSelected(a->multiplicityWidget(B));
     makeSelected(a->roleWidget(A));
     makeSelected(a->roleWidget(B));
-    makeSelected(a->getChangeWidget(A));
-    makeSelected(a->getChangeWidget(B));
+    makeSelected(a->changeabilityWidget(A));
+    makeSelected(a->changeabilityWidget(B));
 }
 
 void UMLView::selectWidgets(int px, int py, int qx, int qy)
@@ -2543,8 +2543,8 @@
         const FloatingTextWidget* multiB = const_cast<FloatingTextWidget*>(a->multiplicityWidget(B));
         const FloatingTextWidget* roleA = const_cast<FloatingTextWidget*>(a->roleWidget(A));
         const FloatingTextWidget* roleB = const_cast<FloatingTextWidget*>(a->roleWidget(B));
-        const FloatingTextWidget* changeA = const_cast<FloatingTextWidget*>(a->getChangeWidget(A));
-        const FloatingTextWidget* changeB = const_cast<FloatingTextWidget*>(a->getChangeWidget(B));
+        const FloatingTextWidget* changeA = const_cast<FloatingTextWidget*>(a->changeabilityWidget(A));
+        const FloatingTextWidget* changeB = const_cast<FloatingTextWidget*>(a->changeabilityWidget(B));
         findMaxBoundingRectangle(multiA, px, py, qx, qy);
         findMaxBoundingRectangle(multiB, px, py, qx, qy);
         findMaxBoundingRectangle(roleA, px, py, qx, qy);
--- trunk/KDE/kdesdk/umbrello/umbrello/umlview.h #1286187:1286188
@@ -335,21 +335,21 @@
     /**
      * Returns a reference to the association list.
      */
-    AssociationWidgetList& getAssociationList() {
+    AssociationWidgetList& associationList() {
         return m_AssociationList;
     }
 
     /**
      * Returns a reference to the widget list.
      */
-    UMLWidgetList& getWidgetList() {
+    UMLWidgetList& widgetList() {
         return m_WidgetList;
     }
 
     /**
      * Returns a reference to the message list.
      */
-    MessageWidgetList& getMessageList() {
+    MessageWidgetList& messageList() {
         return m_MessageList;
     }
 
--- trunk/KDE/kdesdk/umbrello/umbrello/widgets/associationwidget.cpp #1286187:1286188
@@ -652,6 +652,14 @@
 }
 
 /**
+ * Returns a pointer to the association widget's line path.
+ */
+AssociationLine* AssociationWidget::associationLine() const
+{
+    return m_associationLine;
+}
+
+/**
  * Activates the AssociationWidget after a load.
  *
  * @return  true for success
@@ -819,7 +827,7 @@
 /**
  * Return the given role's changeability FloatingTextWidget widget.
  */
-FloatingTextWidget* AssociationWidget::getChangeWidget(Uml::Role_Type role)
+FloatingTextWidget* AssociationWidget::changeabilityWidget(Uml::Role_Type role) const
 {
     return m_role[role].m_pChangeWidget;
 }
@@ -3276,7 +3284,7 @@
     if(region == Error)
         return 0;
     int widgetCount = 0;
-    AssociationWidgetList list = m_scene->getAssociationList();
+    AssociationWidgetList list = m_scene->associationList();
     foreach ( AssociationWidget* assocwidget, list ) {
         //don't count this association
         if (assocwidget == this)
@@ -3506,7 +3514,7 @@
 {
     if( region == Error )
         return;
-    AssociationWidgetList list = m_scene->getAssociationList();
+    AssociationWidgetList list = m_scene->associationList();
 
     UMLWidget *ownWidget = m_role[role].m_pWidget;
     m_positions_len = 0;
@@ -3530,7 +3538,7 @@
             continue;
         // Determine intercept position on the edge indicated by `region'.
         UMLWidget * otherWidget = (inWidgetARegion ? wB : wA);
-        AssociationLine *linepath = assocwidget->getLinePath();
+        AssociationLine *linepath = assocwidget->associationLine();
         QPoint refpoint;
         if (assocwidget->linePathStartsAt(otherWidget))
             refpoint = linepath->point(linepath->count() - 2);
@@ -4338,8 +4346,8 @@
  */
 bool AssociationWidget::loadFromXMI( QDomElement & qElement )
 {
-    const MessageWidgetList& messages = m_scene->getMessageList();
-    return loadFromXMI( qElement, m_scene->getWidgetList(), &messages );
+    const MessageWidgetList& messages = m_scene->messageList();
+    return loadFromXMI( qElement, m_scene->widgetList(), &messages );
 }
 
 #include "associationwidget.moc"
--- trunk/KDE/kdesdk/umbrello/umbrello/widgets/associationwidget.h #1286187:1286188
@@ -74,7 +74,6 @@
     //---------- LinkWidget Interface methods implemementation from now on.
 
     virtual void lwSetFont(QFont font);
-
     virtual UMLClassifier *operationOwner();
 
     virtual UMLOperation *operation();
@@ -93,6 +92,9 @@
     virtual UMLClassifier* seqNumAndOp(QString& seqNum, QString& op);
     virtual void setSeqNumAndOp(const QString &seqNum, const QString &op);
 
+    void constrainTextPos(int &textX, int &textY, int textWidth, int textHeight,
+                          Uml::TextRole tr);
+
     virtual void calculateNameTextSegment();
 
     //---------- End LinkWidget Interface methods implemementation.
@@ -110,10 +112,10 @@
 
     FloatingTextWidget* textWidgetByRole(Uml::TextRole tr) const;
 
+    FloatingTextWidget* nameWidget() const;
     QString getName() const;
     void setName(const QString &strRole);
 
-    FloatingTextWidget* nameWidget() const;
     FloatingTextWidget* roleWidget(Uml::Role_Type role) const;
     QString roleName(Uml::Role_Type role) const;
     void setRoleName(const QString &strRole, Uml::Role_Type role);
@@ -126,8 +128,9 @@
     void setMultiplicity(const QString &strMulti, Uml::Role_Type role);
 
     Uml::Visibility visibility(Uml::Role_Type role) const;
-    void setVisibility(Uml::Visibility visibility, Uml::Role_Type role );
+    void setVisibility(Uml::Visibility value, Uml::Role_Type role );
 
+    FloatingTextWidget* changeabilityWidget(Uml::Role_Type role) const;
     Uml::Changeability changeability(Uml::Role_Type role) const;
     void setChangeability (Uml::Changeability value, Uml::Role_Type role);
 
@@ -161,12 +164,7 @@
         return m_selected;
     }
 
-    /**
-     * Returns a pointer to the association widget's line path.
-     */
-    AssociationLine* getLinePath() {
-        return m_associationLine;
-    }
+    AssociationLine* associationLine() const;
 
     void widgetMoved(UMLWidget* widget, int x, int y);
 
@@ -200,11 +198,6 @@
     virtual void setLineColor(const QColor &colour);
     void setLineWidth(uint width);
 
-    FloatingTextWidget* getChangeWidget(Uml::Role_Type role);
-
-    void constrainTextPos(int &textX, int &textY, int textWidth, int textHeight,
-                          Uml::TextRole tr);
-
     void setIndex(int index, Uml::Role_Type role);
     int getIndex(Uml::Role_Type role) const;
 
@@ -228,6 +221,15 @@
 
     void cleanup();
 
+public slots:
+    void slotMenuSelection(QAction* action);
+    void slotRemovePopupMenu();
+    void slotClearAllSelected();
+    void slotClassifierListItemRemoved(UMLClassifierListItem* obj);
+    void slotAttributeChanged();
+
+    void syncToModel();
+
 private:
 
     /**
@@ -433,13 +435,6 @@
     // The following items are only used if m_pObject is not set.
     Uml::AssociationType m_AssocType;
 
-public slots:
-    void slotMenuSelection(QAction* action);
-    void slotRemovePopupMenu();
-    void slotClearAllSelected();
-    void slotClassifierListItemRemoved(UMLClassifierListItem* obj);
-    void slotAttributeChanged();
-
-    void syncToModel();
 };
+
 #endif




More information about the umbrello-devel mailing list