类 HierarchicalBCEngine

java.lang.Object
weka.gui.graphvisualizer.HierarchicalBCEngine
所有已实现的接口:
GraphConstants, LayoutEngine

public class HierarchicalBCEngine extends Object implements GraphConstants, LayoutEngine
This class lays out the vertices of a graph in a hierarchy of vertical levels, with a number of nodes in each level. The number of levels is the depth of the deepest child reachable from some parent at level 0. It implements a layout technique as described by K. Sugiyama, S. Tagawa, and M. Toda. in "Methods for visual understanding of hierarchical systems", IEEE Transactions on Systems, Man and Cybernetics, SMC-11(2):109-125, Feb. 1981.

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.

版本:
$Revision: 10503 $ - 24 Apr 2003 - Initial version (Ashraf M. Kibriya)
作者:
Ashraf M. Kibriya (amk14@cs.waikato.ac.nz)
  • 构造器详细资料

    • HierarchicalBCEngine

      public HierarchicalBCEngine(FastVector nodes, FastVector edges, int nodeWidth, int nodeHeight)
      Constructor - takes in FastVectors of nodes and edges, and the initial width and height of a node
    • HierarchicalBCEngine

      public HierarchicalBCEngine(FastVector nodes, FastVector 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.
      参数:
      nodes - - FastVector containing all the nodes
      edges - - FastVector containing all the edges
      nodeWidth - - A node's allowed width
      nodeHeight - - A node's allowed height
      edgeConcentration - - True: if want to concentrate edges, False: otherwise
    • HierarchicalBCEngine

      public HierarchicalBCEngine()
      SimpleConstructor If we want to instantiate the class first, and if information for nodes and edges is not available. However, we would have to manually provide all the information later on by calling setNodesEdges and setNodeSize methods
  • 方法详细资料

    • getNodes

      public FastVector getNodes()
      give access to set of graph nodes
      指定者:
      getNodes 在接口中 LayoutEngine
    • getControlPanel

      public 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.
      指定者:
      getControlPanel 在接口中 LayoutEngine
    • getProgressBar

      public JProgressBar getProgressBar()
      Returns a handle to the progressBar of this LayoutEngine.
      指定者:
      getProgressBar 在接口中 LayoutEngine
    • setNodesEdges

      public void setNodesEdges(FastVector nodes, FastVector edges)
      Sets the nodes and edges for this LayoutEngine. Must be used if the class created by simple HierarchicalBCEngine() constructor.
      指定者:
      setNodesEdges 在接口中 LayoutEngine
      参数:
      nodes - - FastVector containing all the nodes
      edges - - FastVector containing all the edges
    • setNodeSize

      public void setNodeSize(int nodeWidth, int nodeHeight)
      Sets the size of a node. This method must be used if the class created by simple HierarchicalBCEngine() constructor.
      指定者:
      setNodeSize 在接口中 LayoutEngine
      参数:
      nodeWidth - - A node's allowed width
      nodeHeight - - A node's allowed height
    • addLayoutCompleteEventListener

      public void addLayoutCompleteEventListener(LayoutCompleteEventListener l)
      Method to add a LayoutCompleteEventListener
      指定者:
      addLayoutCompleteEventListener 在接口中 LayoutEngine
      参数:
      l - - Listener to receive the LayoutCompleteEvent by this class.
    • removeLayoutCompleteEventListener

      public void removeLayoutCompleteEventListener(LayoutCompleteEventListener e)
      Method to remove a LayoutCompleteEventListener.
      指定者:
      removeLayoutCompleteEventListener 在接口中 LayoutEngine
      参数:
      e - - The LayoutCompleteEventListener to remove.
    • fireLayoutCompleteEvent

      public void fireLayoutCompleteEvent(LayoutCompleteEvent e)
      Fires a LayoutCompleteEvent.
      指定者:
      fireLayoutCompleteEvent 在接口中 LayoutEngine
      参数:
      e - - The LayoutCompleteEvent to fire
    • layoutGraph

      public 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. The removing of cycles and assignment of levels is only performed if hasn't been performed earlier or if some layout option has been changed and it is necessary to do so. It is necessary to do so, if the user selects/deselects edge concentration or topdown/bottomup options.

      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 在接口中 LayoutEngine
    • phaseIU

      public void phaseIU(int lindex, int[][] levels)
      See Sugiyama et al. 1981 (full reference give at top) lindex is the index of the level we want to process. In this method we'll sort the vertices at the level lindex according to their DOWN-barycenters (or row barycenters).
    • phaseIID

      public void phaseIID(int lindex, int[][] levels)
      See Sugiyama et al. 1981 (full reference give at top)
    • phaseIIU

      public void phaseIIU(int lindex, int[][] levels)
      See Sugiyama et al. 1981 (full reference give at top)