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 _SSDSINGLECLASSBOX_H
23
#define _SSDSINGLECLASSBOX_H
27
class SSDDoubleClassBox;
28
class SSDTripleClassBox;
30
/// Box for representing object classes in a SSD.
31
class SSDSingleClassBox: public Box {
32
/*@Doc: {\large {\bf scope:} TSSD} */
35
SSDSingleClassBox(ShapeView *v, Grafport *g, double x, double y);
37
SSDSingleClassBox(const SSDSingleClassBox &s);
39
SSDSingleClassBox(const SSDDoubleClassBox &s);
41
SSDSingleClassBox(const SSDTripleClassBox &s);
43
SSDSingleClassBox(const StickMan &s);
47
Shape *Clone() {return new SSDSingleClassBox(*this);}
49
int GetClassType() const {return Code::SSD_SINGLE_CLASS_BOX;}
52
// void SetSize(int w, int h);
54
// void SetPosition(const Point *p, bool snap);
56
void SetFont(XFont *ft);
58
void SetTextColor(const string *color);
60
void SetGrafport(Grafport *g);
62
void SetView(ShapeView *v);
64
TextShape *ChooseTextShape(int x, int y);
66
bool HasTextShape(TextShape *t) const;
71
void UpdateShowStereotype(bool b);
73
void UpdateShowProperties(bool b);
75
/// update string of stereotype text shape and redraw.
76
void UpdateStereotypeLabelString(const string *s);
78
const string *GetStereotypeLabelString() {
79
return stereotypeLabel->GetString();}
81
TextShape *GetStereotypeLabel() const {return stereotypeLabel;}
83
/// update string of properties text shape and redraw.
84
virtual void UpdatePropertiesLabelString(const string *s);
86
const string *GetPropertiesLabelString() {
87
return propertiesLabel->GetString();}
89
TextShape *GetPropertiesLabel() const {return propertiesLabel;}
92
bool SetAssocSubject(AssocList *);
96
/// contains s as string (case sensitive, substring).
97
bool HasString(const string *s, bool sens, bool sub) const;
99
bool HasString(const string*, bool, bool, List<TextShape *> *list);
102
void SetShowStereotype(bool b) {showStereotype=b;}
104
void SetShowProperties(bool b) {showProperties=b;}
106
bool IsShowStereotype() const {return showStereotype;}
108
bool IsShowProperties() const {return showProperties;}
111
void WriteMembers(OutputFile *f);
113
bool ReadMembers(InputFile *f, double format);
116
virtual void CalcPositionLabels();
119
void DrawTextShapes();
121
int RequiredHeight();
125
void SetStereotypeLabelString(const string *s) {
126
stereotypeLabel->SetString(s);}
128
void SetPropertiesLabelString(const string *s) {
129
propertiesLabel->SetString(s);}
131
void CalcPositionStereotypeLabel();
133
void CalcPositionPropertiesLabel();
136
static const int TEXTMARGIN;
138
TextShape *stereotypeLabel;
140
TextShape *propertiesLabel;