~ubuntu-branches/ubuntu/intrepid/tcm/intrepid

« back to all changes in this revision

Viewing changes to src/dg/t4line.h

  • Committer: Bazaar Package Importer
  • Author(s): Otavio Salvador
  • Date: 2003-07-03 20:08:21 UTC
  • Revision ID: james.westby@ubuntu.com-20030703200821-se4xtqx25e5miczi
Tags: upstream-2.20
ImportĀ upstreamĀ versionĀ 2.20

Show diffs side-by-side

added added

removed removed

Lines of Context:
 
1
//------------------------------------------------------------------------------
 
2
//
 
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)
 
6
//
 
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.
 
11
//
 
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.
 
16
//
 
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
 
20
// 02111-1307, USA.
 
21
//-----------------------------------------------------------------------------
 
22
#ifndef _T4LINE_H
 
23
#define _T4LINE_H
 
24
 
 
25
#include "t2line.h"
 
26
 
 
27
/// line having 4 text shapes at 4 positions.
 
28
class T4Line: public T2Line {
 
29
/*@Doc: {\large {\bf scope:} Diagram} */
 
30
public:
 
31
        ///
 
32
        T4Line(ShapeView *v, Grafport *g, GShape *n1, GShape *n2, 
 
33
                List<Point *> *line, bool Curved);
 
34
        ///
 
35
        T4Line(ShapeView *v, Grafport *g, GShape *n1, GShape *n2, 
 
36
                bool Curved);
 
37
        ///
 
38
        T4Line(const T4Line &);
 
39
        ///
 
40
        virtual ~T4Line();
 
41
        ///
 
42
        int GetClassType() const {return Code::T4_LINE;}
 
43
 
 
44
        /// see T2Line. Holds all text shapes into account.
 
45
        bool InTextArea(int x, int y); 
 
46
 
 
47
        ///
 
48
        TextShape *HitTextShape(int x, int y);
 
49
        ///
 
50
        TextShape *ChooseTextShape(int x, int y);
 
51
        ///
 
52
        bool HasTextShape(TextShape *t) const;
 
53
 
 
54
        ///
 
55
        void SetSelect(bool s);
 
56
 
 
57
        ///
 
58
        void UpdateTextShape3(const string *s);
 
59
        ///
 
60
        void UpdateTextShape4(const string *s);
 
61
 
 
62
        /// as line, but all text shapes are considered
 
63
        int GetLeftMost() const; 
 
64
        ///
 
65
        int GetTopMost() const;
 
66
        ///
 
67
        int GetRightMost() const;
 
68
        ///
 
69
        int GetBottomMost() const;
 
70
 
 
71
        ///
 
72
        void WriteMembers(OutputFile *f);
 
73
        ///
 
74
        bool ReadMembers(InputFile *f, double format);
 
75
        ///
 
76
        void SetTextShape();
 
77
        ///
 
78
        void SetFont(XFont *ft);
 
79
        ///
 
80
        void SetTextColor(const string *color);
 
81
        ///
 
82
        void SetAlignment(TextAlign::Type alignment);
 
83
 
 
84
        ///
 
85
        void SetGrafport(Grafport *g);
 
86
        ///
 
87
        void SetView(ShapeView *v);
 
88
        ///
 
89
        bool HasString(const string *s, bool sens, bool sub) const;
 
90
        ///
 
91
        bool HasString(const string*, bool, bool, List<TextShape *> *);
 
92
        ///
 
93
        void MoveRaw(const Point *delta);
 
94
 
 
95
protected:
 
96
        /// calculate position of all text shapes.
 
97
        void CalcPositionTextShapes(); 
 
98
        ///
 
99
        TextShape *GetTextShape3() const {return textShape3;}
 
100
        ///
 
101
        void SetTextShape3(TextShape *t) {textShape3=t;}
 
102
        ///
 
103
        TextShape *GetTextShape4() const {return textShape4;}
 
104
        ///
 
105
        void SetTextShape4(TextShape *t) {textShape4=t;}
 
106
        ///
 
107
        PositionType GetT3Position() {return t3Position;}
 
108
        ///
 
109
        void SetT3Position(PositionType t) {t3Position=t;}
 
110
        ///
 
111
        PositionType GetT4Position() {return t4Position;}
 
112
        ///
 
113
        void SetT4Position(PositionType t) {t4Position=t;}
 
114
 
 
115
        /// draw line+ 4 other text shapes.
 
116
        void DrawShape(); 
 
117
private:
 
118
        ///
 
119
        TextShape *textShape3;
 
120
        ///
 
121
        TextShape *textShape4;
 
122
        ///
 
123
        PositionType t3Position;
 
124
        ///
 
125
        PositionType t4Position;
 
126
        ///
 
127
        void InitTextShapes();
 
128
};
 
129
#endif