The graph model to be displayed.
Routine called whenever a vertex is clicked on with a mouse. The first parameter is the vertex itself (an mxCell). The second parameter is an object which was bound to the vertex when that vertex was created.
Routine called whenever an edge is clicked on with a mouse. The first parameter is an object which was bound to the edge when that edge was created.
Draws a String on top of the given vertex in its bottom-right corner.
Computes the shortest path distances from each cell in the graph to every other cell and returns the result as a map from src -> (sink -> distance).
Computes the shortest path distances from each cell in the graph to every other cell and returns the result as a map from src -> (sink -> distance). Unreachable cells will have a distance of None, the source cell has a distance of 0.
Layout the graph in a compact, hierarchical structure.
Draws an annotation on each vertex showing the shortest path distance from cell to the vertex.
When enabled, delay annotations drawn on cells will persist even after the mouse is no longer hovering over the cell.
When enabled, delay annotations drawn on cells will persist even after the mouse is no longer hovering over the cell. Otherwise, they vanish the moment the mouse leaves the cell's bounds.
(Since version ) see corresponding Javadoc for more information.
(Since version ) see corresponding Javadoc for more information.
(Since version ) see corresponding Javadoc for more information.
(Since version ) see corresponding Javadoc for more information.
(Since version ) see corresponding Javadoc for more information.
(Since version ) see corresponding Javadoc for more information.
(Since version ) see corresponding Javadoc for more information.
(Since version ) see corresponding Javadoc for more information.
(Since version ) see corresponding Javadoc for more information.
(Since version ) see corresponding Javadoc for more information.
(Since version ) see corresponding Javadoc for more information.
(Since version ) see corresponding Javadoc for more information.
(Since version ) see corresponding Javadoc for more information.
(Since version ) see corresponding Javadoc for more information.
(Since version ) see corresponding Javadoc for more information.
(Since version ) see corresponding Javadoc for more information.
(Since version ) see corresponding Javadoc for more information.
(Since version ) see corresponding Javadoc for more information.
(Since version ) see corresponding Javadoc for more information.
(Since version ) see corresponding Javadoc for more information.
(Since version ) see corresponding Javadoc for more information.
(Since version ) see corresponding Javadoc for more information.
(Since version ) see corresponding Javadoc for more information.
(Since version ) see corresponding Javadoc for more information.
(Since version ) see corresponding Javadoc for more information.
(Since version ) see corresponding Javadoc for more information.
(Since version ) see corresponding Javadoc for more information.
(Since version ) see corresponding Javadoc for more information.
(Since version ) see corresponding Javadoc for more information.
(Since version ) see corresponding Javadoc for more information.
(Since version ) see corresponding Javadoc for more information.
(Since version ) see corresponding Javadoc for more information.
(Since version ) see corresponding Javadoc for more information.
(Since version ) see corresponding Javadoc for more information.
(Since version ) see corresponding Javadoc for more information.
(Since version ) see corresponding Javadoc for more information.
(Since version ) see corresponding Javadoc for more information.
(Since version ) see corresponding Javadoc for more information.
(Since version ) see corresponding Javadoc for more information.
(Since version ) see corresponding Javadoc for more information.
(Since version ) see corresponding Javadoc for more information.
A Panel which displays a Graph (vertices and edges). The graph uses rectangles filled with one or two lines of text for the vertices, and lines terminated with an arrowhead for the edges. The graph is automatically placed using a vertical hierarchical placement algorithm; this means that very large graphs may take a long time to display since the placement algorithmic is roughly quadratic.
The panel has "as-needed" scrollbars to accommodate large graphs, but there is no mechanism for resizing the graph itself. The placement algorithm attempts to make as compact of a layout as it can, so this should not be too big of a problem. Java2D might be used later to add zooming if needed.
A vertex or edge within the viewed graph may be "selected" or "deselected" by clicking on it with the mouse; the selected state toggles with each click. Graphically the selected state is shown as a heavy, black line (edge) or heavy, black bounding box (vertex). Deselecting a vertex or edge returns it to a thinner, lighter appearance.
When a vertex or edge has its selected state changed by the user's mouse, a vertexEvent or edgeEvent is generated respectively. These create calls into user specified routines, "vertexEvent" or "edgeEvent", to report the state change. When either routine is called, the user object associated with the vertex or edge is passed as the first parameter, and the new selected state is passed as the second parameter. See the Graph class below for a description of how user objects are associated with vertices and edges.
Note that creating a GraphPanel freezes the state of the Graph being displayed, so that edges or vertices may no longer be added to it. It would be fairly easy to allow for dynamic modification in the future.