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

« back to all changes in this revision

Viewing changes to src/dg/t4tlistline.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 2000, Vrije Universiteit Amsterdam and University of Twente.
 
5
// Author: Henk van de Zandschulp (henkz@cs.utwente.nl).
 
6
// Author: Frank Dehne (frank@cs.vu.nl).
 
7
//
 
8
// TCM is free software; you can redistribute it and/or modify
 
9
// it under the terms of the GNU General Public License as published by
 
10
// the Free Software Foundation; either version 2 of the License, or
 
11
// (at your option) any later version.
 
12
//
 
13
// TCM is distributed in the hope that it will be useful,
 
14
// but WITHOUT ANY WARRANTY; without even the implied warranty of
 
15
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
 
16
// GNU General Public License for more details.
 
17
//
 
18
// You should have received a copy of the GNU General Public License
 
19
// along with TCM; if not, write to the Free Software
 
20
// Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA
 
21
// 02111-1307, USA.
 
22
//-----------------------------------------------------------------------------
 
23
#ifndef _T4TLISTLINE_H
 
24
#define _T4TLISTLINE_H
 
25
 
 
26
#include "t4line.h"
 
27
 
 
28
/// line having 4 text shapes at 4 positions.
 
29
class T4TListLine: public T4Line {
 
30
/*@Doc: {\large {\bf scope:} Diagram} */
 
31
public:
 
32
        ///
 
33
        T4TListLine(ShapeView *v, Grafport *g, GShape *n1, GShape *n2, 
 
34
                List<Point *> *line, bool Curved);
 
35
        ///
 
36
        T4TListLine(ShapeView *v, Grafport *g, GShape *n1, GShape *n2, 
 
37
                bool Curved);
 
38
        ///
 
39
        T4TListLine(const T4TListLine &);
 
40
        ///
 
41
        virtual ~T4TListLine();
 
42
        ///
 
43
        int GetClassType() const {return Code::T4_TLIST_LINE;}
 
44
 
 
45
        /// see T4Line. Holds all text shapes into account.
 
46
        bool InTextArea(int x, int y); 
 
47
 
 
48
        ///
 
49
        TextShape *HitTextShape(int x, int y);
 
50
        ///
 
51
        TextShape *ChooseTextShape(int x, int y);
 
52
        ///
 
53
        bool HasTextShape(TextShape *t) const;
 
54
 
 
55
        ///
 
56
        void SetSelect(bool s);
 
57
 
 
58
        ///
 
59
        void UpdateTListTextShape(const string *s, unsigned n);
 
60
 
 
61
        /// as line, but all text shapes are considered
 
62
        int GetLeftMost() const; 
 
63
        ///
 
64
        int GetTopMost() const;
 
65
        ///
 
66
        int GetRightMost() const;
 
67
        ///
 
68
        int GetBottomMost() const;
 
69
 
 
70
        ///
 
71
        void WriteMembers(OutputFile *f);
 
72
        ///
 
73
        bool ReadMembers(InputFile *f, double format);
 
74
        ///
 
75
        void SetTextShape();
 
76
        ///
 
77
        void SetFont(XFont *ft);
 
78
        ///
 
79
        void SetTextColor(const string *color);
 
80
        ///
 
81
        void SetAlignment(TextAlign::Type alignment);
 
82
 
 
83
        ///
 
84
        void SetGrafport(Grafport *g);
 
85
        ///
 
86
        void SetView(ShapeView *v);
 
87
        ///
 
88
        bool HasString(const string *s, bool sens, bool sub) const;
 
89
        ///
 
90
        bool HasString(const string*, bool, bool, List<TextShape *> *);
 
91
        ///
 
92
        void MoveRaw(const Point *delta);
 
93
 
 
94
        /// calculate position of all text shapes.
 
95
        void CalcPositionTextShapes(); 
 
96
        /// calculate position of text shapes list.
 
97
        void CalcPositionTextShapeList(); 
 
98
protected:
 
99
        ///
 
100
        List<TextShape *> *GetTList() const { return tlist;}
 
101
        ///
 
102
        void DrawTextShapes();
 
103
        /// draw line+ 4 other text shapes.
 
104
        void DrawShape(); 
 
105
 
 
106
private:
 
107
        ///
 
108
        List <TextShape *> *tlist;
 
109
        ///
 
110
        int MessageCount;
 
111
        ///
 
112
        void InitTextShapes();
 
113
};
 
114
#endif