[Uml-devel] KDE/kdesdk/umbrello/umbrello
Andi Fischer
andi.fischer at hispeed.ch
Thu Dec 13 08:49:12 UTC 2007
SVN commit 747970 by fischer:
Some code and documentation format changes.
M +26 -35 codeaccessormethod.cpp
M +19 -19 codeaccessormethod.h
--- trunk/KDE/kdesdk/umbrello/umbrello/codeaccessormethod.cpp #747969:747970
@@ -27,34 +27,27 @@
#include "umlobject.h"
#include "umlrole.h"
-// Constructors/Destructors
-//
-
CodeAccessorMethod::CodeAccessorMethod ( CodeClassField * parentCF )
: CodeMethodBlock ( parentCF->getParentDocument(), parentCF->getParentObject() )
{
initFields(parentCF);
}
-CodeAccessorMethod::~CodeAccessorMethod ( ) { }
+CodeAccessorMethod::~CodeAccessorMethod ( )
+{
+}
-//
-// Methods
-//
-
-
-// Accessor methods
-//
-
/**
* Get the value of m_parentclassfield
* @return the value of m_parentclassfield
*/
-CodeClassField * CodeAccessorMethod::getParentClassField ( ) {
+CodeClassField * CodeAccessorMethod::getParentClassField ( )
+{
return m_parentclassfield;
}
-bool CodeAccessorMethod::parentIsAttribute( ) {
+bool CodeAccessorMethod::parentIsAttribute( )
+{
return getParentClassField()->parentIsAttribute();
}
@@ -63,37 +56,38 @@
* @return the value of the parent of the parent classfield
*/
/*
-UMLObject * CodeAccessorMethod::getParentObject ( ) {
+UMLObject * CodeAccessorMethod::getParentObject ( )
+{
return getParentClassField()->getParentObject();
}
*/
/** return the type of accessor method this is
*/
-CodeAccessorMethod::AccessorType CodeAccessorMethod::getType( ) {
+CodeAccessorMethod::AccessorType CodeAccessorMethod::getType( )
+{
return m_accessorType;
}
/** Set the type of accessor method this is
*/
-void CodeAccessorMethod::setType ( CodeAccessorMethod::AccessorType atype) {
+void CodeAccessorMethod::setType ( CodeAccessorMethod::AccessorType atype)
+{
m_accessorType = atype;
}
-// Other methods
-//
-
-
// this type of textblock is special
// we DON'T release it when resetTextBlocks is
// called because we re-use it over and over
// until the codeclassfield is released.
-void CodeAccessorMethod::release () {
+void CodeAccessorMethod::release ()
+{
// do nothing
}
// ok, a method so the parent can force it to release
-void CodeAccessorMethod::forceRelease () {
+void CodeAccessorMethod::forceRelease ()
+{
if(m_parentclassfield)
m_parentclassfield->disconnect(this);
CodeMethodBlock::release();
@@ -102,14 +96,16 @@
/**
* load params from the appropriate XMI element node.
*/
-void CodeAccessorMethod::loadFromXMI ( QDomElement & root ) {
+void CodeAccessorMethod::loadFromXMI ( QDomElement & root )
+{
setAttributesFromNode(root);
}
/**
* Save the XMI representation of this object
*/
-void CodeAccessorMethod::saveToXMI ( QDomDocument & doc, QDomElement & root ) {
+void CodeAccessorMethod::saveToXMI ( QDomDocument & doc, QDomElement & root )
+{
QDomElement docElement = doc.createElement( "codeaccessormethod" );
setAttributesOnNode(doc, docElement);
@@ -122,21 +118,19 @@
*/
void CodeAccessorMethod::setAttributesOnNode ( QDomDocument & doc, QDomElement & elem)
{
-
// set super-class attributes
CodeMethodBlock::setAttributesOnNode(doc, elem);
// set local class attributes
elem.setAttribute("accessType",getType());
elem.setAttribute("classfield_id",getParentClassField()->getID());
-
}
/** set the class attributes of this object from
* the passed element node.
*/
-void CodeAccessorMethod::setAttributesFromNode ( QDomElement & root) {
-
+void CodeAccessorMethod::setAttributesFromNode ( QDomElement & root)
+{
// set attributes from the XMI
CodeMethodBlock::setAttributesFromNode(root); // superclass load
@@ -163,12 +157,10 @@
*/
// now load/set other local attributes
setType((AccessorType) root.attribute("accessType","0").toInt());
-
}
void CodeAccessorMethod::setAttributesFromObject(TextBlock * obj)
{
-
CodeMethodBlock::setAttributesFromObject(obj);
CodeAccessorMethod * mb = dynamic_cast<CodeAccessorMethod*>(obj);
@@ -180,14 +172,13 @@
setType(mb->getType());
}
-
}
-void CodeAccessorMethod::initFields(CodeClassField * parentClassField ) {
-
+void CodeAccessorMethod::initFields(CodeClassField * parentClassField )
+{
m_parentclassfield = parentClassField;
m_accessorType = GET;
- m_canDelete = false; // we cant delete these with the codeeditor, delete the UML operation instead.
+ setCanDelete(false); // we cant delete these with the codeeditor, delete the UML operation instead.
connect(m_parentclassfield,SIGNAL(modified()),this,SLOT(syncToParent()));
}
--- trunk/KDE/kdesdk/umbrello/umbrello/codeaccessormethod.h #747969:747970
@@ -13,12 +13,10 @@
* Date : Tue Jul 1 2003
*/
-
-
#ifndef CODEACCESSORMETHOD_H
#define CODEACCESSORMETHOD_H
-#include <qstring.h>
+#include <QtCore/QString>
#include "codemethodblock.h"
class CodeClassField;
@@ -37,10 +35,6 @@
// "LIST" is to retrive the entire list of items in a multiple-valued field
enum AccessorType {GET=0, SET, ADD, REMOVE, LIST};
- // Constructors/Destructors
- //
-
-
/**
* Constructors
*/
@@ -57,16 +51,19 @@
*/
CodeClassField * getParentClassField ( );
- /** return the type of accessor method this is
- */
+ /**
+ * Return the type of accessor method this is.
+ */
AccessorType getType( );
- /** Set the type of accessor method this is
+ /**
+ * Set the type of accessor method this is.
*/
void setType ( AccessorType type);
- /** Utility method to get the value of the parent object of the parent classifield.
- */
+ /**
+ * Utility method to get the value of the parent object of the parent classifield.
+ */
// virtual UMLObject * getParentObject();
bool parentIsAttribute();
@@ -74,16 +71,17 @@
virtual void updateContent() = 0;
/**
- * Save the XMI representation of this object
+ * Save the XMI representation of this object.
*/
virtual void saveToXMI ( QDomDocument & doc, QDomElement & root );
/**
- * load params from the appropriate XMI element node.
+ * Load params from the appropriate XMI element node.
*/
virtual void loadFromXMI ( QDomElement & root );
- /** set the class attributes from a passed object
+ /**
+ * Set the class attributes from a passed object.
*/
virtual void setAttributesFromObject (TextBlock * obj);
@@ -91,12 +89,14 @@
virtual void release ();
- /** set attributes of the node that represents this class
- * in the XMI document.
- */
+ /**
+ * Set attributes of the node that represents this class
+ * in the XMI document.
+ */
virtual void setAttributesOnNode ( QDomDocument & doc, QDomElement & blockElement);
- /** set the class attributes of this object from
+ /**
+ * Set the class attributes of this object from
* the passed element node.
*/
virtual void setAttributesFromNode ( QDomElement & element);
More information about the umbrello-devel
mailing list