ownedhierarchicalcodeblock.cpp
00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018 #include "ownedhierarchicalcodeblock.h"
00019
00020
00021 #include <kdebug.h>
00022
00023
00024 #include "association.h"
00025 #include "umldoc.h"
00026 #include "umlobject.h"
00027 #include "umlrole.h"
00028 #include "codedocument.h"
00029 #include "codegenerator.h"
00030
00031
00032
00033
00034 OwnedHierarchicalCodeBlock::OwnedHierarchicalCodeBlock ( UMLObject *parent, CodeDocument * doc, const QString &start, const QString &end, const QString &comment)
00035 : HierarchicalCodeBlock ( doc, start, end, comment), OwnedCodeBlock(parent)
00036 {
00037
00038 }
00039
00040 OwnedHierarchicalCodeBlock::~OwnedHierarchicalCodeBlock ( ) { }
00041
00042
00043
00044
00045
00046
00047
00048
00049
00050
00051
00052
00053 void OwnedHierarchicalCodeBlock::release () {
00054 OwnedCodeBlock::release();
00055 HierarchicalCodeBlock::release();
00056 }
00057
00058 void OwnedHierarchicalCodeBlock::setAttributesFromObject (TextBlock * obj) {
00059
00060 HierarchicalCodeBlock::setAttributesFromObject(obj);
00061 OwnedCodeBlock::setAttributesFromObject(obj);
00062 }
00063
00064 void OwnedHierarchicalCodeBlock::setAttributesOnNode (QDomDocument & doc, QDomElement & elem ) {
00065
00066
00067 HierarchicalCodeBlock::setAttributesOnNode(doc, elem);
00068 OwnedCodeBlock::setAttributesOnNode(doc, elem);
00069
00070
00071 elem.setAttribute("parent_id",ID2STR(getParentObject()->getID()));
00072
00073
00074
00075
00076 UMLRole * role = dynamic_cast<UMLRole*>(getParentObject());
00077 if(role) {
00078
00079 elem.setAttribute("role_id", (role->getRole() == Uml::A));
00080 }
00081
00082
00083
00084 }
00085
00089 void OwnedHierarchicalCodeBlock::setAttributesFromNode ( QDomElement & root)
00090 {
00091
00092
00093 HierarchicalCodeBlock::setAttributesFromNode(root);
00094 OwnedCodeBlock::setAttributesFromNode(root);
00095
00096 }
00097
00098 CodeDocument * OwnedHierarchicalCodeBlock::getParentDocument() {
00099 return TextBlock::getParentDocument();
00100 }
00101
00104 void OwnedHierarchicalCodeBlock::syncToParent ( ) {
00105
00106 if(getContentType() != CodeBlock::AutoGenerated)
00107 return;
00108
00109 updateContent();
00110 }
00111
00112
00113 #include "ownedhierarchicalcodeblock.moc"
This file is part of the documentation for umbrello Version 3.1.0.