ClassDiagrammer Software Engineering Documentation

 

1. Introduction

 

Requirements

 

2. Requirements Overview

 

3. Usage Scenario

 

4. Functional Requirements

 

5. Non-functional requirements

 

Design

 

6. Fundamental Concepts

 

7. System Structure - The 30,000 ft view

 

 

8. Subsystem objects and interfaces

 

Database

 

The database subsystem is represented by DatabaseManager [N.DB.013] class, which holds a Diagram object.

 

The controlled public interface to the database subsystem consists of:

 

DatabaseManager();

 

void Clear();

 

void MarkModified();

 

boolean HasUnsavedChanges();

 

Label AddClassLabel(String s, int x, int y);

 

Label AddClassMemberLabel(String s, int x, int y)

 

Label AddInterfaceLabel(String s, int x, int y);

 

Label AddInterfaceMethodLabel(String s, int x, int y);

 

Label AddNote(String s, int x, int y);

 

Vertex AddVertex(int x, int y);

 

Link LinkLabels(Label label0, int x0, int y0, Label label1, int x1, int y1, String linkType );  The Diagram object provides constants for each of the valid link types. [N.]

 

List<Label> GetLabelList();

 

List<Link> GetLinkList();

 

Vertex GetVertexById(int id);

 

Label SelectLabel(int x, int y);

 

Link SelectLink(int x, int y);

 

Vertex SelectVertex(int x, int y);

 

 

Graphics

 

The graphics subsystem, represented by the GraphicsManager [N.UI.012] class, is a utility used to render the diagram.  At the lowest level are calls to the platform-specific graphics utilities that perform the actual rendering.  The display subsystem call database interface methods to obtain diagram data to display.

 

The controlled public interface to the graphics subsystem consists of:

 

GraphicsManager();

 

Init (DatabaseManager dbManager );

 

void forceRepaint();

 

XCanvas getTheCanvas(); (see “Platform Considerations” for explanation of XCanvas)

 

bool showLinkBends

 

bool showHiddenItems

 

void enableTempLine(bool enable);

 

void setTempLine(int x0, int y0, int x1, int y1);

 

The latter two methods are used to instruct the graphics manager to draw a temporary line. This feature is used to implement rubber-banding.

 

 

User Interface

 

The user interface subsystem, represented by the UserInterfaceManager [N.UI.011] class, sets up the user interface, and collects and processes user actions.  These actions typically represent user instructions for some change to a class diagram.  All such changes are made via appropriate database interface calls. 

 

The controlled interface consists of:

 

UserInterfaceManager();

 

void Init ();

 

Additional controlled design elements are:

 

(1) the contents of the menus

 

(2) the appearance of the diagram elements

 

(3) user interface event handling via a state machine

 

 

Menus:

 

The main menu bar contains the following menus:

 

File

 

View

 

Options

 

The File menu contains the following items

 

New

 

Open…

 

Save

 

Save As…

 

The View menu contains

 

Repaint

 

The Options menu contains

 

[checkbox] Show link bends (initialized to false)

 

[checkbox] Show hidden items (initialized to false)

 

[checkbox] Show key (initialized to true)

 

 

Context menus:

 

Create (appears in context of no selection)

 

Label (appears in context of label selection)

 

Link (appears in context of link selection)

 

Vertex (appears in context of vertex selection)

 

 

The Create context menu contains:

 

New label >

 

          Class

 

          Class member

 

          Interface

 

          Interface method

 

          Note

 

New link >

 

          IsAKindOf

 

          IsA

 

          HasA

 

          Uses

 

          Implements interface

 

          Interface specifies

 

 

The Label context menu contains:

 

Change text

 

Change to >

 

          Class

 

          Class member

 

          Interface

 

          Interface method

 

          Note

 

Hide >

          Yes

 

          No

 

Mark >

 

          Propose to add

 

          Propose to delete

 

None

 

Delete

 

 

The Link context menu contains:

 

Change to >

 

          IsAKindOf

 

          IsA

 

          HasA

 

          Uses

 

          Implements interface

 

          Interface specifies

 

Add bend

 

Hide >

          Yes

 

          No

 

Mark >

 

          Propose to add

 

          Propose to delete

 

None

 

Delete

 

 

The Vertex context menu contains:

 

Add branch >

 

          IsAKindOf

 

          IsA

 

          HasA

 

          Uses

 

          Implements interface

 

          Interface specifies

 

 

Diagram elements:

 

A label appears as a string of text in Arial 12-point font.  The text is centered on the baseline center reference point.

 

 

A link appears as a series of connected line segments.  The parent end is identified by a solid square with sides having length 5 pixels.  When bends are shown, each internal vertex is shown as a solid circle with a diameter of 3 pixels.  When the user is moving the mouse to define the second point of a link segment, a gray rubber-banded line follows the mouse.

 

The figure below shows a link with several segments with bend vertices shown as solid circles.  Note that the upper bend vertex would be difficult to select if its location was not indicated with a circle.

 

 

 

A “proposed to add” symbol on a label is a ‘+’ character in Arial 18-point font at the upper left of the text string.  A “propose to delete” symbol is an ‘X’ character in Arial 18-point font at the same location.

 

A “proposed to add” symbol on a link is a ‘+’ character in Arial 18-point font with its left baseline point at the midpoint of the first link segment.  A “propose to delete” symbol is an ‘X’ character in Arial 18-point font at the same location.

 

The figure below shows annotations proposing to replace ParentClass0 with ParentClass1.

 

 

 

User Interface State Machine:

 

The user interface event handling logic is based on a state machine, a collection of user interface states and events.  Events, consisting of menu item selections, mouse moves and clicks, and key presses, cause the state machine to perform operations and to change states.

 

Details regarding states and events are left to the discretion of implementers.

 

 

9. Primary Data and Objects

 

 

 

Download a Java executable of the ClassDiagrammer (ClassDiagrammerApp.jar)

 

Download a sample diagram created by the ClassDiagrammer (BankAccountClasses.cd)

 

 

Copyright © 2009 John Keklak.  All rights reserved.  Based on version 090515a.