[Uml-devel] KDE/kdesdk/umbrello/umbrello
Andi Fischer
andi.fischer at hispeed.ch
Thu Mar 15 20:54:52 UTC 2012
SVN commit 1285794 by fischer:
Rename some getters in associationwidget by removing the get.
M +1 -1 layoutgenerator.h
M +13 -13 umlview.cpp
M +12 -13 widgets/associationwidget.cpp
M +6 -7 widgets/associationwidget.h
--- trunk/KDE/kdesdk/umbrello/umbrello/layoutgenerator.h #1285793:1285794
@@ -229,7 +229,7 @@
// set label position
QPointF &l = m_edgeLabelPosition[id];
- FloatingTextWidget *tw = assoc->getNameWidget();
+ FloatingTextWidget *tw = assoc->nameWidget();
if (tw) {
tw->setX((int)(l.x() + m_origin.x()));
tw->setY(int(m_boundingRect.height() - l.y() + m_origin.y()));
--- trunk/KDE/kdesdk/umbrello/umbrello/umlview.cpp #1285793:1285794
@@ -1301,10 +1301,10 @@
makeSelected(a->widgetForRole(A));
makeSelected(a->widgetForRole(B));
//select all the text
- makeSelected(a->getMultiWidget(A));
- makeSelected(a->getMultiWidget(B));
- makeSelected(a->getRoleWidget(A));
- makeSelected(a->getRoleWidget(B));
+ makeSelected(a->multiplicityWidget(A));
+ makeSelected(a->multiplicityWidget(B));
+ makeSelected(a->roleWidget(A));
+ makeSelected(a->roleWidget(B));
makeSelected(a->getChangeWidget(A));
makeSelected(a->getChangeWidget(B));
}
@@ -1845,11 +1845,11 @@
m_AssociationList.append(pAssoc);
- FloatingTextWidget *ft[5] = { pAssoc->getNameWidget(),
- pAssoc->getRoleWidget(A),
- pAssoc->getRoleWidget(B),
- pAssoc->getMultiWidget(A),
- pAssoc->getMultiWidget(B)
+ FloatingTextWidget *ft[5] = { pAssoc->nameWidget(),
+ pAssoc->roleWidget(A),
+ pAssoc->roleWidget(B),
+ pAssoc->multiplicityWidget(A),
+ pAssoc->multiplicityWidget(B)
};
for (int i = 0; i < 5; i++) {
FloatingTextWidget *flotxt = ft[i];
@@ -2539,10 +2539,10 @@
foreach(AssociationWidget *a , m_AssociationList) {
if (! a->getSelected())
continue;
- const FloatingTextWidget* multiA = const_cast<FloatingTextWidget*>(a->getMultiWidget(A));
- const FloatingTextWidget* multiB = const_cast<FloatingTextWidget*>(a->getMultiWidget(B));
- const FloatingTextWidget* roleA = const_cast<FloatingTextWidget*>(a->getRoleWidget(A));
- const FloatingTextWidget* roleB = const_cast<FloatingTextWidget*>(a->getRoleWidget(B));
+ const FloatingTextWidget* multiA = const_cast<FloatingTextWidget*>(a->multiplicityWidget(A));
+ 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));
findMaxBoundingRectangle(multiA, px, py, qx, qy);
--- trunk/KDE/kdesdk/umbrello/umbrello/widgets/associationwidget.cpp #1285793:1285794
@@ -791,7 +791,7 @@
*
* @return Pointer to the multiplicity FloatingTextWidget object.
*/
-FloatingTextWidget* AssociationWidget::getMultiWidget(Uml::Role_Type role)
+FloatingTextWidget* AssociationWidget::multiplicityWidget(Uml::Role_Type role) const
{
return m_role[role].m_pMulti;
}
@@ -801,7 +801,7 @@
*
* @return Pointer to the FloatingTextWidget name widget.
*/
-FloatingTextWidget* AssociationWidget::getNameWidget()
+FloatingTextWidget* AssociationWidget::nameWidget() const
{
return m_pName;
}
@@ -811,7 +811,7 @@
*
* @return Pointer to the role's FloatingTextWidget widget.
*/
-FloatingTextWidget* AssociationWidget::getRoleWidget(Uml::Role_Type role)
+FloatingTextWidget* AssociationWidget::roleWidget(Uml::Role_Type role) const
{
return m_role[role].m_pRole;
}
@@ -829,7 +829,7 @@
*
* @return Pointer to the text role's FloatingTextWidget widget.
*/
-FloatingTextWidget* AssociationWidget::getTextWidgetByRole(Uml::TextRole tr)
+FloatingTextWidget* AssociationWidget::textWidgetByRole(Uml::TextRole tr) const
{
switch (tr) {
case Uml::TextRole::MultiA:
@@ -1788,15 +1788,15 @@
//uml->init();
// floating text widgets
- FloatingTextWidget *text = getNameWidget();
+ FloatingTextWidget *text = nameWidget();
if (text)
m_pObject->setName(text->text());
- text = getRoleWidget(A);
+ text = roleWidget(A);
if (text && umlassoc)
umlassoc->setRoleName(text->text(), A);
- text = getRoleWidget(B);
+ text = roleWidget(B);
if (text) {
if (umlassoc)
umlassoc->setRoleName(text->text(), B);
@@ -1804,11 +1804,11 @@
umlattr->setName(text->text());
}
- text = getMultiWidget(A);
+ text = multiplicityWidget(A);
if (text && umlassoc)
umlassoc->setMulti(text->text(), A);
- text = getMultiWidget(B);
+ text = multiplicityWidget(B);
if (text && umlassoc)
umlassoc->setMulti(text->text(), B);
@@ -2405,7 +2405,7 @@
return QPoint(-1, -1);
}
- FloatingTextWidget *text = getTextWidgetByRole(role);
+ FloatingTextWidget *text = textWidgetByRole(role);
int textW = 0, textH = 0;
if (text) {
textW = text->width();
@@ -2656,7 +2656,7 @@
if (startMove) {
return;
}
- FloatingTextWidget *ft = getTextWidgetByRole(role);
+ FloatingTextWidget *ft = textWidgetByRole(role);
if (ft == NULL)
return;
QPoint pos = calculateTextPosition(role);
@@ -2698,7 +2698,7 @@
if (startMove) {
return;
}
- FloatingTextWidget *ft = getTextWidgetByRole(role);
+ FloatingTextWidget *ft = textWidgetByRole(role);
if (ft == NULL)
return;
int ftX = ft->getX();
@@ -4340,5 +4340,4 @@
return loadFromXMI( qElement, m_scene->getWidgetList(), &messages );
}
-
#include "associationwidget.moc"
--- trunk/KDE/kdesdk/umbrello/umbrello/widgets/associationwidget.h #1285793:1285794
@@ -108,18 +108,20 @@
void setWidget(UMLWidget* widget, Uml::Role_Type role);
- FloatingTextWidget* getMultiWidget(Uml::Role_Type role);
- FloatingTextWidget* getNameWidget();
- FloatingTextWidget* getRoleWidget(Uml::Role_Type role);
- FloatingTextWidget* getTextWidgetByRole(Uml::TextRole tr);
+ FloatingTextWidget* textWidgetByRole(Uml::TextRole tr) 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);
+
QString roleDocumentation(Uml::Role_Type role) const;
+ void setRoleDocumentation(const QString &doc, Uml::Role_Type role);
+ FloatingTextWidget* multiplicityWidget(Uml::Role_Type role) const;
QString multiplicity(Uml::Role_Type role) const;
void setMultiplicity(const QString &strMulti, Uml::Role_Type role);
@@ -141,7 +143,6 @@
bool isCollaboration();
Uml::AssociationType associationType() const;
-
void setAssociationType(Uml::AssociationType type);
QString toString();
@@ -201,8 +202,6 @@
FloatingTextWidget* getChangeWidget(Uml::Role_Type role);
- void setRoleDocumentation(const QString &doc, Uml::Role_Type role);
-
void constrainTextPos(int &textX, int &textY, int textWidth, int textHeight,
Uml::TextRole tr);
More information about the umbrello-devel
mailing list