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
//-----------------------------------------------------------------------------
22
#ifndef _INITIALSTATEBOX_H
23
#define _INITIALSTATEBOX_H
28
/// box having downwards pointing arrow on top and list of action shapes (STD).
29
class InitialStateBox: public Box {
30
/*@Doc: {\large {\bf scope:} TSTD} */
33
InitialStateBox(ShapeView *v, Grafport *g, double x, double y);
35
InitialStateBox(const InitialStateBox &a);
37
virtual ~InitialStateBox();
39
Shape *Clone() {return new InitialStateBox(*this);}
41
int GetClassType() const {return Code::ARROW_BOX;}
43
void SetSize(int w, int h);
45
void SetPosition(const Point *p, bool b);
47
void SetFont(XFont *ft);
49
void SetTextColor(const string *color);
51
TextShape *ChooseTextShape(int x, int y);
53
bool HasTextShape(TextShape *t) const;
55
bool ContainsPt(int x, int y);
57
bool HitHLine(int x, int y);
59
const Point *GetHLineFrom() const {return &hlineFrom;}
61
const Point *GetHLineTo() const {return &hlineTo;}
63
void UpdateAnchor(const Point *delta, const Point *position);
64
/// update or insert string of n-th attribute.
65
void UpdateAction(const string *s, unsigned n, bool update);
66
/// take actions into account.
67
int GetLeftMost() const;
69
int GetTopMost() const;
71
int GetRightMost() const;
73
bool SetAssocSubject(AssocList *);
77
void WriteMembers(OutputFile *f);
79
bool ReadMembers(InputFile *f, double format);
81
void SetGrafport(Grafport *g);
83
void SetView(ShapeView *v);
85
bool HasString(const string *s, bool sens, bool sub) const;
87
bool HasString(const string*, bool, bool, List<TextShape *> *);
102
bool HitVLine(int x, int y);
104
void CalcHLinePart();
106
void CalcPositionHLine();
108
void CalcPositionActions();
110
void SetAction(const string *s, unsigned n, bool update);
112
List<TextShape *> *actions;
114
static const int ARROWLEN;
115
/// minimal length hline.
116
static const int HLINELEN;
118
static const int HLINEXOFFSET;
120
static const int HLINEYOFFSET;