public class HierarchicalBCEngine extends java.lang.Object implements GraphConstants, LayoutEngine
There have been a few modifications made, however. The crossings function is changed as it was non-linear in time complexity. Furthermore, we don't have any interconnection matrices for each level, instead we just have one big interconnection matrix for the whole graph and a int[][] array which stores the vertices present in each level.
DIRECTED, DOUBLE, NORMAL, PLURAL_DUMMY, REVERSED, SINGULAR_DUMMY
Constructor and Description |
---|
HierarchicalBCEngine()
SimpleConstructor If we want to instantiate the class first, and if
information for nodes and edges is not available.
|
HierarchicalBCEngine(java.util.ArrayList<GraphNode> nodes,
java.util.ArrayList<GraphEdge> edges,
int nodeWidth,
int nodeHeight)
Constructor - takes in FastVectors of nodes and edges, and the initial
width and height of a node
|
HierarchicalBCEngine(java.util.ArrayList<GraphNode> nodes,
java.util.ArrayList<GraphEdge> edges,
int nodeWidth,
int nodeHeight,
boolean edgeConcentration)
Constructor - takes in FastVectors of nodes and edges, the initial width
and height of a node, and a boolean value to indicate if the edges should
be concentrated.
|
Modifier and Type | Method and Description |
---|---|
void |
addLayoutCompleteEventListener(LayoutCompleteEventListener l)
Method to add a LayoutCompleteEventListener
|
void |
fireLayoutCompleteEvent(LayoutCompleteEvent e)
Fires a LayoutCompleteEvent.
|
javax.swing.JPanel |
getControlPanel()
This method returns a handle to the extra controls panel, so that the
visualizing class can add it to some of it's own gui panel.
|
java.util.ArrayList<GraphNode> |
getNodes()
give access to set of graph nodes
|
javax.swing.JProgressBar |
getProgressBar()
Returns a handle to the progressBar of this LayoutEngine.
|
void |
layoutGraph()
This method does a complete layout of the graph which includes removing
cycles, assigning levels to nodes, reducing edge crossings and laying out
the vertices horizontally for better visibility.
|
void |
phaseIID(int lindex,
int[][] levels)
See Sugiyama et al.
|
void |
phaseIIU(int lindex,
int[][] levels)
See Sugiyama et al.
|
void |
phaseIU(int lindex,
int[][] levels)
See Sugiyama et al.
|
void |
removeLayoutCompleteEventListener(LayoutCompleteEventListener e)
Method to remove a LayoutCompleteEventListener.
|
void |
setNodesEdges(java.util.ArrayList<GraphNode> nodes,
java.util.ArrayList<GraphEdge> edges)
Sets the nodes and edges for this LayoutEngine.
|
void |
setNodeSize(int nodeWidth,
int nodeHeight)
Sets the size of a node.
|
public HierarchicalBCEngine(java.util.ArrayList<GraphNode> nodes, java.util.ArrayList<GraphEdge> edges, int nodeWidth, int nodeHeight)
public HierarchicalBCEngine(java.util.ArrayList<GraphNode> nodes, java.util.ArrayList<GraphEdge> edges, int nodeWidth, int nodeHeight, boolean edgeConcentration)
nodes
- - FastVector containing all the nodesedges
- - FastVector containing all the edgesnodeWidth
- - A node's allowed widthnodeHeight
- - A node's allowed heightedgeConcentration
- - True: if want to concentrate edges, False:
otherwisepublic HierarchicalBCEngine()
public java.util.ArrayList<GraphNode> getNodes()
getNodes
in interface LayoutEngine
public javax.swing.JPanel getControlPanel()
getControlPanel
in interface LayoutEngine
public javax.swing.JProgressBar getProgressBar()
getProgressBar
in interface LayoutEngine
public void setNodesEdges(java.util.ArrayList<GraphNode> nodes, java.util.ArrayList<GraphEdge> edges)
setNodesEdges
in interface LayoutEngine
nodes
- - FastVector containing all the nodesedges
- - FastVector containing all the edgespublic void setNodeSize(int nodeWidth, int nodeHeight)
setNodeSize
in interface LayoutEngine
nodeWidth
- - A node's allowed widthnodeHeight
- - A node's allowed heightpublic void addLayoutCompleteEventListener(LayoutCompleteEventListener l)
addLayoutCompleteEventListener
in interface LayoutEngine
l
- - Listener to receive the LayoutCompleteEvent by this class.public void removeLayoutCompleteEventListener(LayoutCompleteEventListener e)
removeLayoutCompleteEventListener
in interface LayoutEngine
e
- - The LayoutCompleteEventListener to remove.public void fireLayoutCompleteEvent(LayoutCompleteEvent e)
fireLayoutCompleteEvent
in interface LayoutEngine
e
- - The LayoutCompleteEvent to firepublic void layoutGraph()
The layout is performed in a separate thread and the progress bar of the class is updated for each of the steps as the process continues.
layoutGraph
in interface LayoutEngine
public void phaseIU(int lindex, int[][] levels)
public void phaseIID(int lindex, int[][] levels)
public void phaseIIU(int lindex, int[][] levels)