umbrello API Documentation

artifact.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) 2003-2006                                               *
00009  *   Umbrello UML Modeller Authors <uml-devel@uml.sf.net>                  *
00010  ***************************************************************************/
00011 
00012 #include "artifact.h"
00013 #include "association.h"
00014 #include "clipboard/idchangelog.h"
00015 #include <kdebug.h>
00016 #include <klocale.h>
00017 
00018 UMLArtifact::UMLArtifact(const QString & name, Uml::IDType id)
00019         : UMLCanvasObject(name, id) {
00020     init();
00021 }
00022 
00023 UMLArtifact::~UMLArtifact() {
00024 }
00025 
00026 void UMLArtifact::init() {
00027     m_BaseType = Uml::ot_Artifact;
00028     m_drawAsType = defaultDraw;
00029 }
00030 
00031 UMLObject* UMLArtifact::clone() const {
00032     UMLArtifact *clone = new UMLArtifact();
00033     UMLObject::copyInto(clone);
00034     return clone;
00035 }
00036 
00037 void UMLArtifact::saveToXMI(QDomDocument& qDoc, QDomElement& qElement) {
00038     QDomElement artifactElement = UMLObject::save("UML:Artifact", qDoc);
00039     artifactElement.setAttribute("drawas", m_drawAsType);
00040     qElement.appendChild(artifactElement);
00041 }
00042 
00043 bool UMLArtifact::load(QDomElement& element) {
00044     QString drawAs = element.attribute("drawas", "0");
00045     m_drawAsType = (Draw_Type)drawAs.toInt();
00046     return true;
00047 }
00048 
00049 void UMLArtifact::setDrawAsType(Draw_Type type) {
00050     m_drawAsType = type;
00051 }
00052 
00053 UMLArtifact::Draw_Type UMLArtifact::getDrawAsType() {
00054     return m_drawAsType;
00055 }
00056 
00057 #include "artifact.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:54 2007 by doxygen 1.4.1 written by Dimitri van Heesch, © 1997-2003