1
//------------------------------------------------------------------------------
3
// This file is part of Toolkit for Conceptual Modeling (TCM).
4
// (c) copyright 1998, 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
//-----------------------------------------------------------------------------
27
/// line having 4 text shapes at 4 positions.
28
class T4Line: public T2Line {
29
/*@Doc: {\large {\bf scope:} Diagram} */
32
T4Line(ShapeView *v, Grafport *g, GShape *n1, GShape *n2,
33
List<Point *> *line, bool Curved);
35
T4Line(ShapeView *v, Grafport *g, GShape *n1, GShape *n2,
38
T4Line(const T4Line &);
42
int GetClassType() const {return Code::T4_LINE;}
44
/// see T2Line. Holds all text shapes into account.
45
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;
55
void SetSelect(bool s);
58
void UpdateTextShape3(const string *s);
60
void UpdateTextShape4(const string *s);
62
/// as line, but all text shapes are considered
63
int GetLeftMost() const;
65
int GetTopMost() const;
67
int GetRightMost() const;
69
int GetBottomMost() const;
72
void WriteMembers(OutputFile *f);
74
bool ReadMembers(InputFile *f, double format);
78
void SetFont(XFont *ft);
80
void SetTextColor(const string *color);
82
void SetAlignment(TextAlign::Type alignment);
85
void SetGrafport(Grafport *g);
87
void SetView(ShapeView *v);
89
bool HasString(const string *s, bool sens, bool sub) const;
91
bool HasString(const string*, bool, bool, List<TextShape *> *);
93
void MoveRaw(const Point *delta);
96
/// calculate position of all text shapes.
97
void CalcPositionTextShapes();
99
TextShape *GetTextShape3() const {return textShape3;}
101
void SetTextShape3(TextShape *t) {textShape3=t;}
103
TextShape *GetTextShape4() const {return textShape4;}
105
void SetTextShape4(TextShape *t) {textShape4=t;}
107
PositionType GetT3Position() {return t3Position;}
109
void SetT3Position(PositionType t) {t3Position=t;}
111
PositionType GetT4Position() {return t4Position;}
113
void SetT4Position(PositionType t) {t4Position=t;}
115
/// draw line+ 4 other text shapes.
119
TextShape *textShape3;
121
TextShape *textShape4;
123
PositionType t3Position;
125
PositionType t4Position;
127
void InitTextShapes();