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

« back to all changes in this revision

Viewing changes to src/sd/bv/scwindow.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 2002, Universiteit Twente
 
5
// Author: David N. Jansen (dnjansen@cs.utwente.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 "scwindow.h"
 
23
#include "scviewer.h"
 
24
#include "scdiagram.h"
 
25
#include "scgraph.h"
 
26
 
 
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"
 
37
#include "Arrow.xbm"
 
38
#include "DashedEmptyLine.xbm"
 
39
#include "DottedLine.xbm"
 
40
 
 
41
const char *SCWindow::SC_NODE_NAMES[] =
 
42
        {"State", "And-state", "Default state", "Final state", "Comment",
 
43
        "Decision pseudostate", "Synchronization pseudostate", "Synchronization pseudostate",
 
44
        "Comment"};
 
45
 
 
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}};
 
56
 
 
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}};
 
62
 
 
63
 
 
64
SCWindow::SCWindow(const char *n): DiagramWindow(n) {
 
65
}
 
66
 
 
67
DiagramViewer *SCWindow::CreateViewer(Config *cfg) {
 
68
        return new SCViewer(cfg, this);
 
69
}
 
70
 
 
71
Graph *SCWindow::CreateGraph() {
 
72
        return new SCGraph();
 
73
}
 
74
 
 
75
Diagram *SCWindow::CreateDiagram(Config *c, DiagramViewer *v, Graph *g) {
 
76
        return new SCDiagram(c, this, (SCViewer *)v, (SCGraph *)g);
 
77
}
 
78
 
 
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);
 
86
}