1. Introduction
5. Non-functional requirements
7. System Structure -
The 30,000 ft view
8.
Primary Data and Objects
The
primary data managed by the class diagramming application is:
+
names of classes
+
names of class members
+
names of interfaces
+
names of interface methods
+
text of notes
+
label positions
+
links between labels
+
flags to indicate whether a label is hidden/shown, and/or proposed (additions
are marked with ‘+’ watermark, and deletions are marked with ‘x’ watermark).
+ a
flag to indicate whether or not to draw hidden objects.
The
data suggests the following object types:
Label
[N.DB.008]
Each
label object holds the following data:
an
id; the Diagram object provides constants for each of the valid label types.
[N.DB.012]
a
type
the
text of the label,
a
location; in pixels; referencing the center of the baseline of the label text

a
list of vertex id’s of vertices associated with the label; these vertices
represent the ends of links attached to the label; see implementation ISL for
details about how links are attached to labels
a
“hidden” flag
a
“propose to add” flag
a
“propose to delete” flag
a
“deleted” flag
The
key elements of the Label interface consists of the constructors
Label
( String type, String text, int x, int y );
Label
( int id, String type, String string, int x, int y ); (used to restore label
from file)
accessors
for id, type, text, position, text baseline left position (needed for drawing),
text upper left position, text lower right position, list of vertex id’s,
flags, a method for selecting the label with a point:
boolean
Select(int x, int y);
and
a method for moving a label by a displacement dx, dy:
void
Move ( int dx, int dy );
Since this interface is considered private to the database
manager, except as indicated, it is not strictly controlled by the design.
Link
[N.DB.009]
Each
link object holds the following data:
an
id; the Diagram object provides constants for each of the valid link types.
[N.DB.013]
a
type
a
list of vertex id’s to vertices defining the link; the first and last vertices
are associated with labels, thereby attaching the link to a label at each end;
internal vertices are bends in the link; link forks may begin at any internal
vertices; the last vertex of a fork is attached to a label

a
“hidden” flag
a
“propose to add” flag
a
“propose to delete” flag
a
“deleted” flag
an
“is branch” flag
The
key elements of the Link interface consists of the constructors
Link
( String type, int vertex0IdValue, int vertex1IdValue );
Link
( int id, String type); (used to restore link from file)
accessors
for id, type and list of vertex id’s of
vertices defining the link, flags, and a method for selecting the link
with a point:
boolean
Select(int x, int y);
Since this interface is considered private to the database
manager, except as indicated, it is not strictly controlled by the design.
The
Vertex class represents a point in a diagram.
Vertices are used to construct links, and to attach links to labels.
an
id
x
and y location
Interface
The
key elements of the Vertex interface consists of the constructors
Vertex
( int x, int y );
Vertex
( int id, int x, int y ); (used to restore vertex from file)
accessors
for id, x, y, a method for selecting a vertex with a point:
boolean
Select(int x, int y);
and
a method for moving a point by a displacement dx, dy:
void
Move ( int dx, int dy );
Since this interface is considered private to the database
manager, except as indicated, it is not strictly controlled by the design.
The
Diagram class represents the entire diagram.
A
Diagram holds the following data:
a
filename
list
of labels
list
of links
list
of vertices
a
flag indicating whether or not the diagram has unsaved changes
The
key elements of the Vertex interface consists of the constructor
Diagram()
Additionally the interface includes methods to add labels
and links, select labels, links and vertices, move labels and vertices.
Since this interface is considered private to the database
manager (see below), except as indicated, it is not strictly controlled by the
design.
Download a Java executable of the ClassDiagrammer
(ClassDiagrammerApp.jar)
Download a sample diagram created by the
ClassDiagrammer (BankAccountClasses.cd)