1
////////////////////////////////////////////////////////////////////////////////
3
// This file is part of Toolkit for Conceptual Modeling (TCM).
4
// (c) copyright 2002, Universiteit Twente
5
// Author: David N. Jansen (dnjansen@cs.utwente.nl).
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.
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.
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
21
////////////////////////////////////////////////////////////////////////////////
24
#include "scdiagram.h"
27
// X bitmap data for the tiled buttons
28
#include "RoundedBox.xbm"
29
#include "AndStateBox.xbm"
30
#include "BlackDot.xbm"
31
#include "Comment.xbm"
32
#include "BullsEye.xbm"
33
#include "MiniDiamond.xbm"
34
#include "SolidHorizontalBar.xbm"
35
#include "SolidVerticalBar.xbm"
36
#include "NoteBox.xbm"
38
#include "DashedEmptyLine.xbm"
39
#include "DottedLine.xbm"
41
const char *SCWindow::SC_NODE_NAMES[] =
42
{"State", "And-state", "Default state", "Final state", "Comment",
43
"Decision pseudostate", "Synchronization pseudostate", "Synchronization pseudostate",
46
const Bitmap SCWindow::SC_NODE_ICONS [] =
47
{{RoundedBox_width, RoundedBox_height, RoundedBox_bits},
48
{AndStateBox_width, AndStateBox_height, AndStateBox_bits},
49
{BlackDot_width, BlackDot_height, BlackDot_bits},
50
{BullsEye_width, BullsEye_height, BullsEye_bits},
51
{Comment_width, Comment_height, Comment_bits},
52
{MiniDiamond_width, MiniDiamond_height, MiniDiamond_bits},
53
{SolidHorizontalBar_width, SolidHorizontalBar_height, SolidHorizontalBar_bits},
54
{SolidVerticalBar_width, SolidVerticalBar_height, SolidVerticalBar_bits},
55
{NoteBox_width, NoteBox_height, NoteBox_bits}};
57
const char *SCWindow::SC_EDGE_NAMES[] = {"Transition", "Note connector", "And-line"};
58
const Bitmap SCWindow::SC_EDGE_ICONS [] =
59
{{Arrow_width, Arrow_height, Arrow_bits},
60
{DottedLine_width, DottedLine_height, DottedLine_bits},
61
{DashedEmptyLine_width, DashedEmptyLine_height, DashedEmptyLine_bits}};
64
SCWindow::SCWindow(const char *n): DiagramWindow(n) {
67
DiagramViewer *SCWindow::CreateViewer(Config *cfg) {
68
return new SCViewer(cfg, this);
71
Graph *SCWindow::CreateGraph() {
75
Diagram *SCWindow::CreateDiagram(Config *c, DiagramViewer *v, Graph *g) {
76
return new SCDiagram(c, this, (SCViewer *)v, (SCGraph *)g);
79
void SCWindow::DetermineIcons() {
80
nodeNames = SC_NODE_NAMES;
81
nodeIcons = SC_NODE_ICONS;
82
edgeNames = SC_EDGE_NAMES;
83
edgeIcons = SC_EDGE_ICONS;
84
nrNodes = XtNumber(SC_NODE_NAMES);
85
nrEdges = XtNumber(SC_EDGE_NAMES);