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 _TRANSITION_ARROW_H
23
#define _TRANSITION_ARROW_H
27
/// arrow having extra horiz. line separating event and list of actions (STD).
28
class TransitionArrow: public Line {
29
/*@Doc: {\large {\bf scope:} TSTD} */
32
TransitionArrow(ShapeView *v, Grafport *g, GShape *n1, GShape *n2,
33
List<Point *> *line, bool Curved);
35
TransitionArrow(ShapeView *v, Grafport *g, GShape *n1, GShape *n2,
38
TransitionArrow(const TransitionArrow &line);
40
virtual ~TransitionArrow();
42
Shape *Clone() {return new TransitionArrow(*this);}
44
int GetClassType() const {return Code::TRANSITION_ARROW;}
46
bool InTextArea(int x, int y);
48
TextShape *HitTextShape(int x, int y);
50
TextShape *ChooseTextShape(int x, int y);
52
bool HasTextShape(TextShape *t) const;
54
bool ContainsPt(int x, int y);
56
void SetSelect(bool s);
58
bool HitHLine(int x, int y);
60
const Point *GetHLineFrom() const {return &hlineFrom;}
62
const Point *GetHLineTo() const {return &hlineTo;}
64
void UpdateAnchor(const Point *delta, const Point *position);
66
void UpdateEvent(const string *s);
68
void UpdateAction(const string *s, unsigned n, bool update);
71
/// as line, but event and actions are also considered.
72
int GetLeftMost() const;
74
int GetTopMost() const;
76
int GetRightMost() const;
78
int GetBottomMost() const;
80
void WriteMembers(OutputFile *f);
82
bool ReadMembers(InputFile *f, double format);
84
bool SetAssocSubject(AssocList *);
88
void SetTextColor(const string *color);
90
void SetFont(XFont *ft);
92
void SetGrafport(Grafport *g);
94
void SetView(ShapeView *v);
96
bool HasString(const string *s, bool sens, bool sub) const;
98
bool HasNameString(const string *, bool, bool) const{return False;}
100
bool HasString(const string*, bool, bool, List<TextShape *> *);
102
enum SepType {LEFT, RIGHT, UP, DOWN};
104
void MoveRaw(const Point *delta);
109
List<TextShape *> *actions;
119
const char *Sep2String(SepType sep);
121
TransitionArrow::SepType String2Sep(const string *s);
125
void CalcSeparator();
127
void CalcHLinePart();
129
void CalcPositionEvent();
131
void CalcPositionActions();
132
/// calculate line position and action and event.
133
void CalcPositionHLine();
135
void SetAction(const string *s, unsigned n, bool update);
136
/// draw arrow + all labels + 1 horiz line.
138
/// minimal length hline.
139
static const int HLINELEN;
141
static const int HLINEXOFFSET;
143
static const int HLINEYOFFSET;
144
/// distance to horizontal line.
145
static const int HLINEDIST;