This could be last "drawing" stuff we do for a while.
Draw them neatly, with right angle turns in the open spaces between
modules. Divide each edge into sub-edges based on the number of
rows and columns needed for the modules.
|
Methods Lists by Module for Design: DrawConnections
|
To Task List
|
| ModuleEdge.java | This defines the north, south, east, or west edge of the rectangle
representation of an SGSModule. |
| 13. ModuleEdge() | Constructor that takes a type (NORTH, HORIZONTAL) or two and
two points or one point and a width or height. |
| 42. addStartPoints | Adds an "EndPoint", incomplete object, to this ModuleEdge. The x,y position
of this point along the edge will be determined after all method calls
and callees have been assigned to edges, so as to minimize the number
of crossing lines, etc. |
| 43. addStopPoints | Adds an "EndPoint", incomplete object, to this ModuleEdge. The x,y position
of this point along the edge will be determined after all method calls
and callees have been assigned to edges, so as to minimize the number
of crossing lines, etc. |
| 44. getSubEdge(int) | Get the SubEdge corresponding to the supplied column or row position.
This position is determined by the position of the module that will be
on the other side of the connection to an EndPoint on this SubEdge. |
| 45. createSubEdges | Chunk up the module's rectangle edges into sub edges based on
number of columns and rows determined in module map. These sub
edges will enable a smarter way of drawing the connections. Save these
sub edges in a Vector data member of ModuleEdge. |
| 54. getNextFreeEndpoint | Returns the next free endpoint (starting from left or top depending on
edge's orientation). This is usually used for getting an endpoint on the
calling module's subedge. Uses moduleMap, and the moduleID that this
module Edge belongs to. Uses the opposing module ID to detemine
this is the right edge (use onNorthEdge, etc. as is used in counting
connections). |
| ModuleSubEdge.java | This defines a subdivision of each of the north, south, east, or west
edges of the rectangle representation of an SGSModule. Each ModuleEdge
will maintain a list of its ModuleSubEdges, as each SGSModule will maintain
a list of its ModuleEdge. |
| 15. ModuleSubEdge() | Constructor that takes a type (NORTH, HORIZONTAL) or two and
two points or one point and a width or height. |
| 19. addEndPoint | Adds a new EndPoint to this sub edge. |
| 24. getCenterPointOfN | Returns the endpoint which is the "center" endpoint of the N that are
being used up. N is passed in here to the callee module's sub edge.
N is the number of callers on the opposite module's sub edge. Done
to make sure that we don't draw funky connection lines. |
| 25. getNextFreeEndpoint | Returns the next free endpoint (starting from left or top depending on
edge's orientation). This is usually used for getting an endpoint on the
calling module's subedge. |
| EndPoint.java | This defines a point on one of the ModuleSubEdges (and therefore
one of the edges, and therefore one of the modules). It represents
either the calling method end of a Connection object, or the called
method of a Connection object. |
| 16. EndPoint() | Constructor that (maybe) takes a type (NORTH, HORIZONTAL) or two and
DEFINITELY an x,y position (and a method ID?). |
| 32. isFree | Returns true if this EndPoint has not yet been assigned to a Method
(either caller or callee). |
| 46. addCounterpartModuleID | Add the int ID of the module that contains the end point that will be on
the other end of the connection from this endpoint. Hopefully, however
this value gets set to this endpoint, the endpoint on the other end will
look for this endpoint on this edge. |
| SGSConnection.java | Superclass for various types of connections that can be drawn between
modules. Initially, this will be limited to method calls from one method
in a module to a method in another. Superclass maintains the two
endpoints, as well as a list of intermediate points along the way. These
intermediate points are taken from the "grid of open space points". |
| 27. Connection | Constructor that accepts two EndPoints. |
| MethodCall.java | Derived from Connection, this represents a method call from one method
in a module to a method in another. This adds method and module
information to the Connection object. |
| 26. MethodCall | Constructor that accepts two method IDs and their corresponding
EndPoints. |
| 30. draw | Draw a line connecting all the points. If "getBestPath" works ok, the line
should be nice and clean and not writing over anyone. |
| Graph.java | This class represents the Graph, which is a graph of modules. The Graph is defined
in an XML file which is opened for read by the caller to the Graph constructor. An Graph
is made up of a number of SGSModule objects, each of which represents a module to be drawn and, in
this initial version, exported to a jpeg or gif file. The main data item in this Graph is
a "Document", which is an internal representation of the nodes of an XML document. |
| 0. connections | Not a method, a two dimensional array that tracks number of connections
between two modules, whose IDs are used as subscripts into this
array. |
| 7. populateGraph | Builds a Graph using the "nodes" in the supplied XML file. |
| 9. draw | Draw each module to the graph.
At some point, we'll have some fancy algorithm to put the rectangles
in the proper place based on the number of method calls in and out. |
| 17. getTotalConnectionsBetweenModules | Returns the total number of connections between modules, regardless of direction. |
| 20. sortByModule | Sort methodCallers vector by module that makes the most calls. |
| 21. sortMethodsByModule | Sort methods vector by modules that makes the most calls to the methods.
NOTE: This is called before 20 in 12. |
| 31. addToMethodCallList | In case we want to do something fancy with all the drawn method calls
(highlight as the cursor goes over them!), we probably will maintain a list
in Graph. And maybe this is where we'll end up drawing the connections
from as well. |
| 49. getContainingModule | Get the ID of the module of which the supplied method is a member. |
| 50. getModuleByID | Return the nth module, given a supplied n. |
| 55. getModuleMap | Return the moduleMap for others that may need it (SGSDFSTree) |
| ModuleMap.java | This class represents the ModuleMap, which supports the Graph of modules.
This class helps lay out the modules of the Graph into a nice grid and helps maintain
who's where on the grid. |
| 1. getNumberOfRows | Return the number of rows (already computed) to be put into this ModuleMap. |
| 2. getNumberOfColumns | Return the number of columns (already computed) to be put into this ModuleMap. |
| 3. getRowPosition | Return the row position of the supplied module ID. |
| 4. getColumnPosition | Return the column position of the supplied module ID. |
| 8. draw | Draw the plots in the right place. |
| 11. drawConnections | Use the sortedTotalArray to draw theconnections between modules. Draw
connections to/from most connected module to others, the to/from the
next most connected, etc. |
| 18. getModuleAtPosition | Returns the ID of the module at the supplied row, column position. |
| 33. getModuleHeight | Return the height of each module. |
| 34. getModuleWidth | Return the width of each module. |
| 35. assignConnectionsToModuleSides | Go through the connections,
assigning counts to the north, south, east, or west
sides of the rectangle representation of the drawn modules. |
| 36. assignConnectionsDirectionally | Go through the connections,
assigning counts to the north, south, east, or west
sides of the rectangle representation of the drawn modules. |
| 37. onNorthEdge | Return true if connection to row2, column2 from
row1, column1 should be placed on module in row1, col1's
north edge...many cases. |
| SGSModule.java | This class represents a software module, either a class or a C file, which will be analyzed
as part of a functional area of a software program. This SGSModule will be drawn on a
collaboration graph, represented by the class Graph. |
| 5. SGSModule( String title, String description, Graph containingGraph) | A constructor, built from the GUI dialog box (title, description), leaving the rest
to be updated by SetAxis and AddMethod dialog boxes. |
| 6. SGSModule( Node methodNode, Graph containingGraph) | The constructor, building with a Node info from a parsed XML file (Document) |
| 10. draw( Graphics g, int x, int y, int w, int h) | Draw the module to the screen as a rectangle using the supplied x,y
and width and height. |
| 12. drawConnection | Draw all the connections to the methods in this module. Draw the labels
representing these methods as numbers on the proper edge of the
rectangle representing the module. NOTE: This is now called AFTER
all subedges and endpoints have been determined. |
| 14. createSubEdges | Chunk up the module's rectangle edges into sub edges based on
number of columns and rows determined in module map. These sub
edges will enable a smarter way of drawing the connections. |
| 38. addToNorthConnections(int n, int module1, int module2) | Adds the supplied number to the total of connections that
should be drawn off north side of rectangle. Also figures out the
counts of connections between the supplied modules based on the
connection's direction. |
| 39. addToNorthConnections(int n) | Adds the supplied number to the total of connections that
should be drawn off north side of rectangle. |
| 40. addNorthConnectionStarts | Adds the supplied number of connection origin points
from this module's top edge to the suppied module id. |
| 41. addNorthConnectionStops | Adds the supplied number of connection destination
points from this module to the suppied module id. |
| 47. drawTheLine | Use information about the modules and the supplied positions
to draw a nice line, that doesn't overlap other stuff. |
| 48. drawUncalledMethodLabels | Draws the labels of uncalled methods
of this module at the appropriate positions
on the previously assigned rectangle edge. |
| 51. getStopEdgeDirection | Returns the direction (N,S,E,W) of the edge
of this module to which the module whose ID is passed in. |
| 52. getNextEdgePosition | Based on the supplied direction, return the
next unused edge position usable for a drawn method call.
A side effect (not really) is that the number used is incremented.
Later, we might use a function to pick positions in some other
way (if we want first position to be in the center of the edge). |
| 53. getStartEdgeDirection | Returns the direction (N,S,E,W) of the edge
of this module to which the module whose ID is passed in. |
| SGSMethod.java | This class represents the SGSMethod, which stores information about a method of
a particular SGSModule. The SGSMethod will be drawn as a number in the box
that represents the SGSModule |
| 22. getMethodCallers | Return the list of ids of methods that call this method. This is also called
before 20 (sortByModule) in 12. (drawConnection). |
| Vector methodCallers | Not really a module, but an important object defined in SGSModule->
drawConnection. Need to note that we get this guy's size to get the
use up the right number of endpoints from the subedge. |
| 23. size | Returns the size of the Vector. |
| OpenSpace.java | Singleton class that contains all free points that can be used to draw
the connections between methods. These free points are made up of
those points on the graph which are not "drawn over" by the rectangles
which are the modules. |
| 28. getBestPath | Based on the two supplied EndPoints, return a list of points that represent
the best path that connects them. |
| 29. OpenSpacePoints | Constructor that determines all the "open space" points based on what
the module map has figured out. Called after moduleMap.draw is done,
but before drawConnections. |