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

« back to all changes in this revision

Viewing changes to src/gl/toolkit.c

  • 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 1995, 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
#include "toolkit.h"
 
23
 
 
24
const char Toolkit::TOOLKIT_NAME[] = "TCM";
 
25
 
 
26
// Window titles for the different tools.
 
27
const char *Toolkit::TOOL_TITLES[] = {
 
28
        "Tool for Generic Diagrams",
 
29
        "Tool for Entity Relationship Diagrams (classic)",
 
30
        "Tool for Class Relationship Diagrams",
 
31
        "Tool for State Transition Diagrams (Mealy)",
 
32
        "Tool for Process Structure Diagrams (JSD)",
 
33
        "Tool for Recursive Process Graphs",
 
34
        "Tool for Data Flow Diagrams",
 
35
        "Tool for Data and Event Flow Diagrams",
 
36
        "Tool for System Network Diagrams (JSD)",
 
37
        "Tool for Generic Tables",
 
38
        "Tool for Transaction Decomposition Tables",
 
39
        "Tool for Transaction Use Tables",
 
40
        "Tool for Function Entity type Tables",
 
41
        "Tool for Generic Textual Trees",
 
42
        "Tool for Function Refinement Trees",
 
43
        "Tool for Text",
 
44
        "Tool for Color-X Static Object Diagrams",
 
45
        "Tool for Color-X Event Diagrams",
 
46
        "Tool for Static Structure Diagrams",
 
47
        "Tool for Collaboration Diagrams",
 
48
        "Tool for Sequence Diagrams",
 
49
        "Tool for Component Diagrams",
 
50
        "Tool for Deployment Diagrams",
 
51
        "Tool for Use Case Diagrams",
 
52
        "Tool for StateChart Diagrams",
 
53
        "Tool for Activity Diagrams",
 
54
        "Tool for Entity Relationship Diagrams",
 
55
        0};
 
56
 
 
57
const char Toolkit::STARTUP_TOOL_NAME[] = "TCM";
 
58
 
 
59
const char *Toolkit::TOOL_NAMES[] = {
 
60
        "TGD",
 
61
        "TERD",
 
62
        "TCRD",
 
63
        "TSTD",
 
64
        "TPSD",
 
65
        "TRPG",
 
66
        "TDFD",
 
67
        "TEFD",
 
68
        "TSND",
 
69
        "TGT",
 
70
        "TTDT",
 
71
        "TTUT",
 
72
        "TFET",
 
73
        "TGTT",
 
74
        "TFRT",
 
75
        "TT",
 
76
        "CSOD",
 
77
        "CED",
 
78
        "TSSD",
 
79
        "TCBD",
 
80
        "TSQD",
 
81
        "TCPD",
 
82
        "TDPD",
 
83
        "TUCD",
 
84
        "TSCD",
 
85
        "TATD",
 
86
        "TESD",
 
87
        0};
 
88
 
 
89
const char *Toolkit::EXECUTABLE_NAMES[] = {
 
90
        "tgd",
 
91
        "terd",
 
92
        "tcrd",
 
93
        "tstd",
 
94
        "tpsd",
 
95
        "trpg",
 
96
        "tdfd",
 
97
        "tefd",
 
98
        "tsnd",
 
99
        "tgt",
 
100
        "ttdt",
 
101
        "ttut",
 
102
        "tfet",
 
103
        "tgtt",
 
104
        "tfrt",
 
105
        "tt",
 
106
        "csod",
 
107
        "ced",
 
108
        "tssd",
 
109
        "tcbd",
 
110
        "tsqd",
 
111
        "tcpd",
 
112
        "tdpd",
 
113
        "tucd",
 
114
        "tscd",
 
115
        "tatd",
 
116
        "tesd",
 
117
        0};
 
118
 
 
119
 
 
120
const char *Toolkit::DOCUMENT_SUFFIXES[] = { 
 
121
        ".gd", 
 
122
        ".erd", 
 
123
        ".crd", 
 
124
        ".std", 
 
125
        ".psd", 
 
126
        ".rpg", 
 
127
        ".dfd", 
 
128
        ".efd", 
 
129
        ".snd", 
 
130
        ".gt", 
 
131
        ".tdt", 
 
132
        ".tut", 
 
133
        ".fet", 
 
134
        ".gtt", 
 
135
        ".frt", 
 
136
        ".sillysuffixx", 
 
137
        ".csod", 
 
138
        ".ced", 
 
139
        ".ssd",
 
140
        ".cbd",
 
141
        ".sqd",
 
142
        ".cpd",
 
143
        ".dpd",
 
144
        ".ucd",
 
145
        ".scd",
 
146
        ".atd",
 
147
        ".esd",
 
148
        0};
 
