summaryrefslogtreecommitdiffstats
path: root/umbrello/umbrello/ownedhierarchicalcodeblock.cpp
diff options
context:
space:
mode:
authortoma <toma@283d02a7-25f6-0310-bc7c-ecb5cbfe19da>2009-11-25 17:56:58 +0000
committertoma <toma@283d02a7-25f6-0310-bc7c-ecb5cbfe19da>2009-11-25 17:56:58 +0000
commitbd9e6617827818fd043452c08c606f07b78014a0 (patch)
tree425bb4c3168f9c02f10150f235d2cb998dcc6108 /umbrello/umbrello/ownedhierarchicalcodeblock.cpp
downloadtdesdk-bd9e6617827818fd043452c08c606f07b78014a0.tar.gz
tdesdk-bd9e6617827818fd043452c08c606f07b78014a0.zip
Copy the KDE 3.5 branch to branches/trinity for new KDE 3.5 features.
BUG:215923 git-svn-id: svn://anonsvn.kde.org/home/kde/branches/trinity/kdesdk@1054174 283d02a7-25f6-0310-bc7c-ecb5cbfe19da
Diffstat (limited to 'umbrello/umbrello/ownedhierarchicalcodeblock.cpp')
-rw-r--r--umbrello/umbrello/ownedhierarchicalcodeblock.cpp113
1 files changed, 113 insertions, 0 deletions
diff --git a/umbrello/umbrello/ownedhierarchicalcodeblock.cpp b/umbrello/umbrello/ownedhierarchicalcodeblock.cpp
new file mode 100644
index 00000000..bb2b38ad
--- /dev/null
+++ b/umbrello/umbrello/ownedhierarchicalcodeblock.cpp
@@ -0,0 +1,113 @@
+/***************************************************************************
+ * *
+ * This program is free software; you can redistribute it and/or modify *
+ * it under the terms of the GNU General Public License as published by *
+ * the Free Software Foundation; either version 2 of the License, or *
+ * (at your option) any later version. *
+ * *
+ * copyright (C) 2004-2007 *
+ * Umbrello UML Modeller Authors <uml-devel@uml.sf.net> *
+ ***************************************************************************/
+
+/* This code generated by:
+ * Author : thomas
+ * Date : Fri Aug 07 2003
+ */
+
+// own header
+#include "ownedhierarchicalcodeblock.h"
+
+// qt/kde includes
+#include <kdebug.h>
+
+// local includes
+#include "association.h"
+#include "umldoc.h"
+#include "umlobject.h"
+#include "umlrole.h"
+#include "codedocument.h"
+#include "codegenerator.h"
+
+// Constructors/Destructors
+//
+
+OwnedHierarchicalCodeBlock::OwnedHierarchicalCodeBlock ( UMLObject *parent, CodeDocument * doc, const QString &start, const QString &end, const QString &comment)
+ : HierarchicalCodeBlock ( doc, start, end, comment), OwnedCodeBlock(parent)
+{
+
+}
+
+OwnedHierarchicalCodeBlock::~OwnedHierarchicalCodeBlock ( ) { }
+
+//
+// Methods
+//
+
+
+// Accessor methods
+//
+
+// Other methods
+//
+
+void OwnedHierarchicalCodeBlock::release () {
+ OwnedCodeBlock::release();
+ HierarchicalCodeBlock::release();
+}
+
+void OwnedHierarchicalCodeBlock::setAttributesFromObject (TextBlock * obj) {
+
+ HierarchicalCodeBlock::setAttributesFromObject(obj);
+ OwnedCodeBlock::setAttributesFromObject(obj);
+}
+
+void OwnedHierarchicalCodeBlock::setAttributesOnNode (QDomDocument & doc, QDomElement & elem ) {
+
+ // set super-class attributes
+ HierarchicalCodeBlock::setAttributesOnNode(doc, elem);
+ OwnedCodeBlock::setAttributesOnNode(doc, elem);
+
+ // set local class attributes
+ elem.setAttribute("parent_id",ID2STR(getParentObject()->getID()));
+
+ // setting ID's takes special treatment
+ // as UMLRoles arent properly stored in the XMI right now.
+ // (change would break the XMI format..save for big version change )
+ UMLRole * role = dynamic_cast<UMLRole*>(getParentObject());
+ if(role) {
+ // see comment on role_id at OwnedCodeBlock::setAttributesOnNode()
+ elem.setAttribute("role_id", (role->getRole() == Uml::A));
+ }
+ /* else
+ elem.setAttribute("role_id","-1");
+ */
+}
+
+/** set the class attributes of this object from
+ * the passed element node.
+ */
+void OwnedHierarchicalCodeBlock::setAttributesFromNode ( QDomElement & root)
+{
+
+ // set attributes from the XMI
+ HierarchicalCodeBlock::setAttributesFromNode(root); // superclass load
+ OwnedCodeBlock::setAttributesFromNode(root); // superclass load
+
+}
+
+CodeDocument * OwnedHierarchicalCodeBlock::getParentDocument() {
+ return TextBlock::getParentDocument();
+}
+
+/**
+ */
+void OwnedHierarchicalCodeBlock::syncToParent ( ) {
+
+ if(getContentType() != CodeBlock::AutoGenerated)
+ return;
+
+ updateContent();
+}
+
+
+#include "ownedhierarchicalcodeblock.moc"