summaryrefslogtreecommitdiffstats
path: root/umbrello/umbrello/artifact.cpp
blob: 8576ca8b2d139164fa90db9144c1f73694be5cc7 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
/***************************************************************************
 *                                                                         *
 *   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) 2003-2006                                               *
 *   Umbrello UML Modeller Authors <uml-devel@uml.sf.net>                  *
 ***************************************************************************/

#include "artifact.h"
#include "association.h"
#include "clipboard/idchangelog.h"
#include <kdebug.h>
#include <klocale.h>

UMLArtifact::UMLArtifact(const TQString & name, Uml::IDType id)
        : UMLCanvasObject(name, id) {
    init();
}

UMLArtifact::~UMLArtifact() {
}

void UMLArtifact::init() {
    m_BaseType = Uml::ot_Artifact;
    m_drawAsType = defaultDraw;
}

UMLObject* UMLArtifact::clone() const {
    UMLArtifact *clone = new UMLArtifact();
    UMLObject::copyInto(clone);
    return clone;
}

void UMLArtifact::saveToXMI(TQDomDocument& qDoc, TQDomElement& qElement) {
    TQDomElement artifactElement = UMLObject::save("UML:Artifact", qDoc);
    artifactElement.setAttribute("drawas", m_drawAsType);
    qElement.appendChild(artifactElement);
}

bool UMLArtifact::load(TQDomElement& element) {
    TQString drawAs = element.attribute("drawas", "0");
    m_drawAsType = (Draw_Type)drawAs.toInt();
    return true;
}

void UMLArtifact::setDrawAsType(Draw_Type type) {
    m_drawAsType = type;
}

UMLArtifact::Draw_Type UMLArtifact::getDrawAsType() {
    return m_drawAsType;
}

#include "artifact.moc"