umlroleproperties.cpp
00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013 #include "umlroleproperties.h"
00014
00015
00016 #include <qradiobutton.h>
00017 #include <qtextedit.h>
00018 #include <qlineedit.h>
00019 #include <klocale.h>
00020 #include <kmessagebox.h>
00021 #include <kdebug.h>
00022
00023
00024 UMLRoleProperties::UMLRoleProperties ( QWidget *parent, UMLRole *role)
00025 : UMLRolePropertiesBase (parent)
00026 {
00027
00028 m_pRole = role;
00029 constructWidget();
00030
00031 }
00032
00033 UMLRoleProperties::~UMLRoleProperties() { }
00034
00035 void UMLRoleProperties::constructWidget() {
00036
00037
00038
00039
00040
00041 m_pRoleLE -> setText(m_pRole->getName());
00042
00043
00044 m_pMultiLE -> setText(m_pRole->getMultiplicity());
00045
00046
00047 Uml::Visibility scope = m_pRole->getVisibility();
00048 if( scope == Uml::Visibility::Public )
00049 m_pPublicRB -> setChecked( true );
00050 else if( scope == Uml::Visibility::Private )
00051 m_pPrivateRB -> setChecked( true );
00052 else if( scope == Uml::Visibility::Protected )
00053 m_pProtectedRB -> setChecked( true );
00054 else if( scope == Uml::Visibility::Implementation )
00055 m_pImplementationRB -> setChecked( true );
00056
00057
00058 Uml::Changeability_Type changeability = m_pRole->getChangeability();
00059 if( changeability == Uml::chg_Changeable )
00060 m_pChangeableRB -> setChecked( true );
00061 else if( changeability == Uml::chg_Frozen )
00062 m_pFrozenRB -> setChecked( true );
00063 else
00064 m_pAddOnlyRB -> setChecked( true );
00065
00066
00067
00068 m_pDocTE-> setText(m_pRole-> getDoc());
00069
00070 }
00071
00072 void UMLRoleProperties::updateObject() {
00073
00074 if(m_pRole) {
00075
00076
00077
00078
00079
00080
00081 m_pRole->blockSignals(true);
00082
00083
00084 m_pRole->setName(m_pRoleLE->text());
00085 m_pRole->setMultiplicity(m_pMultiLE->text());
00086
00087 if(m_pPrivateRB->isChecked())
00088 m_pRole->setVisibility(Uml::Visibility::Private);
00089 else if(m_pProtectedRB->isChecked())
00090 m_pRole->setVisibility(Uml::Visibility::Protected);
00091 else if(m_pPublicRB->isChecked())
00092 m_pRole->setVisibility(Uml::Visibility::Public);
00093 else if(m_pImplementationRB->isChecked())
00094 m_pRole->setVisibility(Uml::Visibility::Implementation);
00095
00096 if(m_pFrozenRB->isChecked())
00097 m_pRole->setChangeability(Uml::chg_Frozen);
00098 else if(m_pAddOnlyRB->isChecked())
00099 m_pRole->setChangeability(Uml::chg_AddOnly);
00100 else
00101 m_pRole->setChangeability(Uml::chg_Changeable);
00102
00103 m_pRole->setDoc(m_pDocTE->text());
00104
00105 m_pRole->blockSignals(false);
00106
00107 m_pRole->emitModified();
00108
00109 }
00110
00111 }
00112
00113
00114 #include "umlroleproperties.moc"
This file is part of the documentation for umbrello Version 3.1.0.