~ubuntu-branches/ubuntu/intrepid/tcm/intrepid

« back to all changes in this revision

Viewing changes to src/sd/dv/esddiagram.h

  • Committer: Bazaar Package Importer
  • Author(s): Otavio Salvador
  • Date: 2003-07-03 20:08:21 UTC
  • Revision ID: james.westby@ubuntu.com-20030703200821-se4xtqx25e5miczi
Tags: upstream-2.20
ImportĀ upstreamĀ versionĀ 2.20

Show diffs side-by-side

added added

removed removed

Lines of Context:
 
1
//------------------------------------------------------------------------------
 
2
//
 
3
// This file is part of Toolkit for Conceptual Modeling (TCM).
 
4
// (c) copyright 1999, Vrije Universiteit Amsterdam and University of Twente.
 
5
// Author: Frank Dehne (frank@cs.vu.nl).
 
6
// Author: Henk van de Zandschulp (henkz@cs.utwente.nl).
 
7
//
 
8
// TCM is free software; you can redistribute it and/or modify
 
9
// it under the terms of the GNU General Public License as published by
 
10
// the Free Software Foundation; either version 2 of the License, or
 
11
// (at your option) any later version.
 
12
//
 
13
// TCM is distributed in the hope that it will be useful,
 
14
// but WITHOUT ANY WARRANTY; without even the implied warranty of
 
15
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
 
16
// GNU General Public License for more details.
 
17
//
 
18
// You should have received a copy of the GNU General Public License
 
19
// along with TCM; if not, write to the Free Software Foundation, Inc.,
 
20
// 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
 
21
//-----------------------------------------------------------------------------
 
22
#ifndef _ESDDIAGRAM_H
 
23
#define _ESDDIAGRAM_H
 
24
 
 
25
#include "erdiagram.h"
 
26
#include "stringlistnode.h"
 
27
class SSDViewer;
 
28
class ESDWindow;
 
29
class SSDGraph;
 
30
class SSDChecks;
 
31
class SSDClassNode;
 
32
class StringListNode2;
 
33
 
 
34
/// UML static structure diagram class.
 
35
class ESDDiagram : public ERDiagram {
 
36
/*@Doc: {\large {\bf scope:} TESD} */
 
37
public:
 
38
        ///
 
39
        ESDDiagram(Config *, ESDWindow *, SSDViewer *, SSDGraph *);
 
40
        ///
 
41
        virtual ~ESDDiagram();
 
42
        ///
 
43
        Node *CreateNode();
 
44
        ///
 
45
        Edge *CreateEdge(Subject *n1, Subject *n2);
 
46
        ///
 
47
        NodeShape *CreateNodeShape(Node *node, int x, int y);
 
48
        ///
 
49
        Line *CreateLine(Edge *edge, GShape *fromShape, 
 
50
                GShape *toShape, List<Point *> *line);
 
51
        ///
 
52
        void UpdateNodeType(int n);
 
53
        ///
 
54
        void UpdateEdgeType(int n);
 
55
 
 
56
        ///
 
57
        bool SetText(TextShape *t, const string *s);
 
58
 
 
59
        /// Set Attribute in class obj at position nr.
 
60
        bool SetAttribute(StringListNode *n, const string *s, unsigned nr);
 
61
 
 
62
        /// Set nr-th role name of subject. Check name syntax. 
 
63
        bool SetRoleName(Subject *subj, const string *s, unsigned nr);
 
64
 
 
65
        /// check the soft constraints on a ESD.
 
66
        void CheckDocument();
 
67
 
 
68
protected:
 
69
        /// Give error after failing to update attribute or operation.
 
70
        void MakeErrorMessage(StringListNode *node, 
 
71
                StringListNode::StringErrorType result, 
 
72
                const string *s, string *text);
 
73
        ///
 
74
        Thing *CreateThing(int classNr);
 
75
        ///
 
76
        SSDChecks *GetSSDChecks() {return ssdChecks;}
 
77
 
 
78
        ///
 
79
        static const int MINI_ELLIPSE_WIDTH;
 
80
        ///
 
81
        static const int MINI_ELLIPSE_HEIGHT;
 
82
private:
 
83
        ///
 
84
        SSDChecks *ssdChecks;
 
85
};
 
86
#endif