[Uml-devel] KDE/kdesdk/umbrello/umbrello
Andi Fischer
andi.fischer at hispeed.ch
Sun Mar 18 14:19:11 UTC 2012
SVN commit 1286192 by fischer:
Some getters renamed.
M +2 -2 dotgenerator.cpp
M +3 -3 layoutgenerator.h
M +12 -12 umlview.cpp
M +7 -7 widgets/associationwidget.cpp
M +1 -1 widgets/associationwidget.h
--- trunk/KDE/kdesdk/umbrello/umbrello/dotgenerator.cpp #1286191:1286192
@@ -400,8 +400,8 @@
#ifdef DOTGENERATOR_DATA_DEBUG
uDebug() << type << params;
#endif
- QString aID = fixID(ID2STR(assoc->getWidgetID(swapId ? Uml::A : Uml::B)));
- QString bID = fixID(ID2STR(assoc->getWidgetID(swapId ? Uml::B : Uml::A)));
+ QString aID = fixID(ID2STR(assoc->widgetIDForRole(swapId ? Uml::A : Uml::B)));
+ QString bID = fixID(ID2STR(assoc->widgetIDForRole(swapId ? Uml::B : Uml::A)));
out << "\"" << aID << "\" -> \"" << bID << "\"" << " [" << params.join(",") << "];\n";
}
--- trunk/KDE/kdesdk/umbrello/umbrello/layoutgenerator.h #1286191:1286192
@@ -204,15 +204,15 @@
QString id;
if (m_edgeParameters.contains("id::" + key) && m_edgeParameters["id::" + key] == "swap")
- id = fixID(ID2STR(assoc->getWidgetID(Uml::A)) + ID2STR(assoc->getWidgetID(Uml::B)));
+ id = fixID(ID2STR(assoc->widgetIDForRole(Uml::A)) + ID2STR(assoc->widgetIDForRole(Uml::B)));
else
- id = fixID(ID2STR(assoc->getWidgetID(Uml::B)) + ID2STR(assoc->getWidgetID(Uml::A)));
+ id = fixID(ID2STR(assoc->widgetIDForRole(Uml::B)) + ID2STR(assoc->widgetIDForRole(Uml::A)));
// adjust associations not used in the dot file
if (!m_edges.contains(id)) {
// shorten line path
AssociationLine *path = assoc->associationLine();
- if (path->count() > 2 && assoc->getWidgetID(Uml::A) != assoc->getWidgetID(Uml::B)) {
+ if (path->count() > 2 && assoc->widgetIDForRole(Uml::A) != assoc->widgetIDForRole(Uml::B)) {
while(path->count() > 2)
path->removePoint(1);
}
--- trunk/KDE/kdesdk/umbrello/umbrello/umlview.cpp #1286191:1286192
@@ -858,8 +858,8 @@
testType != Uml::AssociationType::Aggregation &&
testType != Uml::AssociationType::Relationship)
continue;
- if (pWidgetA->id() == assoc->getWidgetID(A) &&
- pWidgetB->id() == assoc->getWidgetID(B) &&
+ if (pWidgetA->id() == assoc->widgetIDForRole(A) &&
+ pWidgetB->id() == assoc->widgetIDForRole(B) &&
assoc->roleName(Uml::B) == roleNameB)
return assoc;
}
@@ -873,8 +873,8 @@
Uml::AssociationType testType = assoc->associationType();
if (testType != at)
continue;
- if (pWidgetA->id() == assoc->getWidgetID(A) &&
- pWidgetB->id() == assoc->getWidgetID(B))
+ if (pWidgetA->id() == assoc->widgetIDForRole(A) &&
+ pWidgetB->id() == assoc->widgetIDForRole(B))
return assoc;
}
return 0;
@@ -1793,17 +1793,17 @@
Uml::IDType ida = Uml::id_None, idb = Uml::id_None;
if (type() == Uml::DiagramType::Collaboration || type() == Uml::DiagramType::Sequence) {
//check local log first
- ida = m_pIDChangesLog->findNewID(pAssoc->getWidgetID(A));
- idb = m_pIDChangesLog->findNewID(pAssoc->getWidgetID(B));
+ ida = m_pIDChangesLog->findNewID(pAssoc->widgetIDForRole(A));
+ idb = m_pIDChangesLog->findNewID(pAssoc->widgetIDForRole(B));
//if either is still not found and assoc type is anchor
//we are probably linking to a notewidet - else an error
if (ida == Uml::id_None && assocType == Uml::AssociationType::Anchor)
- ida = log->findNewID(pAssoc->getWidgetID(A));
+ ida = log->findNewID(pAssoc->widgetIDForRole(A));
if (idb == Uml::id_None && assocType == Uml::AssociationType::Anchor)
- idb = log->findNewID(pAssoc->getWidgetID(B));
+ idb = log->findNewID(pAssoc->widgetIDForRole(B));
} else {
- Uml::IDType oldIdA = pAssoc->getWidgetID(A);
- Uml::IDType oldIdB = pAssoc->getWidgetID(B);
+ Uml::IDType oldIdA = pAssoc->widgetIDForRole(A);
+ Uml::IDType oldIdB = pAssoc->widgetIDForRole(B);
ida = log->findNewID(oldIdA);
if (ida == Uml::id_None) { // happens after a cut
if (oldIdA == Uml::id_None)
@@ -1827,8 +1827,8 @@
pAssoc->setWidget(findWidget(idb), B);
}
- UMLWidget * pWidgetA = findWidget(pAssoc->getWidgetID(A));
- UMLWidget * pWidgetB = findWidget(pAssoc->getWidgetID(B));
+ UMLWidget * pWidgetA = findWidget(pAssoc->widgetIDForRole(A));
+ UMLWidget * pWidgetB = findWidget(pAssoc->widgetIDForRole(B));
//make sure valid widget ids
if (!pWidgetA || !pWidgetB) {
return false;
--- trunk/KDE/kdesdk/umbrello/umbrello/widgets/associationwidget.cpp #1286191:1286192
@@ -614,10 +614,10 @@
if (associationType() != Other.associationType())
return false;
- if (getWidgetID(A) != Other.getWidgetID(A))
+ if (widgetIDForRole(A) != Other.widgetIDForRole(A))
return false;
- if (getWidgetID(B) != Other.getWidgetID(B))
+ if (widgetIDForRole(B) != Other.widgetIDForRole(B))
return false;
if (widgetForRole(A)->baseType() == WidgetBase::wt_Object &&
@@ -691,9 +691,9 @@
Uml::AssociationType type = associationType();
if (m_role[A].m_pWidget == NULL)
- setWidget(m_scene->findWidget(getWidgetID(A)), A);
+ setWidget(m_scene->findWidget(widgetIDForRole(A)), A);
if (m_role[B].m_pWidget == NULL)
- setWidget(m_scene->findWidget(getWidgetID(B)), B);
+ setWidget(m_scene->findWidget(widgetIDForRole(B)), B);
if(!m_role[A].m_pWidget || !m_role[B].m_pWidget) {
uDebug() << "Can not make association!";
@@ -1395,7 +1395,7 @@
/**
* Gets the ID of the given role widget.
*/
-Uml::IDType AssociationWidget::getWidgetID(Uml::Role_Type role) const
+Uml::IDType AssociationWidget::widgetIDForRole(Uml::Role_Type role) const
{
if (m_role[role].m_pWidget == NULL) {
if (m_pObject && m_pObject->baseType() == UMLObject::ot_Association) {
@@ -4047,8 +4047,8 @@
assocElement.setAttribute( "documentation", m_Doc );
}
}
- assocElement.setAttribute( "widgetaid", ID2STR(getWidgetID(A)) );
- assocElement.setAttribute( "widgetbid", ID2STR(getWidgetID(B)) );
+ assocElement.setAttribute( "widgetaid", ID2STR(widgetIDForRole(A)) );
+ assocElement.setAttribute( "widgetbid", ID2STR(widgetIDForRole(B)) );
assocElement.setAttribute( "indexa", m_role[A].m_nIndex );
assocElement.setAttribute( "indexb", m_role[B].m_nIndex );
assocElement.setAttribute( "totalcounta", m_role[A].m_nTotalCount );
--- trunk/KDE/kdesdk/umbrello/umbrello/widgets/associationwidget.h #1286191:1286192
@@ -134,7 +134,7 @@
Uml::Changeability changeability(Uml::Role_Type role) const;
void setChangeability(Uml::Changeability value, Uml::Role_Type role);
- Uml::IDType getWidgetID(Uml::Role_Type role) const;
+ Uml::IDType widgetIDForRole(Uml::Role_Type role) const;
UMLWidget* widgetForRole(Uml::Role_Type role) const;
bool setWidgets(UMLWidget* widgetA, Uml::AssociationType assocType, UMLWidget* widgetB);
More information about the umbrello-devel
mailing list