1
//------------------------------------------------------------------------------
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).
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.
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.
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
25
#include "tripleclassbox.h"
26
class SSDSingleClassBox;
27
class SSDDoubleClassBox;
29
/// A triple box used for a object class.
30
class SSDTripleClassBox: public TripleClassBox {
31
/*@Doc: {\large {\bf scope:} TSSD} */
34
SSDTripleClassBox(ShapeView *v, Grafport *g, int x, int y,
35
int w = TRIPLECLASSBOX_WIDTH, int h = TRIPLECLASSBOX_HEIGHT);
37
SSDTripleClassBox(const SSDTripleClassBox &s);
39
SSDTripleClassBox(const SSDDoubleClassBox &s);
41
SSDTripleClassBox(const SSDSingleClassBox &s);
45
Shape *Clone() {return new SSDTripleClassBox(*this);}
47
int GetClassType() const {return Code::SSD_TRIPLE_CLASS_BOX;}
50
void SetFont(XFont *ft);
52
void SetTextColor(const string *color);
54
void SetGrafport(Grafport *g);
56
void SetView(ShapeView *v);
58
TextShape *ChooseTextShape(int x, int y);
60
bool HasTextShape(TextShape *t) const;
65
void UpdateShowStereotype(bool b);
67
void UpdateShowProperties(bool b);
69
/// update string of stereotype text shape and redraw.
70
void UpdateStereotypeLabelString(const string *s);
72
const string *GetStereotypeLabelString() {
73
return stereotypeLabel->GetString();}
75
TextShape *GetStereotypeLabel() const {return stereotypeLabel;}
77
/// update string of properties text shape and redraw.
78
void UpdatePropertiesLabelString(const string *s);
80
const string *GetPropertiesLabelString() {
81
return propertiesLabel->GetString();}
83
TextShape *GetPropertiesLabel() const {return propertiesLabel;}
88
/// contains s as string (case sensitive, substring).
89
bool HasString(const string *s, bool sens, bool sub) const;
91
bool HasString(const string*, bool, bool, List<TextShape *> *list);
94
void SetShowStereotype(bool b) {showStereotype=b;}
96
void SetShowProperties(bool b) {showProperties=b;}
98
bool IsShowStereotype() const {return showStereotype;}
100
bool IsShowProperties() const {return showProperties;}
103
void WriteMembers(OutputFile *f);
105
bool ReadMembers(InputFile *f, double format);
108
virtual void CalcPositionLabels();
111
void DrawTextShapes();
113
int RequiredHeight();
117
int DoubleBoxHeight();
119
int TripleBoxHeight();
121
void SetStereotypeLabelString(const string *s) {
122
stereotypeLabel->SetString(s);}
124
void SetPropertiesLabelString(const string *s) {
125
propertiesLabel->SetString(s);}
127
void CalcPositionLabels2();
129
void CalcPositionStereotypeLabel();
131
void CalcPositionPropertiesLabel();
133
void AdjustSizes(const string *s);
135
TextShape *stereotypeLabel;
137
TextShape *propertiesLabel;