149
 
 
150
const char *Toolkit::DOCUMENT_TYPES[] = {
 
151
        "Generic Diagram",
 
152
        "Entity Relationship Diagram (classic)",
 
153
        "Class Relationship Diagram (obsolete)",
 
154
        "State Transition Diagram (Mealy)",
 
155
        "Process Structure Diagram (JSD)",
 
156
        "Recursive Process Graph",
 
157
        "Data Flow Diagram (subset of TEFD)",
 
158
        "Data and Event Flow Diagram",
 
159
        "System Network Diagram (JSD)",
 
160
        "Generic Table",
 
161
        "Transaction Decomposition Table",
 
162
        "Transaction Use Table",
 
163
        "Function Entity type Table",
 
164
        "Generic Textual Tree",
 
165
        "Function Refinement Tree",
 
166
        "Text",
 
167
        "COLOR-X Static Object Diagram",
 
168
        "COLOR-X Event Diagram",
 
169
        "Static Structure Diagram",
 
170
        "Collaboration Diagram",
 
171
        "Sequence Diagram",
 
172
        "Component Diagram",
 
173
        "Deployment Diagram",
 
174
        "Use Case Diagram",
 
175
        "Statechart Diagram",
 
176
        "Activity Diagram",
 
177
        "Entity Relationship Diagram",
 
178
        0};
 
179
 
 
180
const char Toolkit::DOCUMENT_DEFAULT[] = "untitled";
 
181
 
 
182
const char *Toolkit::DOCUMENT_TYPES_INFO[] = {
 
183
        "This tool is for arbitrary graphs and does not perform \
 
184
semantic checks.",
 
185
        "This tool is for classic entity relationship diagrams (ERDs). \
 
186
New users are advised to use TESD.",
 
187
        "This tool is for class-relationship diagrams (CRDs). \
 
188
New users are advised to use TSSD.",
 
189
        "This tool is for state transition diagrams, \
 
190
using the Mealy convention.",
 
191
        "This tool is for process structure diagrams (PSDs), \
 
192
that are used in the Jackson System Development method (JSD).",
 
193
        "This tool is for recursive process graphs (RPGs), \
 
194
also called life cycle diagrams.",
 
195
        "This tool is for data flow diagrams (DFDs). \
 
196
This tool is a subset of TEFD.",
 
197
        "This tool is for data and event flow diagrams.",
 
198
        "This tool is for system network diagrams (SNDs) \
 
199
that are used in the Jackson System Development method (JSD).",
 
200
        "This tool is for generic tables and does not perform \
 
201
semantic checks.",
 
202
        "This tool is for transaction decomposition tables. \
 
203
See 'introduction to TTDT' in the help menu of TTDT.",
 
204
        "This tool is for transaction use tables. \
 
205
See 'introduction to TTUT' in the help menu of TTUT.",
 
206
        "This tool is for function entity type tables. \
 
207
See 'introduction to TFET' in the help menu of TFET.",
 
208
        "This tool is for generic trees in which all nodes are \
 
209
text labels and which does not perform semantic checks.",
 
210
        "This tool is for function refinement trees.",
 
211
        "Text",
 
212
        "COLOR-X Static Object Diagram",
 
213
        "COLOR-X Event Diagram",
 
214
        "This tool is for UML static structure diagrams (SSDs)",
 
215
        "Tool for UML Collaboration Diagrams.", // TCBD
 
216
        "Not yet implemented.",         // TSQD
 
217
        "Tool for UML Component Diagrams.", // TCPD
 
218
        "Tool for UML Deployment Diagrams.",            // TDPD
 
219
        "This tool is for UML use-case diagrams.",      // TUCD
 
220
        "This tool is for UML (and Statemate) state charts.",           // TSCD
 
221
        "This tool is for UML activity diagrams.",      // TATD
 
222
        "This tool is for entity relationship diagrams (ERDs)", // TESD
 
223
        0};
 
224
 
 
225
 
 
226
bool Toolkit::TableEditor(int tool) {
 
227
        return (tool == GT || tool == FET || tool == TDT || tool == TUT);
 
228
}
 
229
 
 
230
bool Toolkit::DiagramEditor(int tool) {
 
231
        return (!TableEditor(tool) && !TextEditor(tool));
 
232
}
 
233
 
 
234
bool Toolkit::TreeEditor(int tool) {
 
235
        return (tool == GTT || tool == FDT);
 
236
}
 
237
 
 
238
bool Toolkit::GenericEditor(int tool) {
 
239
        return (tool == GD || tool == GT || tool == GTT);
 
240
}
 
241
 
 
242
bool Toolkit::HierarchicEditor(int tool) {
 
243
        return tool==ERD||tool==CRD ||tool==GD ||
 
244
                tool==DFD||tool==EFD||tool==STD|| SCD == tool ||
 
245
                tool==SSD||
 
246
                tool==ESD /* || TreeEditor(tool) */;
 
247
}
 
248
 
 
249
bool Toolkit::TextEditor(int tool) {
 
250
        return (tool == T);
 
251
}
 
252
 
 
253
bool Toolkit::EditorWithoutCurves(int tool) {
 
254
        return !(DiagramEditor(tool) && tool != PSD && !TreeEditor(tool));
 
255
}
 
256
 
 
257
bool Toolkit::EditorWithoutDuplicates(int tool) {
 
258
        return ! DiagramEditor(tool) || tool == PSD || SCD == tool
 
259
                || TreeEditor(tool);
 
260
}
 
261
 
 
262
bool Toolkit::EditorWithInterEdgeConnections(int tool) {
 
263
        return (DiagramEditor(tool) && (tool == GD || tool == SSD || tool == ESD));
 
264
}
 
265
 
 
266
bool Toolkit::EditorWithModelChecker(int tool) {
 
267
        return STD == tool || SCD == tool || ATD == tool ;
 
268
}
 
269
 
 
270