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

« back to all changes in this revision

Viewing changes to src/sd/dv/ssdtripleclassbox.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: Henk van de Zandschulp (henkz@cs.utwente.nl).
 
6
// Author: Frank Dehne (frank@cs.vu.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 _SSDTRIPLECLASSBOX_H
 
23
#define _SSDTRIPLECLASSBOX_H
 
24
 
 
25
#include "tripleclassbox.h"
 
26
class SSDSingleClassBox;
 
27
class SSDDoubleClassBox;
 
28
 
 
29
/// A triple box used for a object class.
 
30
class SSDTripleClassBox: public TripleClassBox {
 
31
/*@Doc: {\large {\bf scope:} TSSD} */
 
32
public:
 
33
        ///
 
34
        SSDTripleClassBox(ShapeView *v, Grafport *g, int x, int y, 
 
35
                int w = TRIPLECLASSBOX_WIDTH, int h = TRIPLECLASSBOX_HEIGHT);
 
36
        ///
 
37
        SSDTripleClassBox(const SSDTripleClassBox &s);
 
38
        ///
 
39
        SSDTripleClassBox(const SSDDoubleClassBox &s);
 
40
        ///
 
41
        SSDTripleClassBox(const SSDSingleClassBox &s);
 
42
        ///
 
43
        ~SSDTripleClassBox();
 
44
        ///
 
45
        Shape *Clone() {return new SSDTripleClassBox(*this);}
 
46
        ///
 
47
        int GetClassType() const {return Code::SSD_TRIPLE_CLASS_BOX;}
 
48
 
 
49
        ///
 
50
        void SetFont(XFont *ft);
 
51
        ///
 
52
        void SetTextColor(const string *color);
 
53
        ///
 
54
        void SetGrafport(Grafport *g);
 
55
        ///
 
56
        void SetView(ShapeView *v);
 
57
        ///
 
58
        TextShape *ChooseTextShape(int x, int y);
 
59
        ///
 
60
        bool HasTextShape(TextShape *t) const;
 
61
        ///
 
62
        void AdjustSize();
 
63
 
 
64
        ///
 
65
        void UpdateShowStereotype(bool b);
 
66
        ///
 
67
        void UpdateShowProperties(bool b);
 
68
 
 
69
        /// update string of stereotype text shape and redraw.
 
70
        void UpdateStereotypeLabelString(const string *s);
 
71
        ///
 
72
        const string *GetStereotypeLabelString() {
 
73
                        return stereotypeLabel->GetString();}
 
74
        ///
 
75
        TextShape *GetStereotypeLabel() const {return stereotypeLabel;}
 
76
 
 
77
        /// update string of properties text shape and redraw.
 
78
        void UpdatePropertiesLabelString(const string *s);
 
79
        ///
 
80
        const string *GetPropertiesLabelString() {
 
81
                        return propertiesLabel->GetString();}
 
82
        ///
 
83
        TextShape *GetPropertiesLabel() const {return propertiesLabel;}
 
84
 
 
85
        ///
 
86
        void SetTextShape();
 
87
 
 
88
        /// contains s as string (case sensitive, substring).
 
89
        bool HasString(const string *s, bool sens, bool sub) const;
 
90
        ///
 
91
        bool HasString(const string*, bool, bool, List<TextShape *> *list);
 
92
 
 
93
        ///
 
94
        void SetShowStereotype(bool b) {showStereotype=b;}
 
95
        ///
 
96
        void SetShowProperties(bool b) {showProperties=b;}
 
97
        ///
 
98
        bool IsShowStereotype() const {return showStereotype;}
 
99
        ///
 
100
        bool IsShowProperties() const {return showProperties;}
 
101
 
 
102
        ///
 
103
        void WriteMembers(OutputFile *f);
 
104
        ///
 
105
        bool ReadMembers(InputFile *f, double format);
 
106
protected:
 
107
        ///
 
108
        virtual void CalcPositionLabels();
 
109
private:
 
110
        ///
 
111
        void DrawTextShapes();
 
112
        ///
 
113
        int RequiredHeight();
 
114
        ///
 
115
        int RequiredWidth();
 
116
        ///
 
117
        int DoubleBoxHeight();
 
118
        ///
 
119
        int TripleBoxHeight();
 
120
        ///
 
121
        void SetStereotypeLabelString(const string *s) {
 
122
                        stereotypeLabel->SetString(s);}
 
123
        ///
 
124
        void SetPropertiesLabelString(const string *s) {
 
125
                        propertiesLabel->SetString(s);}
 
126
        ///
 
127
        void CalcPositionLabels2();
 
128
        ///
 
129
        void CalcPositionStereotypeLabel();
 
130
        ///
 
131
        void CalcPositionPropertiesLabel();
 
132
        ///
 
133
        void AdjustSizes(const string *s);
 
134
        ///
 
135
        TextShape *stereotypeLabel;
 
136
        ///
 
137
        TextShape *propertiesLabel;
 
138
        ///
 
139
        bool showStereotype;
 
140
        ///
 
141
        bool showProperties;
 
142
};
 
143
#endif