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

umbrello/umbrello

ownedhierarchicalcodeblock.cpp

Go to the documentation of this file.
00001 /***************************************************************************
00002  *   This program is free software; you can redistribute it and/or modify  *
00003  *   it under the terms of the GNU General Public License as published by  *
00004  *   the Free Software Foundation; either version 2 of the License, or     *
00005  *   (at your option) any later version.                                   *
00006  *                                                                         *
00007  *   copyright (C) 2003      Brian Thomas <thomas@mail630.gsfc.nasa.gov>   *
00008  *   copyright (C) 2004-2008                                               *
00009  *   Umbrello UML Modeller Authors <uml-devel@uml.sf.net>                  *
00010  ***************************************************************************/
00011 
00012 // own header
00013 #include "ownedhierarchicalcodeblock.h"
00014 
00015 // local includes
00016 #include "association.h"
00017 #include "umldoc.h"
00018 #include "umlobject.h"
00019 #include "umlrole.h"
00020 #include "codedocument.h"
00021 #include "codegenerator.h"
00022 
00023 // kde includes
00024 #include <kdebug.h>
00025 
00026 OwnedHierarchicalCodeBlock::OwnedHierarchicalCodeBlock ( UMLObject *parent, CodeDocument * doc, const QString &start, const QString &end, const QString &comment)
00027         : OwnedCodeBlock(parent), HierarchicalCodeBlock ( doc, start, end, comment)
00028 {
00029 }
00030 
00031 OwnedHierarchicalCodeBlock::~OwnedHierarchicalCodeBlock ( )
00032 {
00033 }
00034 
00040 void OwnedHierarchicalCodeBlock::release ()
00041 {
00042     OwnedCodeBlock::release();
00043     HierarchicalCodeBlock::release();
00044 }
00045 
00049 void OwnedHierarchicalCodeBlock::setAttributesFromObject (TextBlock * obj)
00050 {
00051     HierarchicalCodeBlock::setAttributesFromObject(obj);
00052     OwnedCodeBlock::setAttributesFromObject(obj);
00053 }
00054 
00059 void OwnedHierarchicalCodeBlock::setAttributesOnNode (QDomDocument & doc, QDomElement & elem )
00060 {
00061     // set super-class attributes
00062     HierarchicalCodeBlock::setAttributesOnNode(doc, elem);
00063     OwnedCodeBlock::setAttributesOnNode(doc, elem);
00064 
00065     // set local class attributes
00066     elem.setAttribute("parent_id",ID2STR(getParentObject()->getID()));
00067 
00068     // setting ID's takes special treatment
00069     // as UMLRoles arent properly stored in the XMI right now.
00070     // (change would break the XMI format..save for big version change )
00071     UMLRole * role = dynamic_cast<UMLRole*>(getParentObject());
00072     if(role) {
00073         // see comment on role_id at OwnedCodeBlock::setAttributesOnNode()
00074         elem.setAttribute("role_id", (role->getRole() == Uml::A));
00075     }
00076     /* else
00077             elem.setAttribute("role_id","-1");
00078     */
00079 }
00080 
00085 void OwnedHierarchicalCodeBlock::setAttributesFromNode ( QDomElement & root)
00086 {
00087     // set attributes from the XMI
00088     HierarchicalCodeBlock::setAttributesFromNode(root); // superclass load
00089     OwnedCodeBlock::setAttributesFromNode(root); // superclass load
00090 }
00091 
00095 CodeDocument * OwnedHierarchicalCodeBlock::getParentDocument()
00096 {
00097 
00101     return TextBlock::getParentDocument();
00102 }
00103 
00104 void OwnedHierarchicalCodeBlock::syncToParent ( )
00105 {
00106     if(getContentType() != CodeBlock::AutoGenerated)
00107         return;
00108 
00109     updateContent();
00110 }
00111 
00112 
00113 #include "ownedhierarchicalcodeblock.moc"

umbrello/umbrello

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

kdesdk

Skip menu "kdesdk"
  • kapptemplate
  • kate
  •     kate
  • kbugbuster
  • kcachegrind
  • kompare
  • lokalize
  • umbrello
  •   umbrello
Generated for kdesdk by doxygen 1.5.9-20090814
This website is maintained by Adriaan de Groot and Allen Winter.
KDE® and the K Desktop Environment® logo are registered trademarks of KDE e.V. | Legal