1
//------------------------------------------------------------------------------
3
// This file is part of Toolkit for Conceptual Modeling (TCM).
4
// (c) copyright 1996, Vrije Universiteit Amsterdam.
5
// Author: Frank Dehne (frank@cs.vu.nl).
7
// TCM is free software; you can redistribute it and/or modify
8
// it under the terms of the GNU General Public License as published by
9
// the Free Software Foundation; either version 2 of the License, or
10
// (at your option) any later version.
12
// TCM is distributed in the hope that it will be useful,
13
// but WITHOUT ANY WARRANTY; without even the implied warranty of
14
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
15
// GNU General Public License for more details.
17
// You should have received a copy of the GNU General Public License
18
// along with TCM; if not, write to the Free Software
19
// Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA
21
//-----------------------------------------------------------------------------
25
#include "doublebox.h"
27
/// three compartment box: 1st for name, 2nd for labels, 3rd for labels2.
28
class TripleBox: public DoubleBox {
29
/*@Doc: {\large {\bf scope:} diagram} */
32
TripleBox(ShapeView *v, Grafport *g, int x, int y, int w, int h);
34
TripleBox(const TripleBox &s);
36
TripleBox(const DoubleBox &s);
38
TripleBox(const Box &s);
40
TripleBox(const NodeShape &s);
44
int GetClassType() const {return Code::TRIPLE_BOX;}
46
Shape *Clone() { return new TripleBox(*this);}
48
TextShape *ChooseTextShape(int x, int y);
50
bool HasTextShape(TextShape *t) const;
51
/// update or insert string of n-th label2.
52
void UpdateLabel2(const string *s, unsigned n, bool update);
54
TextShape *GetLabel2(unsigned n);
56
unsigned NrLabels2() {return labels2->count();}
60
void SetFont(XFont *ft);
62
void SetTextColor(const string *color);
66
void SetGrafport(Grafport *g);
68
void SetView(ShapeView *v);
69
/// text shape contains s as string.
70
bool HasString(const string *s, bool sens, bool sub) const;
72
bool HasString(const string*, bool, bool, List<TextShape *> *);
74
LineStyle::Type GetSeparator2LineStyle() const
75
{return separator2LineStyle;}
77
void SetSeparator2LineStyle(LineStyle::Type x)
78
{separator2LineStyle=x;}
83
void DrawTextShapes();
87
int DoubleBoxHeight();
89
void CalcPositionLabels();
91
void CalcPositionLabels2();
93
void AdjustSizes(const string *s);
95
List<TextShape *> *GetLabels2() {return labels2;}
97
string label2Description;
99
/// the list of labels2 in the third compartment.
100
List<TextShape *> *labels2;
102
LineStyle::Type separator2LineStyle;