There are five major components in this design:
The Following diagram describes the flow of control within the program
between the major components
The basic flow of control in this program is cyclical . It goes from the UI to the graph to the the CodeGenerator to the Code and then back to the UI . The user uses the UI to specify the graph which is then used by the CodeGenerator to produce lovely C code. This C-code, when executed, then communicates back to the program using some networking protocol and gets the UI to animate its execution which looks cool to the user
The UI is the bridge between the user and the rest of the program. It represents everything the user sees and interacts with. This component contains all of the functionality pertaining to :
The major class in the UI is the GUI which contains all of
the various windows used for viewing and specifying the nodes of
a FORCE graph. The other classes in this package, with the exception of
FCodeAnimator are all physical entities from within the GUI.
The FWin will be an abstract superclass containing functionality common
to all FORCE windows.
The FNodeSelectWin will be a toolbar containing various predefined
node types that the user can drag and drop into his graph. These
Nodes include all of the subclasses of FNode other than the identifiers
(See
Section 2.3 below).
The FVariableWin will be a small window with a scrollable list that
represent the contents of FVariableList (See Section 2.3
below). The user can add variables to the list from here or drag
preexisting ones out to the graph.
The FGraphWIn will be the major window where the user connects his
various nodes into a functional program.
The FMethodWin will be a small scrollable list just like the FVariableWin
which will contain the names of all the functions available to the user.
The User will be able to drag and drop any of these onto the main graph
or by double clicking select one for editing. Editing a function,
or creating a new one, will replace the contents of the FGraphWin with
the SubGraph representing that function. The user can then return
to the main graph by selecting the main() function from the function
list.
The FCodeAnimator is different than the rest of the classes in this
component in that it does not have a physical incarnation. Rather this
class receives network messages from the code being executed and determines
how to animate them in the FGraphVisualizer.
The FgraphVisualizer is an intermediary object between the visual aspect
of the program and the graph that represents the data. The FGraphVisualizer
represents a wrapper around the regular Fgraph. It contain information
pertinent to the display of a node in the FGraphWin.
FNodeVisualizer and FEdgeVisualizer are wrappers around FNode and FEdge
respectively. They contain information such as raster location, color,
shape, and any other property pertinent to their display.
The Graph component contains all of the classes that pertain to the
FORCE visual language. It describes all of the various types of nodes and
the rules that determine how these nodes can be connected.
The Node class represents a a particular language feature. Exactly
which feature is obvious from the nodes class name. Each node has information
in it that determine what types of node it accepts as parameters and which
type it outputs.
Edges then connect the various nodes outputs and inputs. Edges
confirm whether the types are compatible and if not disallow the connection
The Code generator consist
of an abstract superclass that represents a procedural language.
This class represents an interface between a language and the rest of force.
This type of abstraction allows us to support more languages with the force
than just C. In this program, though, there will be only one implementation
for the Code Generator Interface. That is the C-language code generator.
The FApp is the main controlling component that represents the FORCE.
It instantiates the other main components like the GUI, the CodeGenerator
and the Graph. The Gui then instantiates all of the windows. The
windows then create Nodes via the NodeFactory and then send them off to
be packaged by the GraphVisualizer. The GraphVisualizer then passes the
pure node along to the Graph object to be stored and checked for validity
in its connections. Finally the CodeGenrator can be run at any point to
create a program based on the contents of the Graph object.