~ubuntu-branches/ubuntu/utopic/tcm/utopic

« back to all changes in this revision

Viewing changes to src/sd/bv/initialstatebox.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 1996, 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 _INITIALSTATEBOX_H
 
23
#define _INITIALSTATEBOX_H
 
24
 
 
25
#include "box.h"
 
26
#include "lineend.h"
 
27
 
 
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} */
 
31
public:
 
32
        ///
 
33
        InitialStateBox(ShapeView *v, Grafport *g, double x, double y);
 
34
        ///
 
35
        InitialStateBox(const InitialStateBox &a);
 
36
        ///
 
37
        virtual ~InitialStateBox();
 
38
        ///
 
39
        Shape *Clone() {return new InitialStateBox(*this);}
 
40
        ///
 
41
        int GetClassType() const {return Code::ARROW_BOX;}
 
42
        ///
 
43
        void SetSize(int w, int h);
 
44
        ///
 
45
        void SetPosition(const Point *p, bool b);
 
46
        ///
 
47
        void SetFont(XFont *ft);
 
48
        ///
 
49
        void SetTextColor(const string *color);
 
50
        ///
 
51
        TextShape *ChooseTextShape(int x, int y);
 
52
        ///
 
53
        bool HasTextShape(TextShape *t) const;
 
54
        ///
 
55
        bool ContainsPt(int x, int y);
 
56
        ///
 
57
        bool HitHLine(int x, int y);
 
58
        ///
 
59
        const Point *GetHLineFrom() const {return &hlineFrom;}
 
60
        ///
 
61
        const Point *GetHLineTo() const {return &hlineTo;}
 
62
        ///
 
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; 
 
68
        ///
 
69
        int GetTopMost() const;
 
70
        ///
 
71
        int GetRightMost() const;
 
72
        ///
 
73
        bool SetAssocSubject(AssocList *);
 
74
        ///
 
75
        void SetTextShape();
 
76
        ///
 
77
        void WriteMembers(OutputFile *f);
 
78
        ///
 
79
        bool ReadMembers(InputFile *f, double format);
 
80
        ///
 
81
        void SetGrafport(Grafport *g);
 
82
        ///
 
83
        void SetView(ShapeView *v);
 
84
        ///
 
85
        bool HasString(const string *s, bool sens, bool sub) const;
 
86
        ///
 
87
        bool HasString(const string*, bool, bool, List<TextShape *> *);
 
88
private:
 
89
        ///
 
90
        LineEnd end;
 
91
        ///
 
92
        void DrawShape();
 
93
        ///
 
94
        Point hlineFrom;
 
95
        ///
 
96
        Point hlineTo;
 
97
        ///
 
98
        Point anchorPoint;
 
99
        ///
 
100
        int HLineLength();
 
101
        ///
 
102
        bool HitVLine(int x, int y);
 
103
        ///
 
104
        void CalcHLinePart();
 
105
        ///
 
106
        void CalcPositionHLine();
 
107
        ///
 
108
        void CalcPositionActions();
 
109
        ///
 
110
        void SetAction(const string *s, unsigned n, bool update);
 
111
        ///
 
112
        List<TextShape *> *actions;
 
113
        ///
 
114
        static const int ARROWLEN;
 
115
        /// minimal length hline.
 
116
        static const int HLINELEN;
 
117
        ///
 
118
        static const int HLINEXOFFSET;
 
119
        ///
 
120
        static const int HLINEYOFFSET;
 
121
};
 
122
#endif