de.saar.chorus.ubench
Class DomGraphLayout

Object
  extended by JGraphLayoutAlgorithm
      extended by ImprovedJGraphLayout
          extended by DomGraphLayout

public class DomGraphLayout
extends ImprovedJGraphLayout

A layout algorithm for a dominance graph represented by a JDomGraph.

Author:
Alexander Koller, Michaela Regneri

Method Summary
 void addRelXtoParent(DefaultGraphCell node, Integer x)
           
 void addRelXtoRoot(DefaultGraphCell node, Integer x)
           
 void addRelYpos(DefaultGraphCell node, Integer y)
           
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.
 Map<DefaultGraphCell,Shape> getNodesToShape()
           
 Shape getNodesToShape(DefaultGraphCell node)
           
 int getNodeWidth(DefaultGraphCell node)
          Returns the node with computed by the JDomGraph.
 Integer getRelXtoParent(DefaultGraphCell node)
           
 Map<DefaultGraphCell,Integer> getRelXtoRoot()
           
 void putNodeToShape(DefaultGraphCell node, Shape shape)
           
 void run(JGraph gr, Object[] cells, int arg2)
          Starts the layout algorithm.
 
Methods inherited from class JGraphLayoutAlgorithm
createDialog, createDialog, createSettings, getHint, getMaximumProgress, getProgress, isAllowedToRun, populateDialog, run, setAllowedToRun, setMaximumProgress, setProgress
 
Methods inherited from class Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Method Detail

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

putNodeToShape

public void putNodeToShape(DefaultGraphCell node,
                           Shape shape)
Specified by:
putNodeToShape in class ImprovedJGraphLayout

run

public void run(JGraph gr,
                Object[] cells,
                int arg2)
Starts the layout algorithm.

Specified by:
run in class ImprovedJGraphLayout

getNodesToShape

public Map<DefaultGraphCell,Shape> getNodesToShape()
Returns:
Returns the nodesToShape.

getRelXtoParent

public Integer getRelXtoParent(DefaultGraphCell node)
Specified by:
getRelXtoParent in class ImprovedJGraphLayout

addRelXtoParent

public void addRelXtoParent(DefaultGraphCell node,
                            Integer x)
Specified by:
addRelXtoParent in class ImprovedJGraphLayout

addRelYpos

public void addRelYpos(DefaultGraphCell node,
                       Integer y)
Specified by:
addRelYpos in class ImprovedJGraphLayout

getNodeWidth

public int getNodeWidth(DefaultGraphCell node)
Description copied from class: ImprovedJGraphLayout
Returns the node with computed by the JDomGraph.

Specified by:
getNodeWidth in class ImprovedJGraphLayout
Parameters:
node -
Returns:
the width of the node

getNodesToShape

public Shape getNodesToShape(DefaultGraphCell node)
Specified by:
getNodesToShape in class ImprovedJGraphLayout

addRelXtoRoot

public void addRelXtoRoot(DefaultGraphCell node,
                          Integer x)
Specified by:
addRelXtoRoot in class ImprovedJGraphLayout

getRelXtoRoot

public Map<DefaultGraphCell,Integer> getRelXtoRoot()
Returns:
Returns the relXtoRoot.