umbrello API Documentation

ownedhierarchicalcodeblock.cpp

00001 /***************************************************************************
00002  *                                                                         *
00003  *   This program is free software; you can redistribute it and/or modify  *
00004  *   it under the terms of the GNU General Public License as published by  *
00005  *   the Free Software Foundation; either version 2 of the License, or     *
00006  *   (at your option) any later version.                                   *
00007  *                                                                         *
00008  *   copyright (C) 2004-2007                                               *
00009  *   Umbrello UML Modeller Authors <uml-devel@uml.sf.net>                  *
00010  ***************************************************************************/
00011 
00012 /*  This code generated by:
00013  *      Author : thomas
00014  *      Date   : Fri Aug 07 2003
00015  */
00016 
00017 // own header
00018 #include "ownedhierarchicalcodeblock.h"
00019 
00020 // qt/kde includes
00021 #include <kdebug.h>
00022 
00023 // local includes
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 // Constructors/Destructors
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 // Methods
00044 //
00045 
00046 
00047 // Accessor methods
00048 //
00049 
00050 // Other methods
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     // set super-class attributes
00067     HierarchicalCodeBlock::setAttributesOnNode(doc, elem);
00068     OwnedCodeBlock::setAttributesOnNode(doc, elem);
00069 
00070     // set local class attributes
00071     elem.setAttribute("parent_id",ID2STR(getParentObject()->getID()));
00072 
00073     // setting ID's takes special treatment
00074     // as UMLRoles arent properly stored in the XMI right now.
00075     // (change would break the XMI format..save for big version change )
00076     UMLRole * role = dynamic_cast<UMLRole*>(getParentObject());
00077     if(role) {
00078         // see comment on role_id at OwnedCodeBlock::setAttributesOnNode()
00079         elem.setAttribute("role_id", (role->getRole() == Uml::A));
00080     }
00081     /* else
00082             elem.setAttribute("role_id","-1");
00083     */
00084 }
00085 
00089 void OwnedHierarchicalCodeBlock::setAttributesFromNode ( QDomElement & root)
00090 {
00091 
00092     // set attributes from the XMI
00093     HierarchicalCodeBlock::setAttributesFromNode(root); // superclass load
00094     OwnedCodeBlock::setAttributesFromNode(root); // superclass load
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"
KDE Logo
This file is part of the documentation for umbrello Version 3.1.0.
Documentation copyright © 1996-2004 the KDE developers.
Generated on Tue Jun 26 08:07:58 2007 by doxygen 1.4.1 written by Dimitri van Heesch, © 1997-2003