1
//------------------------------------------------------------------------------
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).
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
//-----------------------------------------------------------------------------
22
#ifndef _DIAGRAMWINDOW_H
23
#define _DIAGRAMWINDOW_H
26
#include "drawwindow.h"
27
#include "drawingarea.h"
32
/// edit window class that is common to all diagram editors.
33
class DiagramWindow: public DrawWindow {
34
/*@Doc: {\large {\bf scope:} diagram} */
37
DiagramWindow(const char *name);
39
virtual ~DiagramWindow();
41
/// Show in status that node type n is selected.
42
void SetNodeName(int n);
44
/// Show in status that edge type n is selected.
45
void SetEdgeName(int n);
47
/// set hierarchic document toggle.
48
virtual void SetHierarchic(bool s);
50
/// points to the names of the node shapes.
51
const char** nodeNames;
52
/// points to the names of the edge shapes.
53
const char** edgeNames;
59
/// List of Icons for the "Nodes" tiled buttons.
60
const Bitmap *nodeIcons;
61
/// List of Icons for the "Edges" tiled buttons.
62
const Bitmap *edgeIcons;
65
Widget CreateMenuBar(Widget parent);
67
/// created tiled buttons.
68
virtual Widget CreateTiles(Widget parent);
71
void CreateNodeIcons(Widget parent);
73
void CreateEdgeIcons(Widget parent);
75
void CreateIndexToggle(Widget parent);
78
DiagramViewer *GetDiagramViewer() const {return viewer;}
81
void SetShowLineStyleOptionMenu(bool b) {
82
showLineStyleOptionMenu = b;}
84
Widget GetNodeIconsRC() const {return nodeIconsRC;}
86
Widget GetEdgeIconsRC() const {return edgeIconsRC;}
88
void CreateLineStyleOptionMenu(Widget w, bool nodes, bool minimize);
94
DiagramViewer *viewer;
96
/// parse the command line options.
97
void ParseUserOptions(int argc, char** argv);
100
void WriteUsage(const char *prog);
102
/// initialize window: create menubar, tiles, scrolled window, etc
103
void CreateComponents(Widget window);
106
virtual Menu *BuildViewMenu(Widget bar);
108
/// Motif RowColumn widget containing tiled buttons.
114
void CreateDocument();
116
virtual DiagramViewer *CreateViewer(Config *c) = 0;
118
virtual Graph *CreateGraph() = 0;
120
virtual Diagram *CreateDiagram(
121
Config *c, DiagramViewer *v, Graph *g) = 0;
123
/// Determine icon lists to be used for the window.
124
virtual void DetermineIcons() = 0;
127
void GetNodeName(int i, string *name);
129
void GetEdgeName(int i, string *name);
132
static const Bitmap CURVE_ICON;
134
static const Bitmap SOLID_LINE_ICON;
136
static const Bitmap DASHED_LINE_ICON;
138
static const Bitmap DOTTED_LINE_ICON;
147
bool showLineStyleOptionMenu;
150
virtual bool ShowIndexToggle() {return False;}
152
void CalcIconColumns();
154
int GetIconsScrollHeight(int rows);
158
MenuItem *diagramAlignItems;
160
MenuItem *defPropertiesItems;
164
MenuItem *nodeLineStyleItems;
166
MenuItem *edgeLineStyleItems;
168
MenuItem *updateNodeShapeTypeItems;