Class DomGraphLayout


public class DomGraphLayout extends FragmentLayoutAlgorithm
A layout algorithm for a dominance graph represented by a JDomGraph.
Author:
Alexander Koller, Michaela Regneri
  • Constructor Details

    • DomGraphLayout

      public DomGraphLayout()
      Initializes a new dominance graph layout of a given dominanc graph.
      Parameters:
      gr - the graph to compute the layout for
  • Method Details

    • initialise

      public void initialise(DomGraph gr, NodeLabels labels, Canvas canv) throws LayoutException
      Overrides:
      initialise in class FragmentLayoutAlgorithm
      Throws:
      LayoutException
    • addToMapList

      public static <E, T> void addToMapList(Map<E,List<T>> map, E key, T nVal)
      Generic method that handles maps from an Object to a list of objects and ads a new entry to the value list with the specified object key. If the map does not contain the key yet, it is added.
      Type Parameters:
      E - the key type
      T - the type of the list elements
      Parameters:
      map - the map
      key - the key to which list the new value shall be added
      nVal - the new value
    • computeFragmentPositions

      protected void computeFragmentPositions()
      computes the whole fragment graph. computes the fragment's x-position with undirected DFS, the fragment's later y-position performing directed DFS (for each root).
      Specified by:
      computeFragmentPositions in class FragmentLayoutAlgorithm
    • computeNodePositions

      protected void computeNodePositions()
      computes the position of all nodes considering their relative poitions within a fragment and the position of their fragment (cp. its fragment node).
      Specified by:
      computeNodePositions in class FragmentLayoutAlgorithm
    • drawEdges

      protected void drawEdges()
      Specified by:
      drawEdges in class FragmentLayoutAlgorithm
    • placeNodes

      protected void placeNodes()
      places the nodes in the graph model. Not meaningful without having computed the fragment graph as well as the relative x- and y-positions.
      Specified by:
      placeNodes in class FragmentLayoutAlgorithm