• Skip to content
  • Skip to link menu
KDE API Reference
  • KDE API Reference
  • kdesdk API Reference
  • KDE Home
  • Contact Us
 

umbrello/umbrello

  • sources
  • kde-4.12
  • kdesdk
  • umbrello
  • umbrello
  • cmds
  • widget
cmd_changeMultiplicity.cpp
Go to the documentation of this file.
1 /***************************************************************************
2  * This program is free software; you can redistribute it and/or modify *
3  * it under the terms of the GNU General Public License as published by *
4  * the Free Software Foundation; either version 2 of the License, or *
5  * (at your option) any later version. *
6  * *
7  * copyright (C) 2002-2013 *
8  * Umbrello UML Modeller Authors <umbrello-devel@kde.org> *
9  ***************************************************************************/
10 
11  /* Created by Bouchikhi Mohamed-Amine */
12 
13 #include "cmd_changeMultiplicity.h"
14 
15 // app includes
16 #include "umlrole.h"
17 
18 // kde includes
19 #include <klocale.h>
20 
21 namespace Uml
22 {
23  CmdChangeMultiplicity::CmdChangeMultiplicity(UMLRole *role, const QString &multi)
24  : m_umlRole(role), m_newMulti(multi)
25  {
26  setText(i18n("Change multiplicity : %1 to %2", role->name(), multi));
27  m_oldMulti = m_umlRole->multiplicity();
28  }
29 
30  void CmdChangeMultiplicity::undo()
31  {
32  if (!m_oldMulti.isEmpty()) {
33  m_umlRole->setMultiplicity(m_oldMulti);
34  }
35  else {
36  m_umlRole->setMultiplicity("");
37  }
38  }
39 
40  void CmdChangeMultiplicity::redo()
41  {
42  m_umlRole->setMultiplicity(m_newMulti);
43  }
44 }
45 
46 /* line to add the commande in the undo/redo list :
47 UMLApp::app()->executeCommand(new CmdChangeMulti(UMLRole role, QString newMulti));
48 */
UMLRole::multiplicity
QString multiplicity() const
Returns the multiplicity assigned to the role.
Definition: umlrole.cpp:96
Uml::CmdChangeMultiplicity::redo
void redo()
Definition: cmd_changeMultiplicity.cpp:40
umlrole.h
Uml::CmdChangeMultiplicity::undo
void undo()
Definition: cmd_changeMultiplicity.cpp:30
UMLRole
This class contains the non-graphic representation of an association role.
Definition: umlrole.h:24
UMLRole::setMultiplicity
void setMultiplicity(const QString &multi)
Sets the multiplicity of the role.
Definition: umlrole.cpp:139
Uml::CmdChangeMultiplicity::CmdChangeMultiplicity
CmdChangeMultiplicity(UMLRole *role, const QString &multi)
Definition: cmd_changeMultiplicity.cpp:23
UMLObject::name
QString name() const
Returns a copy of m_name.
Definition: umlobject.cpp:185
cmd_changeMultiplicity.h
This file is part of the KDE documentation.
Documentation copyright © 1996-2014 The KDE developers.
Generated on Tue Oct 14 2014 23:05:59 by doxygen 1.8.7 written by Dimitri van Heesch, © 1997-2006

KDE's Doxygen guidelines are available online.

umbrello/umbrello

Skip menu "umbrello/umbrello"
  • Main Page
  • Namespace List
  • Namespace Members
  • Alphabetical List
  • Class List
  • Class Hierarchy
  • Class Members
  • File List
  • File Members
  • Modules
  • Related Pages

kdesdk API Reference

Skip menu "kdesdk API Reference"
  • kapptemplate
  • kcachegrind
  • kompare
  • lokalize
  • okteta
  • umbrello
  •   umbrello

Search



Report problems with this website to our bug tracking system.
Contact the specific authors with questions and comments about the page contents.

KDE® and the K Desktop Environment® logo are registered trademarks of KDE e.V. | Legal