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

« back to all changes in this revision

Viewing changes to src/dg/triplebox.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 _TRIPLEBOX_H
 
23
#define _TRIPLEBOX_H
 
24
 
 
25
#include "doublebox.h"
 
26
 
 
27
/// three compartment box: 1st for name, 2nd for labels, 3rd for labels2.
 
28
class TripleBox: public DoubleBox {
 
29
/*@Doc: {\large {\bf scope:} diagram} */
 
30
public:
 
31
        ///
 
32
        TripleBox(ShapeView *v, Grafport *g, int x, int y, int w, int h);
 
33
        ///
 
34
        TripleBox(const TripleBox &s);
 
35
        ///
 
36
        TripleBox(const DoubleBox &s);
 
37
        ///
 
38
        TripleBox(const Box &s);
 
39
        ///
 
40
        TripleBox(const NodeShape &s);
 
41
        ///
 
42
        virtual ~TripleBox();
 
43
        ///
 
44
        int GetClassType() const {return Code::TRIPLE_BOX;}
 
45
        ///
 
46
        Shape *Clone() { return new TripleBox(*this);}
 
47
        ///
 
48
        TextShape *ChooseTextShape(int x, int y);
 
49
        ///
 
50
        bool HasTextShape(TextShape *t) const;
 
51
        /// update or insert string of n-th label2.
 
52
        void UpdateLabel2(const string *s, unsigned n, bool update); 
 
53
        ///
 
54
        TextShape *GetLabel2(unsigned n);
 
55
        ///
 
56
        unsigned NrLabels2() {return labels2->count();}
 
57
        ///
 
58
        void SetTextShape();
 
59
        ///
 
60
        void SetFont(XFont *ft);
 
61
        ///
 
62
        void SetTextColor(const string *color);
 
63
        ///
 
64
        void AdjustSize();
 
65
        ///
 
66
        void SetGrafport(Grafport *g);
 
67
        ///
 
68
        void SetView(ShapeView *v);
 
69
        /// text shape contains s as string.
 
70
        bool HasString(const string *s, bool sens, bool sub) const;
 
71
        ///
 
72
        bool HasString(const string*, bool, bool, List<TextShape *> *);
 
73
        ///
 
74
        LineStyle::Type GetSeparator2LineStyle() const
 
75
                {return separator2LineStyle;}
 
76
        ///
 
77
        void SetSeparator2LineStyle(LineStyle::Type x)
 
78
                {separator2LineStyle=x;}
 
79
protected:
 
80
        ///
 
81
        void DrawShape();
 
82
        ///
 
83
        void DrawTextShapes();
 
84
        ///
 
85
        int RequiredHeight();
 
86
        ///
 
87
        int DoubleBoxHeight();
 
88
        ///
 
89
        void CalcPositionLabels();
 
90
        ///
 
91
        void CalcPositionLabels2();
 
92
        ///
 
93
        void AdjustSizes(const string *s);
 
94
        ///
 
95
        List<TextShape *> *GetLabels2() {return labels2;}
 
96
        ///
 
97
        string label2Description;
 
98
private:
 
99
        /// the list of labels2 in the third compartment.
 
100
        List<TextShape *> *labels2; 
 
101
        ///
 
102
        LineStyle::Type separator2LineStyle;
 
103
        ///
 
104
        void Init();
 
105
};
 
106
#endif